Esempio n. 1
0
    def save(self):
        self.current_folder.show_in_tray_menu = self.showInTrayCheckbox.isChecked()
        self.settingsWidget.save()
        self.current_folder.persist()
        ui_common.set_url_label(self.urlLabel, self.current_folder.path)

        return not self.current_folder.path.startswith(cm.CONFIG_DEFAULT_FOLDER)
Esempio n. 2
0
 def save(self):
     self.settingsWidget.save()
     self.current_script.code = str(self.scriptCodeEditor.text())
     self.current_script.show_in_tray_menu = self.showInTrayCheckbox.isChecked()
     self.current_script.prompt = self.promptCheckbox.isChecked()
     self.current_script.persist()
     ui_common.set_url_label(self.urlLabel, self.current_script.path)
     return False
Esempio n. 3
0
 def save(self):
     self.settingsWidget.save()
     self.current_script.code = str(self.scriptCodeEditor.text())
     self.current_script.show_in_tray_menu = self.showInTrayCheckbox.isChecked(
     )
     self.current_script.prompt = self.promptCheckbox.isChecked()
     self.current_script.persist()
     ui_common.set_url_label(self.urlLabel, self.current_script.path)
     return False
Esempio n. 4
0
    def load(self, folder: Folder):
        self.current_folder = folder
        self.showInTrayCheckbox.setChecked(folder.show_in_tray_menu)
        self.settingsWidget.load(folder)

        if self.is_new_item():
            self.urlLabel.setEnabled(False)
            self.urlLabel.setText("(Unsaved)")  # TODO: i18n
        else:
            ui_common.set_url_label(self.urlLabel, self.current_folder.path)
Esempio n. 5
0
    def load(self, folder: Folder):
        self.current_folder = folder
        self.showInTrayCheckbox.setChecked(folder.show_in_tray_menu)
        self.settingsWidget.load(folder)

        if self.is_new_item():
            self.urlLabel.setEnabled(False)
            self.urlLabel.setText("(Unsaved)")  # TODO: i18n
        else:
            ui_common.set_url_label(self.urlLabel, self.current_folder.path)
Esempio n. 6
0
    def load(self, script: model.Script):
        self.current_script = script
        self.scriptCodeEditor.clear()
        self.scriptCodeEditor.append(script.code)
        self.showInTrayCheckbox.setChecked(script.show_in_tray_menu)
        self.promptCheckbox.setChecked(script.prompt)
        self.settingsWidget.load(script)
        self.window().set_undo_available(False)
        self.window().set_redo_available(False)

        if self.is_new_item():
            self.urlLabel.setEnabled(False)
            self.urlLabel.setText("(Unsaved)")  # TODO: i18n
        else:
            ui_common.set_url_label(self.urlLabel, self.current_script.path)
Esempio n. 7
0
    def load(self, script: model.Script):
        self.current_script = script
        self.scriptCodeEditor.clear()
        self.scriptCodeEditor.append(script.code)
        self.showInTrayCheckbox.setChecked(script.show_in_tray_menu)
        self.promptCheckbox.setChecked(script.prompt)
        self.settingsWidget.load(script)
        self.window().set_undo_available(False)
        self.window().set_redo_available(False)

        if self.is_new_item():
            self.urlLabel.setEnabled(False)
            self.urlLabel.setText("(Unsaved)")  # TODO: i18n
        else:
            ui_common.set_url_label(self.urlLabel, self.current_script.path)
Esempio n. 8
0
    def save(self):
        self.settingsWidget.save()
        self.currentPhrase.phrase = str(self.phraseText.toPlainText())
        self.currentPhrase.show_in_tray_menu = self.showInTrayCheckbox.isChecked()

        self.currentPhrase.sendMode = model.SEND_MODES[str(self.sendModeCombo.currentText())]

        # TODO - re-enable me if restoring predictive functionality
        #if self.predictCheckbox.isChecked():
        #    self.currentPhrase.modes.append(model.TriggerMode.PREDICTIVE)

        self.currentPhrase.prompt = self.promptCheckbox.isChecked()

        self.currentPhrase.persist()
        ui_common.set_url_label(self.urlLabel, self.currentPhrase.path)
        return False
Esempio n. 9
0
    def save(self):
        self.settingsWidget.save()
        self.currentPhrase.phrase = str(self.phraseText.toPlainText())
        self.currentPhrase.show_in_tray_menu = self.showInTrayCheckbox.isChecked(
        )

        self.currentPhrase.sendMode = model.SEND_MODES[str(
            self.sendModeCombo.currentText())]

        # TODO - re-enable me if restoring predictive functionality
        #if self.predictCheckbox.isChecked():
        #    self.currentPhrase.modes.append(model.TriggerMode.PREDICTIVE)

        self.currentPhrase.prompt = self.promptCheckbox.isChecked()

        self.currentPhrase.persist()
        ui_common.set_url_label(self.urlLabel, self.currentPhrase.path)
        return False
Esempio n. 10
0
    def load(self, phrase):
        self.currentPhrase = phrase
        self.phraseText.setPlainText(phrase.phrase)
        self.showInTrayCheckbox.setChecked(phrase.show_in_tray_menu)

        for k, v in model.SEND_MODES.items():
            if v == phrase.sendMode:
                self.sendModeCombo.setCurrentIndex(self.sendModeCombo.findText(k))
                break

        if self.is_new_item():
            self.urlLabel.setEnabled(False)
            self.urlLabel.setText("(Unsaved)")  # TODO: i18n
        else:
            ui_common.set_url_label(self.urlLabel, self.currentPhrase.path)

        # TODO - re-enable me if restoring predictive functionality
        #self.predictCheckbox.setChecked(model.TriggerMode.PREDICTIVE in phrase.modes)

        self.promptCheckbox.setChecked(phrase.prompt)
        self.settingsWidget.load(phrase)
Esempio n. 11
0
    def load(self, phrase):
        self.currentPhrase = phrase
        self.phraseText.setPlainText(phrase.phrase)
        self.showInTrayCheckbox.setChecked(phrase.show_in_tray_menu)

        for k, v in model.SEND_MODES.items():
            if v == phrase.sendMode:
                self.sendModeCombo.setCurrentIndex(
                    self.sendModeCombo.findText(k))
                break

        if self.is_new_item():
            self.urlLabel.setEnabled(False)
            self.urlLabel.setText("(Unsaved)")  # TODO: i18n
        else:
            ui_common.set_url_label(self.urlLabel, self.currentPhrase.path)

        # TODO - re-enable me if restoring predictive functionality
        #self.predictCheckbox.setChecked(model.TriggerMode.PREDICTIVE in phrase.modes)

        self.promptCheckbox.setChecked(phrase.prompt)
        self.settingsWidget.load(phrase)