Fix #560 force an int value for global max connections

This commit is contained in:
Andrew Resch 2008-10-23 16:19:28 +00:00
commit e4c72c7dce
3 changed files with 181 additions and 173 deletions

View file

@ -1,3 +1,7 @@
Deluge 1.0.4 (In Development)
Core:
* Fix #560 force an int value for global max connections
Deluge 1.0.3 (18 October 2008)
Core:
* Fix upnp - it should work on more routers now too

View file

@ -818,7 +818,11 @@ class Core(
def _on_set_max_connections_global(self, key, value):
log.debug("max_connections_global set to %s..", value)
self.session.set_max_connections(value)
# Add this in to overwrite bad float values in the config, to prevent
# future issues with 1.1
if type(value) is not int:
self.config[key] = int(value)
self.session.set_max_connections(int(value))
def _on_set_max_upload_speed(self, key, value):
log.debug("max_upload_speed set to %s..", value)

View file

@ -414,8 +414,8 @@ class StatusBar(component.Component):
if widget.get_name() == _("Unlimited"):
value = -1
elif widget.get_name() == _("Other..."):
value = deluge.common.show_other_dialog(
_("Connection Limit:"), self.max_connections)
value = int(deluge.common.show_other_dialog(
_("Connection Limit:"), self.max_connections))
if value == None:
return
else: