Added run at startup option for installed version

This commit is contained in:
2016-08-05 15:31:22 -05:00
parent b2ebbf5b7a
commit 05a8cb7a28
4 changed files with 13 additions and 6 deletions

View File

@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import os
import webbrowser
#import pocket
import sound_lib
import paths
import widgetUtils
@@ -15,11 +14,10 @@ from extra.autocompletionUsers import settings
from pubsub import pub
import logging
import config_utils
#from pocket_utils import authorisationHandler
import BaseHTTPServer
log = logging.getLogger("Settings")
import keys
from collections import OrderedDict
from platform_utils.autostart import windows as autostart_windows
class globalSettingsController(object):
def __init__(self):
@@ -57,8 +55,11 @@ class globalSettingsController(object):
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", "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"])
@@ -86,6 +87,9 @@ class globalSettingsController(object):
kmFile.close()
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"))