Module: deluge Branch: master Commit: b6596a27bca76bcbb2bcc305e5d27bf8d1557093
Author: Calum Lind <[email protected]> Date: Thu Jun 30 01:02:17 2011 +0100 Add 'Last Seen Complete' to GTK and WebUI Status Tabs --- deluge/ui/gtkui/glade/main_window.glade | 37 +++++++++++++++++++++- deluge/ui/gtkui/status_tab.py | 12 ++++++- deluge/ui/web/css/deluge.css | 3 ++ deluge/ui/web/js/deluge-all/Keys.js | 2 +- deluge/ui/web/js/deluge-all/TorrentGrid.js | 6 +++- deluge/ui/web/js/deluge-all/details/StatusTab.js | 8 +++-- deluge/ui/web/render/tab_status.html | 1 + 7 files changed, 61 insertions(+), 8 deletions(-) diff --git a/deluge/ui/gtkui/glade/main_window.glade b/deluge/ui/gtkui/glade/main_window.glade index 000a6ba..79ac644 100644 --- a/deluge/ui/gtkui/glade/main_window.glade +++ b/deluge/ui/gtkui/glade/main_window.glade @@ -1539,7 +1539,7 @@ This will filter torrents for the current selection on the sidebar.</property> </widget> <packing> <property name="left_attach">1</property> - <property name="right_attach">8</property> + <property name="right_attach">4</property> <property name="top_attach">4</property> <property name="bottom_attach">5</property> <property name="y_options">GTK_FILL</property> @@ -1562,6 +1562,41 @@ This will filter torrents for the current selection on the sidebar.</property> </packing> </child> <child> + <widget class="GtkLabel" id="summary_last_seen_complete"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="wrap">True</property> + <property name="wrap_mode">char</property> + <property name="selectable">True</property> + </widget> + <packing> + <property name="left_attach">5</property> + <property name="right_attach">8</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label_last_seen_complete"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Last Seen Complete:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">4</property> + <property name="right_attach">5</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> <widget class="GtkLabel" id="summary_availability"> <property name="visible">True</property> <property name="can_focus">False</property> diff --git a/deluge/ui/gtkui/status_tab.py b/deluge/ui/gtkui/status_tab.py index 01c0627..7d78242 100644 --- a/deluge/ui/gtkui/status_tab.py +++ b/deluge/ui/gtkui/status_tab.py @@ -68,6 +68,13 @@ def fspeed(value, max_value=-1): else: return deluge.common.fspeed(value) +def fdate_or_never(value): + """Display value as date, eg 05/05/08 or Never""" + if value > 0.0: + return deluge.common.fdate(value) + else: + return "Never" + class StatusTab(Tab): def __init__(self): Tab.__init__(self) @@ -103,7 +110,8 @@ class StatusTab(Tab): (glade.get_widget("summary_seed_rank"), str, ("seed_rank",)), (glade.get_widget("summary_auto_managed"), str, ("is_auto_managed",)), (glade.get_widget("progressbar"), fpcnt, ("progress",)), - (glade.get_widget("summary_date_added"), deluge.common.fdate, ("time_added",)) + (glade.get_widget("summary_date_added"), deluge.common.fdate, ("time_added",)), + (glade.get_widget("summary_last_seen_complete"), fdate_or_never, ("last_seen_complete",)), ] def update(self): @@ -125,7 +133,7 @@ class StatusTab(Tab): "total_seeds", "eta", "ratio", "next_announce", "tracker_status", "max_connections", "max_upload_slots", "max_upload_speed", "max_download_speed", "active_time", - "seeding_time", "seed_rank", "is_auto_managed", "time_added"] + "seeding_time", "seed_rank", "is_auto_managed", "time_added", "last_seen_complete"] if self.config['show_piecesbar']: status_keys.extend(["pieces", "state"]) diff --git a/deluge/ui/web/css/deluge.css b/deluge/ui/web/css/deluge.css index c1da56f..303a0d1 100644 --- a/deluge/ui/web/css/deluge.css +++ b/deluge/ui/web/css/deluge.css @@ -112,6 +112,9 @@ dl.singleline dd { .x-deluge-status dd.time_added { width: 100px; } +.x-deluge-status dd.last_seen_complete { + width: 100px; +} /* Torrent Details - Details Tab */ #torrentDetails dd.torrent_name, diff --git a/deluge/ui/web/js/deluge-all/Keys.js b/deluge/ui/web/js/deluge-all/Keys.js index f41f53a..64fe0f8 100644 --- a/deluge/ui/web/js/deluge-all/Keys.js +++ b/deluge/ui/web/js/deluge-all/Keys.js @@ -48,7 +48,7 @@ Deluge.Keys = { 'queue', 'name', 'total_size', 'state', 'progress', 'num_seeds', 'total_seeds', 'num_peers', 'total_peers', 'download_payload_rate', 'upload_payload_rate', 'eta', 'ratio', 'distributed_copies', - 'is_auto_managed', 'time_added', 'tracker_host', 'save_path' + 'is_auto_managed', 'time_added', 'tracker_host', 'save_path', 'last_seen_complete' ], /** diff --git a/deluge/ui/web/js/deluge-all/TorrentGrid.js b/deluge/ui/web/js/deluge-all/TorrentGrid.js index 022aac7..de3672e 100644 --- a/deluge/ui/web/js/deluge-all/TorrentGrid.js +++ b/deluge/ui/web/js/deluge-all/TorrentGrid.js @@ -75,6 +75,10 @@ return eta * -1; } + function dateOrNever(date) { + return date > 0.0 ? fdate(date) : "Never" + } + /** * Deluge.TorrentGrid Class * @@ -169,7 +173,7 @@ header: _('Last Seen Complete'), width: 80, sortable: true, - renderer: fdate, + renderer: dateOrNever, dataIndex: 'last_seen_complete' }, { header: _('Tracker'), diff --git a/deluge/ui/web/js/deluge-all/details/StatusTab.js b/deluge/ui/web/js/deluge-all/details/StatusTab.js index e3671bd..378b9da 100644 --- a/deluge/ui/web/js/deluge-all/details/StatusTab.js +++ b/deluge/ui/web/js/deluge-all/details/StatusTab.js @@ -91,8 +91,9 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, { }, onRequestComplete: function(status) { - seeders = status.total_seeds > -1 ? status.num_seeds + ' (' + status.total_seeds + ')' : status.num_seeds - peers = status.total_peers > -1 ? status.num_peers + ' (' + status.total_peers + ')' : status.num_peers + seeders = status.total_seeds > -1 ? status.num_seeds + ' (' + status.total_seeds + ')' : status.num_seeds; + peers = status.total_peers > -1 ? status.num_peers + ' (' + status.total_peers + ')' : status.num_peers; + last_seen_complete = status.last_seen_complete > 0.0 ? fdate(status.last_seen_complete) : "Never"; var data = { downloaded: fsize(status.total_done, true), uploaded: fsize(status.total_uploaded, true), @@ -109,7 +110,8 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, { active_time: ftime(status.active_time), seeding_time: ftime(status.seeding_time), seed_rank: status.seed_rank, - time_added: fdate(status.time_added) + time_added: fdate(status.time_added), + last_seen_complete: last_seen_complete } data.auto_managed = _((status.is_auto_managed) ? 'True' : 'False'); diff --git a/deluge/ui/web/render/tab_status.html b/deluge/ui/web/render/tab_status.html index 7c003ca..1b5fb37 100644 --- a/deluge/ui/web/render/tab_status.html +++ b/deluge/ui/web/render/tab_status.html @@ -16,6 +16,7 @@ <dt class="peers">${_("Peers")}:</dt><dd class="peers"/> <dt class="avail">${_("Availability")}:</dt><dd class="avail"/> <dt class="auto_managed">${_("Auto Managed")}:</dt><dd class="auto_managed"/> + <dt class="last_seen_complete">${_("Last Seen Complete")}: </dt><dd class="last_seen_complete"/> </dl> <dl> <dt class="active_time">${_("Active Time")}:</dt><dd class="active_time"/> -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
