From 0c203b0a963f6189be3b5bfdfa6a86ff6309d46d Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 31 Aug 2008 20:20:16 +0000 Subject: [PATCH] Fix various issues when not using English --- deluge/common.py | 2 + deluge/ui/gtkui/glade/main_window.glade | 2 +- deluge/ui/gtkui/glade/torrent_menu.glade | 4 +- deluge/ui/gtkui/statusbar.py | 52 ++++++++++++------------ 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/deluge/common.py b/deluge/common.py index 282fc2f17..15dff0288 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -216,6 +216,7 @@ def build_menu_radio_list(value_list, callback, pref_value=None, if show_notset: menuitem = gtk.RadioMenuItem(group, notset_label) + menuitem.set_name(notset_label) if pref_value < notset_lessthan and pref_value != None: menuitem.set_active(True) if show_activated and pref_value == 1: @@ -228,6 +229,7 @@ def build_menu_radio_list(value_list, callback, pref_value=None, menuitem = gtk.SeparatorMenuItem() menu.append(menuitem) menuitem = gtk.MenuItem(_("Other...")) + menuitem.set_name(_("Other...")) menuitem.connect("activate", callback) menu.append(menuitem) diff --git a/deluge/ui/gtkui/glade/main_window.glade b/deluge/ui/gtkui/glade/main_window.glade index 6c9c09d24..31a6f5f8a 100644 --- a/deluge/ui/gtkui/glade/main_window.glade +++ b/deluge/ui/gtkui/glade/main_window.glade @@ -512,7 +512,7 @@ True - gtk-open + gtk-open True True diff --git a/deluge/ui/gtkui/glade/torrent_menu.glade b/deluge/ui/gtkui/glade/torrent_menu.glade index 60fa3fb99..f7dae7cf3 100644 --- a/deluge/ui/gtkui/glade/torrent_menu.glade +++ b/deluge/ui/gtkui/glade/torrent_menu.glade @@ -321,7 +321,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-goto-top + gtk-goto-top True True @@ -351,7 +351,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-goto-bottom + gtk-goto-bottom True True diff --git a/deluge/ui/gtkui/statusbar.py b/deluge/ui/gtkui/statusbar.py index c1b5e08a9..41fab4692 100644 --- a/deluge/ui/gtkui/statusbar.py +++ b/deluge/ui/gtkui/statusbar.py @@ -355,20 +355,20 @@ class StatusBar(component.Component): def _on_set_download_speed(self, widget): log.debug("_on_set_download_speed") - value = widget.get_children()[0].get_text().split(" ")[0] - log.debug("value: %s", value) - if value == "Unlimited": - value = -1 - if value == _("Other..."): + if widget.get_name() == _("Unlimited"): + value = -1 + elif widget.get_name() == _("Other..."): value = deluge.common.show_other_dialog( _("Download Speed (KiB/s):"), self.max_download_speed) if value == None: return - - # Set the config in the core - value = float(value) - + else: + value = float(widget.get_children()[0].get_text().split(" ")[0]) + + log.debug("value: %s", value) + + # Set the config in the core if value != self.max_download_speed: client.set_config({"max_download_speed": value}) @@ -383,21 +383,20 @@ class StatusBar(component.Component): def _on_set_upload_speed(self, widget): log.debug("_on_set_upload_speed") - value = widget.get_children()[0].get_text().split(" ")[0] - log.debug("value: %s", value) - - if value == "Unlimited": - value = -1 - if value == _("Other..."): + if widget.get_name() == _("Unlimited"): + value = -1 + elif widget.get_name() == _("Other..."): value = deluge.common.show_other_dialog( _("Upload Speed (KiB/s):"), self.max_upload_speed) if value == None: return - + else: + value = float(widget.get_children()[0].get_text().split(" ")[0]) + + log.debug("value: %s", value) + # Set the config in the core - value = float(value) - if value != self.max_upload_speed: client.set_config({"max_upload_speed": value}) @@ -411,21 +410,20 @@ class StatusBar(component.Component): def _on_set_connection_limit(self, widget): log.debug("_on_set_connection_limit") - value = widget.get_children()[0].get_text().split(" ")[0] - log.debug("value: %s", value) - if value == "Unlimited": + if widget.get_name() == _("Unlimited"): value = -1 - - if value == _("Other..."): + elif widget.get_name() == _("Other..."): value = deluge.common.show_other_dialog( _("Connection Limit:"), self.max_connections) if value == None: return - - # Set the config in the core - value = int(value) - + else: + value = int(widget.get_children()[0].get_text().split(" ")[0]) + + log.debug("value: %s", value) + + # Set the config in the core if value != self.max_connections: client.set_config({"max_connections_global": value})