mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 00:18:39 +00:00
fix wizard apply_prefs mess
This commit is contained in:
parent
9afc4ce936
commit
8b4053dd2e
2 changed files with 13 additions and 13 deletions
|
@ -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,12 +279,13 @@ class WizardGTK:
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import deluge.common
|
import deluge.common
|
||||||
try:
|
if not os.path.exists(os.path.join(deluge.common.CONFIG_DIR, 'firstrun')):
|
||||||
firstrun = open(os.path.join(deluge.common.CONFIG_DIR, 'firstrun'), 'w')
|
try:
|
||||||
firstrun.write("")
|
firstrun = open(os.path.join(deluge.common.CONFIG_DIR, 'firstrun'), 'w')
|
||||||
firstrun.close()
|
firstrun.write("")
|
||||||
except:
|
firstrun.close()
|
||||||
pass
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def cancel(self, *args):
|
def cancel(self, *args):
|
||||||
"""
|
"""
|
||||||
|
@ -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…
Add table
Add a link
Reference in a new issue