diff --git a/engine/api.py b/engine/api.py index c801562..0ba4b24 100644 --- a/engine/api.py +++ b/engine/api.py @@ -188,7 +188,7 @@ def sessionRoot(): def currentSession(): return nsmServerControl.internalState["currentSession"] -def sessionList(): +def sessionList()->list: """Updates the list each call. Use only this from a GUI for active query. Otherwise sessionRemove and sessionCopy will not have updated the list""" r = nsmServerControl.exportSessionsAsDicts() @@ -197,24 +197,29 @@ def sessionList(): def buildSystemPrograms(): """Build a list of dicts with the .desktop files (or similar) of all NSM compatible programs present on the system""" + return True programDatabase.build() -def getSystemPrograms(): +def getSystemPrograms()->list: """Returns the cached database from buildProgramDatabase. No automatic update. Empty on program start""" + return [] return programDatabase.programs def setSystemsPrograms(listOfDicts:list): + return True programDatabase.loadPrograms(listOfDicts) def getNsmExecutables()->set: """Cached access fort fast membership tests. Is this program in the PATH?""" + return set() return programDatabase.nsmExecutables -def getUnfilteredExecutables(): +def getUnfilteredExecutables()->list: """Return a list of unique names without paths or directories of all exectuables in users $PATH. This is intended for a program starter prompt. GUI needs to supply tab completition or search - itself""" + itself""" + return [] return programDatabase.unfilteredExecutables diff --git a/qtgui/mainwindow.py b/qtgui/mainwindow.py index 667f86d..7e22e82 100644 --- a/qtgui/mainwindow.py +++ b/qtgui/mainwindow.py @@ -221,8 +221,8 @@ class MainWindow(QtWidgets.QMainWindow): settings = QtCore.QSettings("LaborejoSoftwareSuite", METADATA["shortName"]) settings.remove("programDatabase") - WaitDialog(self, title, text, informativeText, api.buildSystemPrograms) logger.info("Asking api to getSystemPrograms while waiting") + WaitDialog(self, title, text, informativeText, api.buildSystemPrograms) settings.setValue("programDatabase", api.getSystemPrograms()) self._updateGUIWithCachedPrograms() diff --git a/qtgui/waitdialog.py b/qtgui/waitdialog.py index ef72ded..9dbd172 100644 --- a/qtgui/waitdialog.py +++ b/qtgui/waitdialog.py @@ -50,7 +50,7 @@ class WaitDialog(QtWidgets.QMessageBox): #title = QtCore.QCoreApplication.translate("AskBeforeQuit", "About to quit") super().__init__() - logger.info(f"Starting blocking dialog {title}") + logger.info(f"Starting blocking dialog {title} for {longRunningFunction}") self.mainWindow = mainWindow self.setWindowFlag(QtCore.Qt.Popup, True) self.setIcon(self.Information)