From c0d8bf2d7f575204836a6a2e308393161100f350 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 --- src/dialogs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index bcb9b0c92..29db197d2 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -101,7 +101,7 @@ class PreferencesDlg: self.glade.get_widget("chk_min_on_close").set_active(self.preferences.get("close_to_tray")) self.glade.get_widget("chk_start_in_tray").set_active(self.preferences.get("start_in_tray")) self.glade.get_widget("chk_lock_tray").set_active(self.preferences.get("lock_tray")) - self.glade.get_widget("txt_tray_passwd").set_text("") + self.glade.get_widget("txt_tray_passwd").set_text(self.preferences.get("tray_passwd")) self.glade.get_widget("txt_peer_proxy_hostname").set_text(self.preferences.get("peer_proxy_hostname")) self.glade.get_widget("txt_peer_proxy_username").set_text(self.preferences.get("peer_proxy_username")) self.glade.get_widget("txt_peer_proxy_password").set_text(self.preferences.get("peer_proxy_password")) @@ -213,7 +213,10 @@ class PreferencesDlg: self.preferences.set("close_to_tray", self.glade.get_widget("chk_min_on_close").get_active()) self.preferences.set("start_in_tray", self.glade.get_widget("chk_start_in_tray").get_active()) self.preferences.set("lock_tray", self.glade.get_widget("chk_lock_tray").get_active()) - password = sha.new(self.glade.get_widget("txt_tray_passwd").get_text()).hexdigest() + if len(self.glade.get_widget("txt_tray_passwd").get_text()) != 40: + password = sha.new(self.glade.get_widget("txt_tray_passwd").get_text()).hexdigest() + else: + password = self.glade.get_widget("txt_tray_passwd").get_text() self.preferences.set("tray_passwd", password) self.preferences.set("tracker_proxy_username", self.glade.get_widget("txt_tracker_proxy_username").get_text()) self.preferences.set("tracker_proxy_password", self.glade.get_widget("txt_tracker_proxy_password").get_text())