Exemplo n.º 1
0
    def __init__(self, parent, configManager):
        builder = configwindow.get_ui("settingsdialog.xml")
        self.ui = builder.get_object("settingsdialog")
        builder.connect_signals(self)
        self.ui.set_transient_for(parent)
        self.configManager = configManager
        
        # General Settings
        self.autoStartCheckbox = builder.get_object("autoStartCheckbox")
        self.promptToSaveCheckbox = builder.get_object("promptToSaveCheckbox")
        self.showTrayCheckbox = builder.get_object("showTrayCheckbox")
        self.allowKbNavCheckbox = builder.get_object("allowKbNavCheckbox")
        self.allowKbNavCheckbox.hide()
        self.sortByUsageCheckbox = builder.get_object("sortByUsageCheckbox")
        self.enableUndoCheckbox = builder.get_object("enableUndoCheckbox")
        
        self.iconStyleCombo = Gtk.ComboBoxText.new()
        hbox = builder.get_object("hbox4")
        hbox.pack_start(self.iconStyleCombo, False, True, 0)
        hbox.show_all()
        
        for key, value in ICON_NAME_MAP.items():
            self.iconStyleCombo.append_text(key)
            ICON_NAME_LIST.append(value)
        self.iconStyleCombo.set_sensitive(ConfigManager.SETTINGS[SHOW_TRAY_ICON])
        self.iconStyleCombo.set_active(ICON_NAME_LIST.index(ConfigManager.SETTINGS[NOTIFICATION_ICON]))
        
        self.autoStartCheckbox.set_active(os.path.exists(AUTOSTART_FILE))
        self.promptToSaveCheckbox.set_active(ConfigManager.SETTINGS[PROMPT_TO_SAVE])
        self.showTrayCheckbox.set_active(ConfigManager.SETTINGS[SHOW_TRAY_ICON])
        #self.allowKbNavCheckbox.set_active(ConfigManager.SETTINGS[MENU_TAKES_FOCUS])
        self.sortByUsageCheckbox.set_active(ConfigManager.SETTINGS[SORT_BY_USAGE_COUNT])
        self.enableUndoCheckbox.set_active(ConfigManager.SETTINGS[UNDO_USING_BACKSPACE])
        



        # Hotkeys
        self.showConfigDlg = GlobalHotkeyDialog(parent, configManager, self.on_config_response)
        self.toggleMonitorDlg = GlobalHotkeyDialog(parent, configManager, self.on_monitor_response)
        self.showRecordDlg = GlobalHotkeyDialog(parent, configManager, self.on_record_response)
        self.configKeyLabel = builder.get_object("configKeyLabel")
        self.clearConfigButton = builder.get_object("clearConfigButton")
        self.monitorKeyLabel = builder.get_object("monitorKeyLabel")
        self.clearMonitorButton = builder.get_object("clearMonitorButton")    
        self.recordKeyLabel = builder.get_object("recordKeyLabel")
        self.clearRecordButton = builder.get_object("clearRecordButton")    
        self.useConfigHotkey = self.__loadHotkey(configManager.configHotkey, self.configKeyLabel, 
                                                    self.showConfigDlg, self.clearConfigButton)
        self.useRecordHotkey = self.__loadHotkey(configManager.recordHotkey, self.recordKeyLabel, 
                                                    self.showRecordDlg, self.clearRecordButton)
        self.useServiceHotkey = self.__loadHotkey(configManager.toggleServiceHotkey, self.monitorKeyLabel, 
                                                    self.toggleMonitorDlg, self.clearMonitorButton)
                                                    
        # Script Engine Settings
        self.userModuleChooserButton = builder.get_object("userModuleChooserButton")
        if configManager.userCodeDir is not None:
            self.userModuleChooserButton.set_current_folder(configManager.userCodeDir)
            if configManager.userCodeDir in sys.path:
                sys.path.remove(configManager.userCodeDir)
Exemplo n.º 2
0
    def __init__(self, parent):
        builder = configwindow.get_ui("detectdialog.xml")
        self.ui = builder.get_object("detectdialog")
        builder.connect_signals(self)
        self.ui.set_transient_for(parent)

        self.classLabel = builder.get_object("classLabel")
        self.titleLabel = builder.get_object("titleLabel")
        self.classRadioButton = builder.get_object("classRadioButton")
        self.titleRadioButton = builder.get_object("titleRadioButton")

        DialogBase.__init__(self)
Exemplo n.º 3
0
    def __init__(self, parent, closure):
        builder = configwindow.get_ui("windowfiltersettings.xml")
        self.ui = builder.get_object("windowfiltersettings")
        builder.connect_signals(self)
        self.ui.set_transient_for(parent)
        self.closure = closure

        self.triggerRegexEntry = builder.get_object("triggerRegexEntry")
        self.recursiveButton = builder.get_object("recursiveButton")
        self.detectButton = builder.get_object("detectButton")

        DialogBase.__init__(self)
Exemplo n.º 4
0
 def __init__(self, parent):
     builder = configwindow.get_ui("detectdialog.xml")
     self.ui = builder.get_object("detectdialog")
     builder.connect_signals(self)
     self.ui.set_transient_for(parent)
     
     self.classLabel = builder.get_object("classLabel")
     self.titleLabel = builder.get_object("titleLabel")
     self.classRadioButton = builder.get_object("classRadioButton")
     self.titleRadioButton = builder.get_object("titleRadioButton")
     
     DialogBase.__init__(self)
Exemplo n.º 5
0
 def __init__(self, parent, closure):
     builder = configwindow.get_ui("windowfiltersettings.xml")
     self.ui = builder.get_object("windowfiltersettings")
     builder.connect_signals(self)
     self.ui.set_transient_for(parent)
     self.closure = closure
     
     self.triggerRegexEntry = builder.get_object("triggerRegexEntry")
     self.recursiveButton = builder.get_object("recursiveButton")
     self.detectButton = builder.get_object("detectButton")
     
     DialogBase.__init__(self)
Exemplo n.º 6
0
 def __init__(self, parent, closure):
     self.closure = closure
     builder = configwindow.get_ui("recorddialog.xml")
     self.ui = builder.get_object("recorddialog")
     builder.connect_signals(self)
     self.ui.set_transient_for(parent)
     
     self.keyboardButton = builder.get_object("keyboardButton")
     self.mouseButton = builder.get_object("mouseButton")
     self.spinButton = builder.get_object("spinButton")
     
     DialogBase.__init__(self)
Exemplo n.º 7
0
    def __init__(self, parent, topwin, closure):
        self.closure = closure
        builder = configwindow.get_ui("recorddialog.xml")
        self.ui = builder.get_object("recorddialog")
        builder.connect_signals(self)
        self.ui.set_transient_for(topwin)

        self.keyboardCheckButton = builder.get_object("keyboardCheckButton")
        self.mouseCheckButton = builder.get_object("mouseCheckButton")
        self.timingCheckButton = builder.get_object("timingCheckButton")
        self.delaySpinButton = builder.get_object("delaySpinButton")
        self.delaySpinButton.set_value(2)

        DialogBase.__init__(self)
Exemplo n.º 8
0
 def __init__(self, parent, topwin, closure):
     self.closure = closure
     builder = configwindow.get_ui("recorddialog.xml")
     self.ui = builder.get_object("recorddialog")
     builder.connect_signals(self)
     self.ui.set_transient_for(topwin)
     
     self.keyboardCheckButton = builder.get_object("keyboardCheckButton")
     self.mouseCheckButton = builder.get_object("mouseCheckButton")
     self.timingCheckButton = builder.get_object("timingCheckButton")
     self.delaySpinButton = builder.get_object("delaySpinButton")
     self.delaySpinButton.set_value(2)
     
     DialogBase.__init__(self)
Exemplo n.º 9
0
    def __init__(self, parent, configManager, closure):
        builder = configwindow.get_ui("hotkeysettings.xml")
        self.ui = builder.get_object("hotkeysettings")
        builder.connect_signals(self)
        self.ui.set_transient_for(parent)
        self.configManager = configManager
        self.closure = closure
        self.key = None

        self.controlButton = builder.get_object("controlButton")
        self.altButton = builder.get_object("altButton")
        self.shiftButton = builder.get_object("shiftButton")
        self.superButton = builder.get_object("superButton")
        self.hyperButton = builder.get_object("hyperButton")
        self.metaButton = builder.get_object("metaButton")
        self.setButton = builder.get_object("setButton")
        self.keyLabel = builder.get_object("keyLabel")
        DialogBase.__init__(self)
Exemplo n.º 10
0
 def __init__(self, parent, configManager, closure):
     builder = configwindow.get_ui("hotkeysettings.xml")
     self.ui = builder.get_object("hotkeysettings")
     builder.connect_signals(self)
     self.ui.set_transient_for(parent)
     self.configManager = configManager
     self.closure = closure
     self.key = None
     
     self.controlButton = builder.get_object("controlButton")
     self.altButton = builder.get_object("altButton")
     self.shiftButton = builder.get_object("shiftButton")
     self.superButton = builder.get_object("superButton")
     self.hyperButton = builder.get_object("hyperButton")
     self.metaButton = builder.get_object("metaButton")
     self.setButton = builder.get_object("setButton")
     self.keyLabel = builder.get_object("keyLabel")
     DialogBase.__init__(self)
Exemplo n.º 11
0
    def __init__(self, parent, configManager, closure):
        builder = configwindow.get_ui("abbrsettings.xml")
        self.ui = builder.get_object("abbrsettings")
        builder.connect_signals(self)
        self.ui.set_transient_for(parent)
        self.configManager = configManager
        self.closure = closure

        self.abbrList = builder.get_object("abbrList")
        self.addButton = builder.get_object("addButton")
        self.removeButton = builder.get_object("removeButton")

        self.wordCharCombo = builder.get_object("wordCharCombo")
        self.removeTypedCheckbox = builder.get_object("removeTypedCheckbox")
        self.omitTriggerCheckbox = builder.get_object("omitTriggerCheckbox")
        self.matchCaseCheckbox = builder.get_object("matchCaseCheckbox")
        self.ignoreCaseCheckbox = builder.get_object("ignoreCaseCheckbox")
        self.triggerInsideCheckbox = builder.get_object(
            "triggerInsideCheckbox")
        self.immediateCheckbox = builder.get_object("immediateCheckbox")

        DialogBase.__init__(self)

        # set up list view
        store = Gtk.ListStore(str)
        self.abbrList.set_model(store)

        column1 = Gtk.TreeViewColumn(_("Abbreviations"))
        textRenderer = Gtk.CellRendererText()
        textRenderer.set_property("editable", True)
        textRenderer.connect("edited", self.on_cell_modified)
        textRenderer.connect("editing-canceled",
                             self.on_cell_editing_cancelled)
        column1.pack_end(textRenderer, True)
        column1.add_attribute(textRenderer, "text", 0)
        column1.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
        self.abbrList.append_column(column1)

        for item in WORD_CHAR_OPTIONS_ORDERED:
            self.wordCharCombo.append_text(item)
Exemplo n.º 12
0
 def __init__(self, parent, configManager, closure):
     builder = configwindow.get_ui("abbrsettings.xml")
     self.ui = builder.get_object("abbrsettings")
     builder.connect_signals(self)
     self.ui.set_transient_for(parent)
     self.configManager = configManager
     self.closure = closure
     
     self.abbrList = builder.get_object("abbrList")
     self.addButton = builder.get_object("addButton")
     self.removeButton = builder.get_object("removeButton")
     
     self.wordCharCombo = builder.get_object("wordCharCombo")
     self.removeTypedCheckbox = builder.get_object("removeTypedCheckbox")
     self.omitTriggerCheckbox = builder.get_object("omitTriggerCheckbox")
     self.matchCaseCheckbox = builder.get_object("matchCaseCheckbox")
     self.ignoreCaseCheckbox = builder.get_object("ignoreCaseCheckbox")
     self.triggerInsideCheckbox = builder.get_object("triggerInsideCheckbox")
     self.immediateCheckbox = builder.get_object("immediateCheckbox")
     
     DialogBase.__init__(self)
     
     # set up list view
     store = Gtk.ListStore(str)
     self.abbrList.set_model(store)
     
     column1 = Gtk.TreeViewColumn(_("Abbreviations"))
     textRenderer = Gtk.CellRendererText()
     textRenderer.set_property("editable", True)
     textRenderer.connect("edited", self.on_cell_modified)
     textRenderer.connect("editing-canceled", self.on_cell_editing_cancelled)
     column1.pack_end(textRenderer, True)
     column1.add_attribute(textRenderer, "text", 0)
     column1.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
     self.abbrList.append_column(column1)
     
     for item in WORD_CHAR_OPTIONS_ORDERED:
         self.wordCharCombo.append_text(item)
Exemplo n.º 13
0
    def __init__(self, parent, configManager):
        builder = configwindow.get_ui("settingsdialog.xml")
        self.ui = builder.get_object("settingsdialog")
        builder.connect_signals(self)
        self.ui.set_transient_for(parent)
        self.configManager = configManager

        # General Settings
        self.autoStartCheckbox = builder.get_object("autoStartCheckbox")
        self.promptToSaveCheckbox = builder.get_object("promptToSaveCheckbox")
        self.showTrayCheckbox = builder.get_object("showTrayCheckbox")
        self.allowKbNavCheckbox = builder.get_object("allowKbNavCheckbox")
        self.allowKbNavCheckbox.hide()
        self.sortByUsageCheckbox = builder.get_object("sortByUsageCheckbox")
        self.triggerItemByInitial = builder.get_object("triggerItemByInitial")
        self.enableUndoCheckbox = builder.get_object("enableUndoCheckbox")

        self.iconStyleCombo = Gtk.ComboBoxText.new()
        hbox = builder.get_object("hbox4")
        hbox.pack_start(self.iconStyleCombo, False, True, 0)
        hbox.show_all()

        for key, value in ICON_NAME_MAP.items():
            self.iconStyleCombo.append_text(key)
            ICON_NAME_LIST.append(value)
        self.iconStyleCombo.set_sensitive(
            ConfigManager.SETTINGS[SHOW_TRAY_ICON])
        self.iconStyleCombo.set_active(
            ICON_NAME_LIST.index(ConfigManager.SETTINGS[NOTIFICATION_ICON]))

        self.autoStartCheckbox.set_active(os.path.exists(AUTOSTART_FILE))
        self.promptToSaveCheckbox.set_active(
            ConfigManager.SETTINGS[PROMPT_TO_SAVE])
        self.showTrayCheckbox.set_active(
            ConfigManager.SETTINGS[SHOW_TRAY_ICON])
        #self.allowKbNavCheckbox.set_active(ConfigManager.SETTINGS[MENU_TAKES_FOCUS])
        self.sortByUsageCheckbox.set_active(
            ConfigManager.SETTINGS[SORT_BY_USAGE_COUNT])
        self.triggerItemByInitial.set_active(
            ConfigManager.SETTINGS[TRIGGER_BY_INITIAL])
        self.enableUndoCheckbox.set_active(
            ConfigManager.SETTINGS[UNDO_USING_BACKSPACE])

        # Hotkeys
        self.showConfigDlg = GlobalHotkeyDialog(parent, configManager,
                                                self.on_config_response)
        self.toggleMonitorDlg = GlobalHotkeyDialog(parent, configManager,
                                                   self.on_monitor_response)
        self.configKeyLabel = builder.get_object("configKeyLabel")
        self.clearConfigButton = builder.get_object("clearConfigButton")
        self.monitorKeyLabel = builder.get_object("monitorKeyLabel")
        self.clearMonitorButton = builder.get_object("clearMonitorButton")

        self.useConfigHotkey = self.__loadHotkey(configManager.configHotkey,
                                                 self.configKeyLabel,
                                                 self.showConfigDlg,
                                                 self.clearConfigButton)
        self.useServiceHotkey = self.__loadHotkey(
            configManager.toggleServiceHotkey, self.monitorKeyLabel,
            self.toggleMonitorDlg, self.clearMonitorButton)

        # Script Engine Settings
        self.userModuleChooserButton = builder.get_object(
            "userModuleChooserButton")
        if configManager.userCodeDir is not None:
            self.userModuleChooserButton.set_current_folder(
                configManager.userCodeDir)
            if configManager.userCodeDir in sys.path:
                sys.path.remove(configManager.userCodeDir)