From 7b75c2796a5f47dcf1a457fe979c13be5f3976bf Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Wed, 21 Feb 2007 21:05:23 +0000 Subject: [PATCH] fix for bandwidth settings? --- deluge.desktop | 2 ++ src/delugegtk.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deluge.desktop b/deluge.desktop index bcc102969..c8eb281e1 100644 --- a/deluge.desktop +++ b/deluge.desktop @@ -1,4 +1,5 @@ [Desktop Entry] +Version=1.0 Encoding=UTF-8 Name=Deluge BitTorrent Client Comment=Bittorrent client written in Python/PyGTK @@ -8,3 +9,4 @@ Terminal=false Type=Application Categories=Application;Network StartupNotify=true +GenericName[en_US]= diff --git a/src/delugegtk.py b/src/delugegtk.py index 2612e100b..53f6e7afe 100644 --- a/src/delugegtk.py +++ b/src/delugegtk.py @@ -471,11 +471,17 @@ class DelugeGTK: def apply_prefs(self): + ulrate = self.config.get("max_upload_rate", int, default=-1) + dlrate = self.config.get("max_download_rate", int, default=-1) + if not (ulrate == -1): + ulrate *= 1024 + if not (dlrate == -1): + ulrate *= 1024 self.tray.set_visible(self.config.get("enable_system_tray", bool)) self.manager.set_pref("listen_on", [self.config.get("tcp_port_range_lower", int), self.config.get("tcp_port_range_upper", int)]) + self.manager.set_pref("max_upload_rate", ulrate) + self.manager.set_pref("max_download_rate", dlrate) self.manager.set_pref("max_uploads", self.config.get("max_number_uploads", int)) - self.manager.set_pref("max_upload_rate", 1024 * self.config.get("max_upload_rate", int)) - self.manager.set_pref("max_download_rate", 1024 * self.config.get("max_download_rate", int)) self.manager.set_pref("max_connections", self.config.get("max_number_downloads", int))