Browse Source

better handling of not-nsm clients where the command does not exist

master
Nils 4 years ago
parent
commit
2c01349db0
  1. 11
      qtgui/opensessioncontroller.py

11
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"""

Loading…
Cancel
Save