From cf1353f065dfa32b87f505e122f95b3cde02d295 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Fri, 12 Feb 2021 18:37:45 +0100 Subject: [PATCH] Don't provide shortcut Ctrl+Q for real quit when under NSM. The option still remains in the menu but Ctrl+Q was too easy to press --- template/qtgui/mainwindow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/template/qtgui/mainwindow.py b/template/qtgui/mainwindow.py index 8851da8..d36bfb6 100644 --- a/template/qtgui/mainwindow.py +++ b/template/qtgui/mainwindow.py @@ -144,10 +144,13 @@ class MainWindow(QtWidgets.QMainWindow): settings = QtCore.QSettings("LaborejoSoftwareSuite", METADATA["shortName"]) if settings.contains("showAboutDialog") and settings.value("showAboutDialog", type=bool): QtCore.QTimer.singleShot(100, self.about.show) #Qt Event loop is not ready at that point. We need to wait for the paint event. This is not to stall for time: Using the event loop guarantees that it exists - elif not self.nsmClient.sessionName == "NOT-A-SESSION": + elif not self.nsmClient.sessionName == "NOT-A-SESSION": #standalone mode + self.ui.actionQuit.setShortcut("") #TODO: this is a hack until we figure out how to cleanly handle hide vs quite from outside the application self.hideGUI() + + self._zoom() #enable zoom factor loaded from save file