def save(self): settings.set_setting('general/show-splash', self.check_splash.isChecked()) show_start_page = self.check_on_start.isChecked() settings.set_setting('general/show-start-page', show_start_page) settings.set_setting('ventana/store-size', self.check_geometry.isChecked()) settings.set_setting('general/confirm-exit', self.check_on_exit.isChecked()) settings.set_setting('general/check-updates', self.check_updates.isChecked()) load_files = self.check_load_files.isChecked() settings.set_setting('general/load-files', load_files) lang = self.combo_lang.currentText() settings.set_setting('general/language', lang) if settings.IS_LINUX: settings.set_setting('terminal', self.line_terminal.text())
def save(self): settings.set_setting('editor/complete-brace', self.check_key.isChecked()) settings.set_setting('editor/complete-bracket', self.check_bracket.isChecked()) if self.check_bracket.isChecked(): settings.BRACES['['] = ']' elif ('[') in settings.BRACES: del settings.BRACES['['] settings.set_setting('editor/complete-paren', self.check_paren.isChecked()) if self.check_paren.isChecked(): settings.BRACES['('] = ')' elif ('(') in settings.BRACES: del settings.BRACES['('] settings.set_setting('editor/complete-double-quote', self.check_quote.isChecked()) if self.check_quote.isChecked(): settings.QUOTES.append('""') elif '""' in settings.QUOTES: settings.QUOTES.remove('""') settings.set_setting('editor/complete-single-quote', self.check_single_quote.isChecked()) if self.check_single_quote.isChecked(): settings.QUOTES.append('""') elif "''" in settings.QUOTES: settings.QUOTES.remove("''") code_completion = self.check_completion.isChecked() settings.set_setting('editor/completion', code_completion) settings.set_setting('editor/completion-threshold', self.spin_threshold.value()) settings.set_setting('editor/completion-keywords', self.check_keywords.isChecked()) settings.set_setting('editor/completion-document', self.check_document.isChecked()) settings.set_setting('editor/completion-cs', self.check_cs.isChecked()) settings.set_setting('editor/completion-replace-word', self.check_replace_word.isChecked()) settings.set_setting('editor/completion-single', self.check_show_single.isChecked()) editor_container = Edis.get_component("principal") editor = editor_container.get_active_editor() if editor is not None: editor.active_code_completion(code_completion)
def closeEvent(self, event): """ Éste médoto es llamado automáticamente por Qt cuando se cierra la aplicación, guarda algunas configuraciones como posición y tamaño de la ventana, archivos, etc. """ DEBUG("Exiting...") editor_container = Edis.get_component("principal") if editor_container.check_files_not_saved() and \ settings.get_setting('general/confirm-exit'): files_not_saved = editor_container.files_not_saved() dialog = unsaved_files.DialogSaveFiles( files_not_saved, editor_container, self) dialog.exec_() if dialog.ignorado(): event.ignore() if settings.get_setting('window/store-size'): if self.isMaximized(): settings.set_setting('window/show-maximized', True) else: settings.set_setting('window/show-maximized', False) settings.set_setting('window/size', self.size()) settings.set_setting('window/position', self.pos()) opened_files = editor_container.opened_files() settings.set_setting('general/files', opened_files) settings.set_setting('general/recents-files', editor_container.get_recents_files()) projects = editor_container.get_open_projects() settings.set_setting('general/projects', projects)
def save(self): """ Guarda las configuraciones del Editor. """ use_tabs = bool(self.combo_tabs.currentIndex()) settings.set_setting('editor/usetabs', use_tabs) auto_indent = self.check_autoindent.isChecked() settings.set_setting('editor/indent', auto_indent) settings.set_setting('editor/minimap', self.check_minimap.isChecked()) #settings.set_setting('editor/minimap-animation', #self.check_minimap_animation.isChecked()) font = self.combo_font.currentFont().family() settings.set_setting('editor/font', font) font_size = self.spin_size_font.value() settings.set_setting('editor/size-font', font_size) scheme = self.combo_scheme.currentText().split()[0].lower() settings.set_setting('editor/scheme', scheme) settings.set_setting('editor/cursor', self.combo_caret.currentIndex()) settings.set_setting('editor/caret-width', self.spin_caret_width.value()) settings.set_setting('editor/cursor-period', self.slider_caret_period.value()) editor_container = Edis.get_component("principal") editor = editor_container.get_active_editor() if editor is not None: editor.setIndentationsUseTabs(use_tabs) editor.load_font(font, font_size)
def save(self): settings.set_setting('editor/wrap-mode', self.check_wrap.isChecked()) settings.set_setting('editor/show-margin', self.check_margin.isChecked()) settings.set_setting('editor/width-margin', self.slider_margin.value()) settings.set_setting('editor/show-line-number', self.check_line_numbers.isChecked()) settings.set_setting('editor/mark-change', self.check_mark_change.isChecked()) settings.set_setting('editor/match-brace', self.check_match_brace.isChecked()) settings.set_setting('editor/show-caret-line', self.check_current_line.isChecked()) settings.set_setting('editor/show-tabs-spaces', self.check_whitespace.isChecked()) settings.set_setting('editor/show-guides', self.check_guides.isChecked()) settings.set_setting('editor/eof', self.check_eof.isChecked()) editor_container = Edis.get_component("principal") editor = editor_container.get_active_editor() if editor is not None: editor.set_brace_matching() editor.show_line_numbers() editor.update_options() editor.update_margin()
def closeEvent(self, event): """ Éste médoto es llamado automáticamente por Qt cuando se cierra la aplicación, guarda algunas configuraciones como posición y tamaño de la ventana, archivos, etc. """ DEBUG("Exiting...") editor_container = Edis.get_component("principal") if editor_container.check_files_not_saved() and settings.get_setting("general/confirm-exit"): files_not_saved = editor_container.files_not_saved() dialog = unsaved_files.DialogSaveFiles(files_not_saved, editor_container, self) dialog.exec_() if dialog.ignorado(): event.ignore() if settings.get_setting("window/store-size"): if self.isMaximized(): settings.set_setting("window/show-maximized", True) else: settings.set_setting("window/show-maximized", False) settings.set_setting("window/size", self.size()) settings.set_setting("window/position", self.pos()) opened_files = editor_container.opened_files() settings.set_setting("general/files", opened_files) settings.set_setting("general/recents-files", editor_container.get_recents_files()) projects = editor_container.get_open_projects() settings.set_setting("general/projects", projects)
def show_indentation_guides(self): weditor = self.get_active_editor() if weditor is not None: guides = settings.get_setting('editor/show-guides') settings.set_setting('editor/show-guides', not guides) weditor.update_options()
def show_tabs_and_spaces(self): weditor = self.get_active_editor() if weditor is not None: tabs_spaces = settings.get_setting('editor/show-tabs-spaces') settings.set_setting('editor/show-tabs-spaces', not tabs_spaces) weditor.update_options()