mimic gtk status-bar->images

This commit is contained in:
Martijn Voncken 2008-02-04 20:26:11 +00:00
parent ab37facd54
commit 6dbadf877d
4 changed files with 17 additions and 8 deletions

View File

@ -115,6 +115,11 @@ def altrow(reset = False):
irow = irow % 2
return "altrow%s" % irow
def deluge_int(val):
if val == -1 :
return _("Unlimited")
return val
template.Template.globals.update({
'sort_head': template_sort_head,
'part_stats':template_part_stats,
@ -123,6 +128,7 @@ template.Template.globals.update({
'_': _ , #gettext/translations
'str': str, #because % in templetor is broken.
'int':int,
'deluge_int':deluge_int,
'sorted': sorted,
'altrow':altrow,
'get_config': get_config,

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

View File

@ -19,16 +19,17 @@ $:render.part_button('POST', '/logout', _('Logout'), 'tango/system-log-out.png')
<div class="panel" id='stats_panel'>
<!--<a href='/config'>-->
$if env == '0.6':
$:render.part_button('GET', '/config/', _('Settings'), 'tango/preferences-system.png')
$_('Connections') : $stats.num_connections ($stats.max_num_connections)
$_('Down Speed') : $stats.download_rate ($stats.max_download)
$_('Up Speed') : $stats.upload_rate ($stats.max_upload)
<img src="/static/images/tango/connections.png" title="$_('Connections')"> $stats.num_connections ($deluge_int(stats.max_num_connections))
<img src="/static/images/downloading16.png" title="$_('Down Speed')"> $stats.download_rate ($deluge_int(stats.max_download))
<img src="/static/images/seeding16.png" title="$_('Up Speed')"> $stats.upload_rate ($deluge_int(stats.max_upload))
DHT: $stats.dht_nodes
$:render.part_button('GET', '/config/', _('Settings'), 'tango/preferences-system.png')
<!--</a>-->

View File

@ -122,6 +122,8 @@ def get_stats():
ws.async_proxy.get_num_connections(dict_cb("num_connections",stats))
ws.async_proxy.get_config_value(dict_cb('max_num_connections',stats)
,"max_connections_global")
ws.async_proxy.get_dht_nodes(dict_cb('dht_nodes',stats))
ws.async_proxy.force_call(block=True)