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,7 +674,8 @@ 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
|
||||||
|
if self.preferences_dialog.show() == 1:
|
||||||
self.apply_prefs()
|
self.apply_prefs()
|
||||||
self.config.save()
|
self.config.save()
|
||||||
|
|
||||||
|
@ -682,7 +683,8 @@ class DelugeGTK:
|
||||||
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
|
||||||
|
if self.preferences_dialog.show() == 1:
|
||||||
self.apply_prefs()
|
self.apply_prefs()
|
||||||
self.config.save()
|
self.config.save()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue