Add 'max_connections' to status bar and tray tooltip
This commit is contained in:
parent
a132c6a038
commit
652639540f
|
@ -834,6 +834,7 @@ class DelugeGTK:
|
||||||
# Update Statusbar and Tray Tips
|
# Update Statusbar and Tray Tips
|
||||||
core_state = self.manager.get_state()
|
core_state = self.manager.get_state()
|
||||||
connections = core_state['num_peers']
|
connections = core_state['num_peers']
|
||||||
|
max_connections = int(self.config.get("max_connections"))
|
||||||
dlrate = common.frate(core_state['download_rate'])
|
dlrate = common.frate(core_state['download_rate'])
|
||||||
ulrate = common.frate(core_state['upload_rate'])
|
ulrate = common.frate(core_state['upload_rate'])
|
||||||
if self.config.get("max_download_rate") < 0:
|
if self.config.get("max_download_rate") < 0:
|
||||||
|
@ -844,9 +845,9 @@ class DelugeGTK:
|
||||||
ulrate_max = _("Unlimited")
|
ulrate_max = _("Unlimited")
|
||||||
else:
|
else:
|
||||||
ulrate_max = common.frate(self.config.get("max_upload_rate_bps"))
|
ulrate_max = common.frate(self.config.get("max_upload_rate_bps"))
|
||||||
|
|
||||||
self.statusbar_temp_msg = '%s: %s %s: %s (%s) %s: %s (%s)'%(
|
self.statusbar_temp_msg = '%s: %s (%s) %s: %s (%s) %s: %s (%s)'%(
|
||||||
_('Connections'), connections, _('Download'),
|
_('Connections'), connections, max_connections, _('Download'),
|
||||||
dlrate, dlrate_max, _('Upload'), ulrate, ulrate_max)
|
dlrate, dlrate_max, _('Upload'), ulrate, ulrate_max)
|
||||||
|
|
||||||
if 'DHT_nodes' in core_state.keys():
|
if 'DHT_nodes' in core_state.keys():
|
||||||
|
@ -858,7 +859,7 @@ class DelugeGTK:
|
||||||
self.statusbar_temp_msg = self.statusbar_temp_msg + ' [DHT: %s]'%(dht_peers)
|
self.statusbar_temp_msg = self.statusbar_temp_msg + ' [DHT: %s]'%(dht_peers)
|
||||||
|
|
||||||
msg = _("Deluge Bittorrent Client") + "\n" + \
|
msg = _("Deluge Bittorrent Client") + "\n" + \
|
||||||
_("Connections") + ": " + str(connections) + "\n" + _("Download") + ": " + \
|
_("Connections") + ": " + str(connections) + " (" + str(max_connections) + ")" + "\n" + _("Download") + ": " + \
|
||||||
dlrate + " (" + dlrate_max + ")" + "\n" + _("Upload") + ": " + ulrate + " (" + ulrate_max + ")"
|
dlrate + " (" + dlrate_max + ")" + "\n" + _("Upload") + ": " + ulrate + " (" + ulrate_max + ")"
|
||||||
|
|
||||||
self.tray_icon.set_tooltip(msg)
|
self.tray_icon.set_tooltip(msg)
|
||||||
|
|
Loading…
Reference in New Issue