Add 'max_upload_rate' and 'max_download_rate' to tray tooltip.

Will now display 'Unlimited' if the max is -1
This commit is contained in:
Andrew Resch 2007-06-21 00:45:34 +00:00
parent 8454c4b416
commit a132c6a038
1 changed files with 9 additions and 3 deletions

View File

@ -836,7 +836,13 @@ class DelugeGTK:
connections = core_state['num_peers'] connections = core_state['num_peers']
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:
dlrate_max = _("Unlimited")
else:
dlrate_max = common.frate(self.config.get("max_download_rate_bps")) dlrate_max = common.frate(self.config.get("max_download_rate_bps"))
if self.config.get("max_upload_rate") < 0:
ulrate_max = _("Unlimited")
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)'%(
@ -853,7 +859,7 @@ class DelugeGTK:
msg = _("Deluge Bittorrent Client") + "\n" + \ msg = _("Deluge Bittorrent Client") + "\n" + \
_("Connections") + ": " + str(connections) + "\n" + _("Download") + ": " + \ _("Connections") + ": " + str(connections) + "\n" + _("Download") + ": " + \
dlrate + "\n" + _("Upload") + ": " + ulrate dlrate + " (" + dlrate_max + ")" + "\n" + _("Upload") + ": " + ulrate + " (" + ulrate_max + ")"
self.tray_icon.set_tooltip(msg) self.tray_icon.set_tooltip(msg)