Only call apply_prefs() if OK is pressed in the Preferences dialog.
This commit is contained in:
parent
ee9e5a09ea
commit
94dc14b355
|
@ -131,6 +131,8 @@ class PreferencesDlg:
|
||||||
self.preferences.set("enable_dht", self.glade.get_widget("chk_dht").get_active())
|
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())
|
self.preferences.set("gui_update_interval", self.glade.get_widget("spin_gui").get_value())
|
||||||
|
|
||||||
|
return r
|
||||||
|
|
||||||
def TestPort(self, widget):
|
def TestPort(self, widget):
|
||||||
activep = str(self.parent.manager.get_state()['port'])
|
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)
|
common.open_url_in_browser(self.dialog,'http://www.deluge-torrent.org/test-port.php?port=%s' %activep)
|
||||||
|
|
|
@ -674,17 +674,19 @@ class DelugeGTK:
|
||||||
|
|
||||||
def show_pref_dialog(self, arg=None):
|
def show_pref_dialog(self, arg=None):
|
||||||
if self.window.get_property("visible"):
|
if self.window.get_property("visible"):
|
||||||
self.preferences_dialog.show()
|
# Only apply the prefs if the user pressed OK in the prefs dialog
|
||||||
self.apply_prefs()
|
if self.preferences_dialog.show() == 1:
|
||||||
self.config.save()
|
self.apply_prefs()
|
||||||
|
self.config.save()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if self.config.get("lock_tray") == True:
|
if self.config.get("lock_tray") == True:
|
||||||
self.unlock_tray("prefwinshow")
|
self.unlock_tray("prefwinshow")
|
||||||
else:
|
else:
|
||||||
self.preferences_dialog.show()
|
# Only apply the prefs if the user pressed OK in the prefs dialog
|
||||||
self.apply_prefs()
|
if self.preferences_dialog.show() == 1:
|
||||||
self.config.save()
|
self.apply_prefs()
|
||||||
|
self.config.save()
|
||||||
|
|
||||||
def show_plugin_dialog(self, arg=None):
|
def show_plugin_dialog(self, arg=None):
|
||||||
self.plugin_dialog.show()
|
self.plugin_dialog.show()
|
||||||
|
|
Loading…
Reference in New Issue