From 4a858a70bcb90629c7c8435434649a10c9100d06 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sun, 30 Sep 2007 09:12:38 +0000 Subject: [PATCH] fix tray password resetting itself sometimes --- deluge/ui/gtkui/preferences.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 824709bbd..7e071fc1b 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -162,6 +162,8 @@ class Preferences: self.gtkui_config["start_in_tray"]) self.glade.get_widget("chk_lock_tray").set_active( self.gtkui_config["lock_tray"]) + self.glade.get_widget("txt_tray_password").set_text( + self.gtkui_config["tray_password"]) self.glade.get_widget("combo_file_manager").set_active( self.gtkui_config["stock_file_manager"]) self.glade.get_widget("txt_open_folder_location").set_text( @@ -249,8 +251,11 @@ class Preferences: self.glade.get_widget("chk_start_in_tray").get_active() new_gtkui_config["lock_tray"] = \ self.glade.get_widget("chk_lock_tray").get_active() - password = sha.new(self.glade.get_widget("txt_tray_password").\ - get_text()).hexdigest() + if len(self.glade.get_widget("txt_tray_password").get_text()) == 40: + password = self.glade.get_widget("txt_tray_password").get_text() + else: + password = sha.new(self.glade.get_widget("txt_tray_password").\ + get_text()).hexdigest() new_gtkui_config["tray_password"] = password new_gtkui_config["stock_file_manager"] = \ self.glade.get_widget("combo_file_manager").get_active()