mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-14 04:16:31 +00:00
fix wizard apply_prefs mess
This commit is contained in:
parent
9afc4ce936
commit
8b4053dd2e
@ -835,6 +835,10 @@ window, please enter your password"))
|
|||||||
def run_wizard(self, arg=None):
|
def run_wizard(self, arg=None):
|
||||||
import wizard
|
import wizard
|
||||||
wizard.WizardGTK()
|
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):
|
def show_preferences_dialog(self):
|
||||||
active_port = self.manager.get_state()['port']
|
active_port = self.manager.get_state()['port']
|
||||||
|
@ -279,6 +279,7 @@ class WizardGTK:
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import deluge.common
|
import deluge.common
|
||||||
|
if not os.path.exists(os.path.join(deluge.common.CONFIG_DIR, 'firstrun')):
|
||||||
try:
|
try:
|
||||||
firstrun = open(os.path.join(deluge.common.CONFIG_DIR, 'firstrun'), 'w')
|
firstrun = open(os.path.join(deluge.common.CONFIG_DIR, 'firstrun'), 'w')
|
||||||
firstrun.write("")
|
firstrun.write("")
|
||||||
@ -300,10 +301,11 @@ class WizardGTK:
|
|||||||
saves configuration settings
|
saves configuration settings
|
||||||
"""
|
"""
|
||||||
import gtk
|
import gtk
|
||||||
import deluge_core
|
|
||||||
self.create_file()
|
self.create_file()
|
||||||
self.config.set("random_port", self.wtree.get_widget('chk_random_ports'\
|
self.config.set("random_port", self.wtree.get_widget('chk_random_ports'\
|
||||||
).get_active())
|
).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")\
|
self.config.set("listen_on", [self.wtree.get_widget("spin_port_min")\
|
||||||
.get_value(), self.wtree.get_widget("spin_port_max").get_value()])
|
.get_value(), self.wtree.get_widget("spin_port_max").get_value()])
|
||||||
self.config.set("send_info", self.wtree.get_widget("chk_send_info").\
|
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(\
|
self.config.set("default_download_path", self.wtree.get_widget(\
|
||||||
'download_path_button').get_filename())
|
'download_path_button').get_filename())
|
||||||
self.config.save()
|
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()
|
gtk.main_quit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user