From 2c01349db03f68eb23c8967bfa4cde4ec65b0091 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Thu, 11 Jun 2020 14:32:18 +0200 Subject: [PATCH] better handling of not-nsm clients where the command does not exist --- qtgui/opensessioncontroller.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/qtgui/opensessioncontroller.py b/qtgui/opensessioncontroller.py index da11aff..40cf460 100644 --- a/qtgui/opensessioncontroller.py +++ b/qtgui/opensessioncontroller.py @@ -108,15 +108,14 @@ class ClientItem(QtWidgets.QTreeWidgetItem): icon = programIcons[clientDict["executable"]] self.setIcon(self.parentController.clientsTreeWidgetColumns.index("reportedName"), icon) #reported name is correct here. this is just the column. - - #TODO: this should be an nsmd status. Check if excecutable exists. nsmd just reports "stopped", and worse: after a long timeout. nameColumn = self.parentController.clientsTreeWidgetColumns.index("reportedName") - if not self.text(nameColumn): #Empty string because program not found + if clientDict["reportedName"] is None: self.setText(nameColumn, clientDict["executable"]) - self.setText(self.parentController.clientsTreeWidgetColumns.index("lastStatus"), QtCore.QCoreApplication.translate("OpenSession", "(command not found)")) - #We cannot disable the item because then it can't be selected for resume - #self.setDisabled(clientDict["lastStatus"] == "stopped") + #TODO: this should be an nsmd status. Check if excecutable exists. nsmd just reports "stopped", and worse: after a long timeout. + if clientDict["lastStatus"] == "stopped" and clientDict["reportedName"] is None: + self.setText(self.parentController.clientsTreeWidgetColumns.index("lastStatus"), QtCore.QCoreApplication.translate("OpenSession", "(command not found)")) + class ClientTable(object): """Controls the QTreeWidget that holds loaded clients"""