Fix deprecation warning

This commit is contained in:
Andrew Resch 2007-06-21 22:19:18 +00:00
parent 80335eb0ae
commit 7024caa6f3
3 changed files with 13 additions and 10 deletions

View File

@ -119,7 +119,7 @@ class PreferencesDlg:
self.preferences.set("max_number_uploads", self.glade.get_widget("spin_num_upload").get_value())
self.preferences.set("max_download_rate", self.glade.get_widget("spin_max_download").get_value())
self.preferences.set("proxy_port", self.glade.get_widget("spin_proxy_port").get_value())
self.preferences.set("max_connections", self.glade.get_widget("spin_max_connections").get_value())
self.preferences.set("max_connections", int(self.glade.get_widget("spin_max_connections").get_value()))
self.preferences.set("max_active_torrents", int(self.glade.get_widget("spin_torrents").get_value()))
self.preferences.set("queue_seeds_to_bottom", self.glade.get_widget("chk_seedbottom").get_active())
self.preferences.set("enable_dht", self.glade.get_widget("chk_dht").get_active())

View File

@ -692,14 +692,17 @@ class DelugeGTK:
def apply_prefs(self):
# Show tray icon if necessary
self.tray_icon.set_visible(self.config.get("enable_system_tray"))
# Update the max_*_rate_bps prefs
ulrate = self.config.get("max_upload_rate") * 1024
dlrate = self.config.get("max_download_rate") * 1024
if not (ulrate < 0):
self.config.set("max_upload_rate_bps", ulrate)
if not (dlrate < 0):
self.config.set("max_download_rate_bps", dlrate)
if self.config.get("max_upload_rate") < 0:
self.config.set("max_upload_rate_bps", -1)
else:
self.config.set("max_upload_rate_bps", int(self.config.get("max_upload_rate") * 1024))
if self.config.get("max_download_rate") < 0:
self.config.set("max_download_rate_bps", -1)
else:
self.config.set("max_download_rate_bps", int(self.config.get("max_download_rate") * 1024))
# Update the tray download speed limits
if self.config.get("max_download_rate") not in self.config.get("tray_downloadspeedlist") and self.config.get("max_download_rate") >= 0:

View File

@ -53,12 +53,12 @@ DEFAULT_PREFS = {
"lock_tray" : False,
"max_active_torrents" : -1,
"max_connections" : 600,
"max_download_rate" : -1.0,
"max_download_rate" : -1,
"max_download_rate_bps": -1.0,
"max_number_downloads" : -1.0,
"max_number_uploads" : -1.0,
"max_upload_rate" : -1.0,
"max_upload_rate_bps" : -1.0,
"max_upload_rate_bps" : -1,
"max_uploads" : 2,
"pref_rc4" : True,
"proxy_type" : common.ProxyType.none,