diff --git a/src/dialogs.py b/src/dialogs.py index 12e108f94..29b9c438d 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -131,6 +131,8 @@ class PreferencesDlg: self.preferences.set("enable_dht", self.glade.get_widget("chk_dht").get_active()) self.preferences.set("gui_update_interval", self.glade.get_widget("spin_gui").get_value()) + return r + def TestPort(self, widget): activep = str(self.parent.manager.get_state()['port']) common.open_url_in_browser(self.dialog,'http://www.deluge-torrent.org/test-port.php?port=%s' %activep) diff --git a/src/interface.py b/src/interface.py index 58ac6016d..2aff62503 100644 --- a/src/interface.py +++ b/src/interface.py @@ -674,17 +674,19 @@ class DelugeGTK: def show_pref_dialog(self, arg=None): if self.window.get_property("visible"): - self.preferences_dialog.show() - self.apply_prefs() - self.config.save() + # Only apply the prefs if the user pressed OK in the prefs dialog + if self.preferences_dialog.show() == 1: + self.apply_prefs() + self.config.save() else: if self.config.get("lock_tray") == True: self.unlock_tray("prefwinshow") else: - self.preferences_dialog.show() - self.apply_prefs() - self.config.save() + # Only apply the prefs if the user pressed OK in the prefs dialog + if self.preferences_dialog.show() == 1: + self.apply_prefs() + self.config.save() def show_plugin_dialog(self, arg=None): self.plugin_dialog.show()