diff options
author | Marcos Pinto <markybob@dipconsultants.com> | 2007-11-19 15:17:24 +0000 |
---|---|---|
committer | Marcos Pinto <markybob@dipconsultants.com> | 2007-11-19 15:17:24 +0000 |
commit | 8b4053dd2e8415699915501b8ca95fcedd050f15 (patch) | |
tree | 2cea1b9e29a3ac92c8f4451874b8965430e4c853 | |
parent | 9afc4ce936738887be890ee238f00993618f72d6 (diff) | |
download | deluge-8b4053dd2e8415699915501b8ca95fcedd050f15.tar.gz deluge-8b4053dd2e8415699915501b8ca95fcedd050f15.tar.bz2 deluge-8b4053dd2e8415699915501b8ca95fcedd050f15.zip |
fix wizard apply_prefs mess
-rw-r--r-- | src/interface.py | 4 | ||||
-rw-r--r-- | src/wizard.py | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/interface.py b/src/interface.py index 5e6c85a7b..73505b39f 100644 --- a/src/interface.py +++ b/src/interface.py @@ -835,6 +835,10 @@ window, please enter your password")) def run_wizard(self, arg=None): import wizard wizard.WizardGTK() + #reload config file + import pref + self.config = pref.Preferences(os.path.join(common.CONFIG_DIR, "prefs.state")) + self.apply_prefs() def show_preferences_dialog(self): active_port = self.manager.get_state()['port'] diff --git a/src/wizard.py b/src/wizard.py index 07d6006c6..ac511132b 100644 --- a/src/wizard.py +++ b/src/wizard.py @@ -279,12 +279,13 @@ class WizardGTK: """ import os import deluge.common - try: - firstrun = open(os.path.join(deluge.common.CONFIG_DIR, 'firstrun'), 'w') - firstrun.write("") - firstrun.close() - except: - pass + if not os.path.exists(os.path.join(deluge.common.CONFIG_DIR, 'firstrun')): + try: + firstrun = open(os.path.join(deluge.common.CONFIG_DIR, 'firstrun'), 'w') + firstrun.write("") + firstrun.close() + except: + pass def cancel(self, *args): """ @@ -300,10 +301,11 @@ class WizardGTK: saves configuration settings """ import gtk - import deluge_core self.create_file() self.config.set("random_port", self.wtree.get_widget('chk_random_ports'\ ).get_active()) + self.config.set("send_info", self.wtree.get_widget("chk_send_info").\ + get_active()) self.config.set("listen_on", [self.wtree.get_widget("spin_port_min")\ .get_value(), self.wtree.get_widget("spin_port_max").get_value()]) self.config.set("send_info", self.wtree.get_widget("chk_send_info").\ @@ -323,11 +325,5 @@ class WizardGTK: self.config.set("default_download_path", self.wtree.get_widget(\ 'download_path_button').get_filename()) self.config.save() - import deluge.core - import deluge.common - self.manager = deluge.core.Manager(deluge.common.CLIENT_CODE, deluge.common.CLIENT_VERSION, - '%s %s' % (deluge.common.PROGRAM_NAME, deluge.common.PROGRAM_VERSION), - deluge.common.CONFIG_DIR) - self.manager.apply_prefs() gtk.main_quit() |