|
|
@ -134,8 +134,7 @@ class MainWindow(QtWidgets.QMainWindow): |
|
|
|
|
|
|
|
#Starting the engine sends initial GUI data. Every window and widget must be ready to receive callbacks here |
|
|
|
api.eventLoop.start() |
|
|
|
api.startEngine() |
|
|
|
logger.info("Show MainWindow") |
|
|
|
api.startEngine() |
|
|
|
self.restoreWindowSettings() #includes show/hide |
|
|
|
|
|
|
|
#Handle the application data cache. If not present instruct the engine to build one. |
|
|
@ -152,10 +151,12 @@ class MainWindow(QtWidgets.QMainWindow): |
|
|
|
logger.info("First run. Instructing engine to build program database") |
|
|
|
QtCore.QTimer.singleShot(0, self.updateProgramDatabase) #includes self._updateGUIWithCachedPrograms() |
|
|
|
|
|
|
|
logger.info("Deciding if we run as tray-icon or window") |
|
|
|
if not self.isVisible(): |
|
|
|
text = QtCore.QCoreApplication.translate("mainWindow", "Argodejo ready") |
|
|
|
self.systemTray.showMessage("Argodejo", text, QtWidgets.QSystemTrayIcon.Information, 2000) #title, message, icon, timeout. #has messageClicked() signal. |
|
|
|
|
|
|
|
logger.info("Ready for user input. Exec_ Qt.") |
|
|
|
qtApp.exec_() |
|
|
|
#No code after exec_ except atexit |
|
|
|
|
|
|
@ -221,6 +222,7 @@ class MainWindow(QtWidgets.QMainWindow): |
|
|
|
settings.remove("programDatabase") |
|
|
|
|
|
|
|
WaitDialog(self, title, text, informativeText, api.buildSystemPrograms) |
|
|
|
logger.info("Asking api to getSystemPrograms while waiting") |
|
|
|
settings.setValue("programDatabase", api.getSystemPrograms()) |
|
|
|
self._updateGUIWithCachedPrograms() |
|
|
|
|
|
|
|