From 0d0ac29c57814266449eb541e963f72292ca8d74 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Thu, 23 Apr 2020 00:35:12 +0200 Subject: [PATCH] Prevent quick program starter against accidental double click --- qtgui/quickopensessioncontroller.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/qtgui/quickopensessioncontroller.py b/qtgui/quickopensessioncontroller.py index 2ec0b92..5ce96cf 100644 --- a/qtgui/quickopensessioncontroller.py +++ b/qtgui/quickopensessioncontroller.py @@ -151,8 +151,7 @@ class StarterClientItem(QtWidgets.QListWidgetItem): self._setIconOverlay("hidden") else: self._setIconOverlay("ready") - - + self.setFlags(QtCore.Qt.ItemIsEnabled) #We can still mouseClick through parent signal when set to NoItemFlags def removed(self): @@ -163,14 +162,17 @@ class StarterClientItem(QtWidgets.QListWidgetItem): self.setFlags(QtCore.Qt.ItemIsEnabled) self._setIconOverlay("stopped") - def handleClick(self): + def handleClick(self): alreadyInSession = api.executableInSession(self.argodejoExec) - #Development-paranoia Start - if self.nsmClientDict: + #Paranoia Start + if self.nsmClientDict is None and alreadyInSession: + #Caught double-click. do nothing, this is a user-accident + return + elif self.nsmClientDict: assert alreadyInSession elif alreadyInSession: assert self.nsmClientDict - #Development-paranoia End + #Paranoia End if not alreadyInSession: api.clientAdd(self.argodejoExec) #triggers status update callback which activates our item.