Skip to content

Commit

Permalink
change: Removed some settings that are no longer needed from our glob…
Browse files Browse the repository at this point in the history
…al settings dialog.
  • Loading branch information
manuelcortez committed May 22, 2024
1 parent 14a956d commit 503bf72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 62 deletions.
14 changes: 2 additions & 12 deletions src/controller/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import languageHandler
import application
from pubsub import pub
from mysc import autostart as autostart_windows
from wxUI.dialogs import configuration
from wxUI import commonMessageDialogs

Expand Down Expand Up @@ -48,21 +47,16 @@ def create_config(self):
self.dialog.create_general(langs,self.kmfriendlies)
self.dialog.general.language.SetSelection(id)
self.dialog.general.km.SetSelection(self.kmid)
if paths.mode == "installed":
self.dialog.set_value("general", "autostart", config.app["app-settings"]["autostart"])
else:
self.dialog.general.autostart.Enable(False)
self.dialog.set_value("general", "ask_at_exit", config.app["app-settings"]["ask_at_exit"])
self.dialog.set_value("general", "no_streaming", config.app["app-settings"]["no_streaming"])
self.dialog.set_value("general", "play_ready_sound", config.app["app-settings"]["play_ready_sound"])
self.dialog.set_value("general", "speak_ready_msg", config.app["app-settings"]["speak_ready_msg"])
self.dialog.set_value("general", "handle_longtweets", config.app["app-settings"]["handle_longtweets"])
self.dialog.set_value("general", "read_long_posts_in_gui", config.app["app-settings"]["read_long_posts_in_gui"])
self.dialog.set_value("general", "use_invisible_shorcuts", config.app["app-settings"]["use_invisible_keyboard_shorcuts"])
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", "update_period", config.app["app-settings"]["update_period"])
self.dialog.set_value("general", "check_for_updates", config.app["app-settings"]["check_for_updates"])
self.dialog.set_value("general", "remember_mention_and_longtweet", config.app["app-settings"]["remember_mention_and_longtweet"])
proxyTypes = [_("System default"), _("HTTP"), _("SOCKS v4"), _("SOCKS v4 with DNS support"), _("SOCKS v5"), _("SOCKS v5 with DNS support")]
self.dialog.create_proxy(proxyTypes)
try:
Expand Down Expand Up @@ -92,9 +86,6 @@ def save_configuration(self):
kmFile.close()
log.debug("Triggered app restart due to a keymap change.")
self.needs_restart = True
if config.app["app-settings"]["autostart"] != self.dialog.get_value("general", "autostart") and paths.mode == "installed":
config.app["app-settings"]["autostart"] = self.dialog.get_value("general", "autostart")
autostart_windows.setAutoStart(application.name, enable=self.dialog.get_value("general", "autostart"))
if config.app["app-settings"]["use_invisible_keyboard_shorcuts"] != self.dialog.get_value("general", "use_invisible_shorcuts"):
config.app["app-settings"]["use_invisible_keyboard_shorcuts"] = self.dialog.get_value("general", "use_invisible_shorcuts")
pub.sendMessage("invisible-shorcuts-changed", registered=self.dialog.get_value("general", "use_invisible_shorcuts"))
Expand All @@ -109,11 +100,10 @@ def save_configuration(self):
config.app["app-settings"]["voice_enabled"] = self.dialog.get_value("general", "disable_sapi5")
config.app["app-settings"]["hide_gui"] = self.dialog.get_value("general", "hide_gui")
config.app["app-settings"]["ask_at_exit"] = self.dialog.get_value("general", "ask_at_exit")
config.app["app-settings"]["handle_longtweets"] = self.dialog.get_value("general", "handle_longtweets")
config.app["app-settings"]["read_long_posts_in_gui"] = self.dialog.get_value("general", "read_long_posts_in_gui")
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"]["check_for_updates"] = self.dialog.get_value("general", "check_for_updates")
config.app["app-settings"]["remember_mention_and_longtweet"] = self.dialog.get_value("general", "remember_mention_and_longtweet")
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:
self.needs_restart = True
Expand Down
44 changes: 0 additions & 44 deletions src/mysc/autostart.py

This file was deleted.

8 changes: 2 additions & 6 deletions src/wxUI/dialogs/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ def __init__(self, parent, languages,keymaps):
langBox.Add(language, 0, wx.ALL, 5)
langBox.Add(self.language, 0, wx.ALL, 5)
sizer.Add(langBox, 0, wx.ALL, 5)
self.autostart = wx.CheckBox(self, -1, _(u"Run {0} at Windows startup").format(application.name,))
self.ask_at_exit = wx.CheckBox(self, -1, _(U"ask before exiting {0}").format(application.name,))
sizer.Add(self.autostart, 0, wx.ALL, 5)
sizer.Add(self.ask_at_exit, 0, wx.ALL, 5)
self.no_streaming = wx.CheckBox(self, -1, _(U"Disable Streaming functions"))
sizer.Add(self.no_streaming, 0, wx.ALL, 5)
Expand All @@ -42,10 +40,8 @@ def __init__(self, parent, languages,keymaps):
sizer.Add(self.disable_sapi5, 0, wx.ALL, 5)
self.hide_gui = wx.CheckBox(self, -1, _(u"Hide GUI on launch"))
sizer.Add(self.hide_gui, 0, wx.ALL, 5)
self.handle_longtweets = wx.CheckBox(self, wx.ID_ANY, _(u"Use Codeofdusk's longtweet handlers (may decrease client performance)"))
sizer.Add(self.handle_longtweets, 0, wx.ALL, 5)
self.remember_mention_and_longtweet = wx.CheckBox(self, -1, _(u"Remember state for mention all and long tweet"))
sizer.Add(self.remember_mention_and_longtweet, 0, wx.ALL, 5)
self.read_long_posts_in_gui = wx.CheckBox(self, wx.ID_ANY, _("Read long posts in GUI"))
sizer.Add(self.read_long_posts_in_gui, 0, wx.ALL, 5)
kmbox = wx.BoxSizer(wx.VERTICAL)
km_label = wx.StaticText(self, -1, _(u"Keymap"))
self.km = wx.ComboBox(self, -1, choices=keymaps, style=wx.CB_READONLY)
Expand Down

0 comments on commit 503bf72

Please sign in to comment.