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)
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
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
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)
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)
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)
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)
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
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
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)
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)