Set the orientation before showing the main window.
authorNeal H. Walfield <neal@walfield.org>
Tue, 6 Sep 2011 08:57:43 +0000 (10:57 +0200)
committerNeal H. Walfield <neal@walfield.org>
Tue, 6 Sep 2011 08:57:43 +0000 (10:57 +0200)
 - Avoid a gratuitious orientation change and speed up start up time.

src/FeedingIt.py

index 68fb7db..cdf478e 100644 (file)
@@ -1100,10 +1100,19 @@ class FeedingIt:
     def __init__(self):
         # Init the windows
         self.window = hildon.StackableWindow()
-        self.window.set_title(__appname__)
         hildon.hildon_gtk_window_set_progress_indicator(self.window, 1)
-        self.mainVbox = gtk.VBox(False,10)
+
+        self.config = Config(self.window, CONFIGDIR+"config.ini")
+
+        try:
+            self.orientation = FremantleRotation(__appname__, main_window=self.window, app=self)
+            self.orientation.set_mode(self.config.getOrientation())
+        except Exception, e:
+            logger.warn("Could not start rotation manager: %s" % str(e))
         
+        self.window.set_title(__appname__)
+        self.mainVbox = gtk.VBox(False,10)
+
         if isfile(CONFIGDIR+"/feeds.db"):           
             self.introLabel = gtk.Label("Loading...")
         else:
@@ -1113,7 +1122,6 @@ class FeedingIt:
 
         self.window.add(self.mainVbox)
         self.window.show_all()
-        self.config = Config(self.window, CONFIGDIR+"config.ini")
         gobject.idle_add(self.createWindow)
 
     def createWindow(self):
@@ -1121,11 +1129,6 @@ class FeedingIt:
         self.listing = Listing(self.config, CONFIGDIR)
 
         self.downloadDialog = False
-        try:
-            self.orientation = FremantleRotation(__appname__, main_window=self.window, app=self)
-            self.orientation.set_mode(self.config.getOrientation())
-        except Exception, e:
-            logger.warn("Could not start rotation manager: %s" % str(e))
         
         menu = hildon.AppMenu()
         # Create a button and add it to the menu