diff --git a/engine/api.py b/engine/api.py index 5644284..a3ac202 100644 --- a/engine/api.py +++ b/engine/api.py @@ -109,6 +109,7 @@ class Callbacks(object): This will also fire if we start and detect that a session is already open and running. """ for func in self.sessionOpenReady: + print (func) func(nsmSessionExportDict) def _sessionOpenLoading(self, nsmSessionExportDict): diff --git a/qtgui/mainwindow.py b/qtgui/mainwindow.py index 1277f3b..84d4085 100644 --- a/qtgui/mainwindow.py +++ b/qtgui/mainwindow.py @@ -213,7 +213,6 @@ class MainWindow(QtWidgets.QMainWindow): logger.info(f"Got continue session as command line parameter but there is no session available.") - if not self.isVisible(): text = QtCore.QCoreApplication.translate("mainWindow", "Agordejo ready") self.systemTray.showMessage("Agordejo", text, QtWidgets.QSystemTrayIcon.Information, 2000) #title, message, icon, timeout. #has messageClicked() signal. @@ -312,6 +311,7 @@ class MainWindow(QtWidgets.QMainWindow): self.setWindowTitle(nsmSessionExportDict["nsmSessionName"]) self.recentlyOpenedSessions.add(nsmSessionExportDict["nsmSessionName"]) + def toggleVisible(self, force:bool=None): if force is None: newState = not self.isVisible() @@ -503,7 +503,7 @@ class SessionController(object): self._connectMenu() #Callbacks - #api.callbacks.sessionOpenReady.append(lambda nsmSessionExportDict: self._switch("open")) #When loading ist done. This takes a while when non-nsm clients are in the session + api.callbacks.sessionOpenReady.append(lambda nsmSessionExportDict: self._switch("open")) #When loading ist done. This takes a while when non-nsm clients are in the session api.callbacks.sessionClosed.append(lambda: self._setMenuEnabled(None)) api.callbacks.sessionClosed.append(lambda: self._switch("choose")) #The rest is handled by the widget itself. It keeps itself updated, no matter if visible or not. api.callbacks.sessionOpenReady.append(lambda nsmSessionExportDict: self._setMenuEnabled(nsmSessionExportDict))