#148: Add setting to UI.

This commit is contained in:
Bill Dengler 2017-07-11 04:02:04 +00:00
parent d4646ced9f
commit 68bfc3aac7
3 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,7 @@ log_level = string(default="error")
load_keymap = string(default="default.keymap") load_keymap = string(default="default.keymap")
donation_dialog_displayed = boolean(default=False) donation_dialog_displayed = boolean(default=False)
check_for_updates = boolean(default=True) check_for_updates = boolean(default=True)
paranoid = boolean(default=False)
[proxy] [proxy]
type = string(default="Direct connection") type = string(default="Direct connection")

View File

@ -72,6 +72,7 @@ class globalSettingsController(object):
self.dialog.set_value("general", "disable_sapi5", config.app["app-settings"]["voice_enabled"]) self.dialog.set_value("general", "disable_sapi5", config.app["app-settings"]["voice_enabled"])
self.dialog.set_value("general", "hide_gui", config.app["app-settings"]["hide_gui"]) self.dialog.set_value("general", "hide_gui", config.app["app-settings"]["hide_gui"])
self.dialog.set_value("general", "check_for_updates", config.app["app-settings"]["check_for_updates"]) self.dialog.set_value("general", "check_for_updates", config.app["app-settings"]["check_for_updates"])
self.dialog.set_value("general", "paranoid", config.app["app-settings"]["paranoid"])
proxyTypes=config.proxyTypes proxyTypes=config.proxyTypes
self.dialog.create_proxy([_("Direct connection")]+proxyTypes) self.dialog.create_proxy([_("Direct connection")]+proxyTypes)
if config.app["proxy"]["type"] not in proxyTypes: if config.app["proxy"]["type"] not in proxyTypes:
@ -110,6 +111,7 @@ class globalSettingsController(object):
config.app["app-settings"]["play_ready_sound"] = self.dialog.get_value("general", "play_ready_sound") config.app["app-settings"]["play_ready_sound"] = self.dialog.get_value("general", "play_ready_sound")
config.app["app-settings"]["speak_ready_msg"] = self.dialog.get_value("general", "speak_ready_msg") config.app["app-settings"]["speak_ready_msg"] = self.dialog.get_value("general", "speak_ready_msg")
config.app["app-settings"]["check_for_updates"] = self.dialog.get_value("general", "check_for_updates") config.app["app-settings"]["check_for_updates"] = self.dialog.get_value("general", "check_for_updates")
config.app["app-settings"]["paranoid"] = self.dialog.get_value("general", "paranoid")
if config.app["proxy"]["type"]!=self.dialog.get_value("proxy", "type") or config.app["proxy"]["server"] != self.dialog.get_value("proxy", "server") or config.app["proxy"]["port"] != self.dialog.get_value("proxy", "port") or config.app["proxy"]["user"] != self.dialog.get_value("proxy", "user") or config.app["proxy"]["password"] != self.dialog.get_value("proxy", "password"): if config.app["proxy"]["type"]!=self.dialog.get_value("proxy", "type") or config.app["proxy"]["server"] != self.dialog.get_value("proxy", "server") or config.app["proxy"]["port"] != self.dialog.get_value("proxy", "port") or config.app["proxy"]["user"] != self.dialog.get_value("proxy", "user") or config.app["proxy"]["password"] != self.dialog.get_value("proxy", "password"):
if self.is_started == True: if self.is_started == True:
self.needs_restart = True self.needs_restart = True

View File

@ -45,6 +45,8 @@ class general(wx.Panel, baseDialog.BaseWXDialog):
kmbox.Add(self.km, 0, wx.ALL, 5) kmbox.Add(self.km, 0, wx.ALL, 5)
self.check_for_updates = wx.CheckBox(self, -1, _("Check for updates when {0} launches").format(application.name,)) self.check_for_updates = wx.CheckBox(self, -1, _("Check for updates when {0} launches").format(application.name,))
sizer.Add(self.check_for_updates, 0, wx.ALL, 5) sizer.Add(self.check_for_updates, 0, wx.ALL, 5)
self.paranoid = wx.CheckBox(self, -1, _("Require re-authorization of all accounts when {0} is restarted").format(application.name,))
sizer.Add(self.paranoid, 0, wx.ALL, 5)
sizer.Add(kmbox, 0, wx.ALL, 5) sizer.Add(kmbox, 0, wx.ALL, 5)
self.SetSizer(sizer) self.SetSizer(sizer)