From 513c7830455a7e7a852b7b1f7e2947148fa9cdbd Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Tue, 9 Dec 2008 05:00:48 +0000 Subject: [PATCH] transfer rates in title --- deluge/ui/gtkui/mainwindow.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py index 9f20d76e0..935024af7 100644 --- a/deluge/ui/gtkui/mainwindow.py +++ b/deluge/ui/gtkui/mainwindow.py @@ -195,3 +195,14 @@ class MainWindow(component.Component): def on_expose_event(self, widget, event): component.get("SystemTray").blink(False) + + def update(self): + self.send_status_request() + + def send_status_request(self): + client.get_session_status(self._on_get_session_status, ["download_rate", "upload_rate"]) + + def _on_get_session_status(self, status): + self.download_rate = deluge.common.fsize(status["download_rate"]) + self.upload_rate = deluge.common.fsize(status["upload_rate"]) + self.window.set_title("Deluge - %s %s/s|%s %s/s" % (_("Down:"), self.download_rate, _("Up:"), self.upload_rate))