mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 20:14:51 +00:00
Fix preferences window from not closing properly on OK
This commit is contained in:
parent
addaefaf7b
commit
faef89870b
1 changed files with 12 additions and 6 deletions
|
@ -479,8 +479,12 @@ class Preferences(component.Component):
|
|||
# Now show the dialog
|
||||
self.pref_dialog.show()
|
||||
|
||||
def set_config(self):
|
||||
"""Sets all altered config values in the core"""
|
||||
def set_config(self, hide=False):
|
||||
"""
|
||||
Sets all altered config values in the core.
|
||||
|
||||
:param hide: bool, if True, will not re-show the dialog and will hide it instead
|
||||
"""
|
||||
try:
|
||||
from hashlib import sha1 as sha_hash
|
||||
except ImportError:
|
||||
|
@ -719,8 +723,11 @@ class Preferences(component.Component):
|
|||
# Update the configuration
|
||||
self.core_config.update(config_to_set)
|
||||
|
||||
# Re-show the dialog to make sure everything has been updated
|
||||
self.show()
|
||||
if hide:
|
||||
self.hide()
|
||||
else:
|
||||
# Re-show the dialog to make sure everything has been updated
|
||||
self.show()
|
||||
|
||||
def hide(self):
|
||||
self.pref_dialog.hide()
|
||||
|
@ -772,8 +779,7 @@ class Preferences(component.Component):
|
|||
|
||||
def on_button_ok_clicked(self, data):
|
||||
log.debug("on_button_ok_clicked")
|
||||
self.set_config()
|
||||
self.hide()
|
||||
self.set_config(hide=True)
|
||||
return True
|
||||
|
||||
def on_button_apply_clicked(self, data):
|
||||
|
|
Loading…
Add table
Reference in a new issue