def restore_defaults(self): editor = Preferences().editor editor.cc_case_sensitive = False editor.cc_show_tooltips = True editor.cc_trigger_len = 1 editor.clean_trailing = True editor.convert_tabs_to_spaces = True editor.highlight_caret_scope = False editor.margin_pos = 79 editor.restore_cursor = True editor.safe_save = True editor.tab_len = 4 editor.use_spaces_instead_of_tabs = True editor.center_on_scroll = True editor.fold_docstrings = False editor.fold_imports = False self.reset()
def apply(self): editor = Preferences().editor editor.cc_show_tooltips = self.ui.cb_cc_tooltips.isChecked() editor.cc_case_sensitive = self.ui.cb_cc_case_sensitive.isChecked() editor.cc_trigger_len = self.ui.sb_cc_trigger_len.value() editor.clean_trailing = self.ui.cb_clean_trailing.isChecked() editor.convert_tabs_to_spaces = \ self.ui.cb_convert_tabs_to_spaces.isChecked() editor.highlight_caret_scope = self.ui.cb_caret_cope.isChecked() editor.margin_pos = self.ui.sb_margin_pos.value() editor.restore_cursor = self.ui.cb_restore_cursor.isChecked() editor.safe_save = self.ui.cb_safe_save.isChecked() editor.tab_len = self.ui.sb_tab_len.value() editor.use_spaces_instead_of_tabs = \ self.ui.cb_spaces_instead_of_tabs.isChecked() editor.fold_docstrings = self.ui.cb_fold_doc.isChecked() editor.fold_imports = self.ui.cb_fold_imports.isChecked() editor.center_on_scroll = self.ui.cb_center_on_scoll.isChecked()