Delaying the login so the screen can at least showing, improving the perceived perfor...
authorEd Page <eopage@byu.net>
Sat, 16 Oct 2010 20:42:43 +0000 (15:42 -0500)
committerEd Page <eopage@byu.net>
Sat, 16 Oct 2010 20:42:43 +0000 (15:42 -0500)
src/dialcentral_qt.py

index a0bdb7f..148732a 100755 (executable)
@@ -54,8 +54,15 @@ class Dialcentral(object):
                self._app.lastWindowClosed.connect(self._on_app_quit)
                self._mainWindow = MainWindow(None, self)
                self._mainWindow.window.destroyed.connect(self._on_child_close)
+
                self.load_settings()
-               self._mainWindow.start()
+
+               self._mainWindow.show()
+               self._idleDelay = QtCore.QTimer()
+               self._idleDelay.setSingleShot(True)
+               self._idleDelay.setInterval(0)
+               self._idleDelay.timeout.connect(lambda: self._mainWindow.start())
+               self._idleDelay.start()
 
        def load_settings(self):
                try:
@@ -399,7 +406,6 @@ class MainWindow(object):
 
        def start(self):
                assert self._session.state == self._session.LOGGEDOUT_STATE
-               self.show()
                if self._defaultCredentials != ("", ""):
                        username, password = self._defaultCredentials[0], self._defaultCredentials[1]
                        self._curentCredentials = username, password