Commit e5cda01a authored by Soeren Klemm's avatar Soeren Klemm Committed by d_dree02

getHostDataById now returns the host name es 3rd entry in the tuple, which is...

getHostDataById now returns the host name es 3rd entry in the tuple, which is also displayed in a session item, if available.
parent c51b3528
......@@ -125,7 +125,7 @@ class HostManager(ManagerDialog):
def getHostDataById(self, id):
if id in self.dict["hostorder"]:
return [self.dict["hostlist"][id].host, self.dict["hostlist"][id].port]
return [self.dict["hostlist"][id].host, self.dict["hostlist"][id].port, self.dict["hostlist"][id].name]
def getHostById(self, id):
if id in self.dict["hostorder"]:
......@@ -562,7 +562,7 @@ class HostWidget(QWidget):
if ses is None:
return
self.manager.parent.viewManager.sessionController.loadRemoteSession((self.host.host, self.host.port), ses)
self.manager.parent.viewManager.sessionController.loadRemoteSession((self.host.host, self.host.port, self.host.name), ses)
def setHost(self, host):
self.host = host
......
......@@ -48,7 +48,10 @@ class SessionWidget(QWidget):
self.networkLabel = QLabel()
remote = self.session.remote
self.networkLabel.setText(remote[0] + ":" + str(remote[1]))
if len(remote) > 2: # if remote host has a name, display this name
self.networkLabel.setText(remote[2] + ":" + str(remote[1]))
else:
self.networkLabel.setText(remote[0] + ":" + str(remote[1]))
self.networkLabel.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
remoteLayout.addWidget(self.networkLabel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment