mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 07:58:38 +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
|
# Now show the dialog
|
||||||
self.pref_dialog.show()
|
self.pref_dialog.show()
|
||||||
|
|
||||||
def set_config(self):
|
def set_config(self, hide=False):
|
||||||
"""Sets all altered config values in the core"""
|
"""
|
||||||
|
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:
|
try:
|
||||||
from hashlib import sha1 as sha_hash
|
from hashlib import sha1 as sha_hash
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -719,8 +723,11 @@ class Preferences(component.Component):
|
||||||
# Update the configuration
|
# Update the configuration
|
||||||
self.core_config.update(config_to_set)
|
self.core_config.update(config_to_set)
|
||||||
|
|
||||||
# Re-show the dialog to make sure everything has been updated
|
if hide:
|
||||||
self.show()
|
self.hide()
|
||||||
|
else:
|
||||||
|
# Re-show the dialog to make sure everything has been updated
|
||||||
|
self.show()
|
||||||
|
|
||||||
def hide(self):
|
def hide(self):
|
||||||
self.pref_dialog.hide()
|
self.pref_dialog.hide()
|
||||||
|
@ -772,8 +779,7 @@ class Preferences(component.Component):
|
||||||
|
|
||||||
def on_button_ok_clicked(self, data):
|
def on_button_ok_clicked(self, data):
|
||||||
log.debug("on_button_ok_clicked")
|
log.debug("on_button_ok_clicked")
|
||||||
self.set_config()
|
self.set_config(hide=True)
|
||||||
self.hide()
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def on_button_apply_clicked(self, data):
|
def on_button_apply_clicked(self, data):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue