|
|
|
@ -332,15 +332,32 @@ class ToolTabWidget(QtGui.QTabWidget):
|
|
|
|
|
if self.FirstWidget.ClientObj.client:
|
|
|
|
|
if host in ['127.0.0.1', 'localhost']:
|
|
|
|
|
self.localhost_ClientObj = self.FirstWidget.ClientObj
|
|
|
|
|
self.connect_dict[host] = [self.FirstWidget.ClientObj, \
|
|
|
|
|
self.currentIndex()]
|
|
|
|
|
if not host in self.connect_dict:
|
|
|
|
|
self.connect_dict[host] = [port]
|
|
|
|
|
else:
|
|
|
|
|
if port:
|
|
|
|
|
if not port in self.connect_dict[host]:
|
|
|
|
|
self.connect_dict[host].append(port)
|
|
|
|
|
self.create_tray()
|
|
|
|
|
if self.FirstWidget.ClientObj.client:
|
|
|
|
|
self.tray.set_icon(True)
|
|
|
|
|
|
|
|
|
|
def connect_count_changed(self, host, port, count):
|
|
|
|
|
self.connect_count += count
|
|
|
|
|
if self.connect_count:
|
|
|
|
|
if count:
|
|
|
|
|
if not host in self.connect_dict:
|
|
|
|
|
self.connect_dict[host] = [port]
|
|
|
|
|
else:
|
|
|
|
|
if port:
|
|
|
|
|
if not port in self.connect_dict[host]:
|
|
|
|
|
self.connect_dict[host].append(port)
|
|
|
|
|
else:
|
|
|
|
|
if host in self.connect_dict:
|
|
|
|
|
if port in self.connect_dict[host]:
|
|
|
|
|
self.connect_dict[host].remove(port)
|
|
|
|
|
if not self.connect_dict[host]:
|
|
|
|
|
self.connect_dict.pop(host)
|
|
|
|
|
|
|
|
|
|
if self.connect_dict:
|
|
|
|
|
self.setWindowIcon(QtGui.QIcon \
|
|
|
|
|
('/usr/share/pixmaps/calculate-console-online.png'))
|
|
|
|
|
if hasattr(self, 'tray'):
|
|
|
|
@ -451,9 +468,9 @@ class ToolTabWidget(QtGui.QTabWidget):
|
|
|
|
|
|
|
|
|
|
def set_localhost(self, ClientObj):
|
|
|
|
|
self.localhost_ClientObj = ClientObj
|
|
|
|
|
if ClientObj:
|
|
|
|
|
self.connect_dict[ClientObj.host_name] = \
|
|
|
|
|
[ClientObj, self.currentIndex()]
|
|
|
|
|
# if ClientObj:
|
|
|
|
|
# self.connect_dict[ClientObj.host_name] = \
|
|
|
|
|
# [ClientObj, self.currentIndex()]
|
|
|
|
|
# self.tabbar.tabButton(self.currentIndex(), \
|
|
|
|
|
# QtGui.QTabBar.ButtonPosition.RightSide).hide()
|
|
|
|
|
|
|
|
|
|