From 9831bd58bbab373bc32d664971b430895a87f389 Mon Sep 17 00:00:00 2001 From: compucell3d Date: Sat, 27 Jun 2026 17:18:35 -0600 Subject: [PATCH 1/5] Added a default feature to auto-pair chracters such as brackets or quotes --- cc3d/twedit5/EditorWindow.py | 10 +++ cc3d/twedit5/QsciScintillaCustom.py | 67 +++++++++++++++++++ cc3d/twedit5/twedit/editor/Configuration.py | 6 +- .../twedit5/twedit/editor/configurationdlg.py | 5 ++ cc3d/twedit5/ui_configurationdlg.py | 13 +++- 5 files changed, 98 insertions(+), 3 deletions(-) diff --git a/cc3d/twedit5/EditorWindow.py b/cc3d/twedit5/EditorWindow.py index c4c93e8..6a9af71 100644 --- a/cc3d/twedit5/EditorWindow.py +++ b/cc3d/twedit5/EditorWindow.py @@ -4327,6 +4327,16 @@ def configureEnableQuickTextDecoding(self, _flag): pass + def configureAutoPairCharacters(self, _flag): + + """ + + fcn handling AutoPairCharacters configuration change + + """ + + self.configuration.setSetting("AutoPairCharacters", _flag) + def configureAutocompletionThreshold(self, _value): """ diff --git a/cc3d/twedit5/QsciScintillaCustom.py b/cc3d/twedit5/QsciScintillaCustom.py index 61e7a82..03cfd98 100644 --- a/cc3d/twedit5/QsciScintillaCustom.py +++ b/cc3d/twedit5/QsciScintillaCustom.py @@ -7,6 +7,14 @@ class QsciScintillaCustom(QsciScintilla): + AUTO_PAIR_CHARS = { + "'": "'", + '"': '"', + "(": ")", + "[": "]", + "{": "}" + } + def __init__(self, parent=None, _panel=None): super(QsciScintillaCustom, self).__init__(parent) @@ -88,9 +96,68 @@ def keyPressEvent(self, event): elif event.modifiers() & Qt.ControlModifier and event.modifiers() & Qt.ShiftModifier: self.handleScintillaDefaultShortcut('Ctrl+Shift', event) + elif self.handle_auto_pair_characters(event): + event.accept() + else: super(QsciScintillaCustom, self).keyPressEvent(event) + def handle_auto_pair_characters(self, event): + """ + Inserts matching closing characters or wraps selected text when enabled. + + :param event: keyboard event + :return: True when this method handled the event + """ + typed_text = event.text() + if len(typed_text) != 1: + return False + + if not self.__auto_pair_characters_enabled(): + return False + + if event.modifiers() & (Qt.ControlModifier | Qt.AltModifier | Qt.MetaModifier): + return False + + if typed_text in self.AUTO_PAIR_CHARS: + self.__insert_auto_pair(typed_text, self.AUTO_PAIR_CHARS[typed_text]) + return True + + if typed_text in self.AUTO_PAIR_CHARS.values() and self.__current_char() == typed_text: + line, index = self.getCursorPosition() + self.setCursorPosition(line, index + 1) + return True + + return False + + def __auto_pair_characters_enabled(self): + try: + return self.editorWindow.configuration.setting("AutoPairCharacters") + except AttributeError: + return True + + def __insert_auto_pair(self, opening_char, closing_char): + if self.hasSelectedText(): + selected_text = self.selectedText() + self.beginUndoAction() + self.replaceSelectedText(opening_char + selected_text + closing_char) + self.endUndoAction() + return + + line, index = self.getCursorPosition() + self.beginUndoAction() + self.insert(opening_char + closing_char) + self.endUndoAction() + self.setCursorPosition(line, index + 1) + + def __current_char(self): + line, index = self.getCursorPosition() + line_text = self.text(line) + if index < len(line_text): + return line_text[index] + + return '' + def focusInEvent(self, event): editor_tab = 0 diff --git a/cc3d/twedit5/twedit/editor/Configuration.py b/cc3d/twedit5/twedit/editor/Configuration.py index f86a03e..0839dc9 100644 --- a/cc3d/twedit5/twedit/editor/Configuration.py +++ b/cc3d/twedit5/twedit/editor/Configuration.py @@ -70,6 +70,8 @@ def initialize_default_settings(self): self.defaultConfigs["EnableAutocompletion"] = False + self.defaultConfigs["AutoPairCharacters"] = True + self.defaultConfigs["EnableQuickTextDecoding"] = True self.defaultConfigs["AutocompletionThreshold"] = 2 @@ -166,7 +168,7 @@ def setting(self, _key): "RestoreTabsOnStartup", "EnableAutocompletion", "EnableQuickTextDecoding", "FRInSelection", - "FRInAllSubfolders", "FRTransparencyEnable", "FROnLosingFocus", "FRAlways"]: + "AutoPairCharacters", "FRInAllSubfolders", "FRTransparencyEnable", "FROnLosingFocus", "FRAlways"]: variant = self.settings.value(_key) if variant is not None: @@ -263,7 +265,7 @@ def setSetting(self, _key, _value): if _key in ["UseTabSpaces", "DisplayLineNumbers", "FoldText", "TabGuidelines", "DisplayWhitespace", "DisplayEOL", "WrapLines", "ShowWrapSymbol", "DontShowWrapLinesWarning", "RestoreTabsOnStartup", "EnableAutocompletion", "EnableQuickTextDecoding", "FRInSelection", - "FRInAllSubfolders", "FRTransparencyEnable", "FROnLosingFocus", "FRAlways"]: + "AutoPairCharacters", "FRInAllSubfolders", "FRTransparencyEnable", "FROnLosingFocus", "FRAlways"]: self.settings.setValue(_key, QVariant(_value)) diff --git a/cc3d/twedit5/twedit/editor/configurationdlg.py b/cc3d/twedit5/twedit/editor/configurationdlg.py index e6f77d8..3503d77 100644 --- a/cc3d/twedit5/twedit/editor/configurationdlg.py +++ b/cc3d/twedit5/twedit/editor/configurationdlg.py @@ -229,6 +229,9 @@ def findChangedConfigs(self): if configuration.setting("EnableAutocompletion") != self.autocompletionCheckBox.isChecked(): configuration.updatedConfigs["EnableAutocompletion"] = self.autocompletionCheckBox.isChecked() + if configuration.setting("AutoPairCharacters") != self.autoPairCharactersCheckBox.isChecked(): + configuration.updatedConfigs["AutoPairCharacters"] = self.autoPairCharactersCheckBox.isChecked() + if configuration.setting("EnableQuickTextDecoding") != self.quickTextDecodingCB.isChecked(): configuration.updatedConfigs["EnableQuickTextDecoding"] = self.quickTextDecodingCB.isChecked() @@ -279,6 +282,8 @@ def updateUi(self): self.autocompletionCheckBox.setChecked(configuration.setting("EnableAutocompletion")) + self.autoPairCharactersCheckBox.setChecked(configuration.setting("AutoPairCharacters")) + self.quickTextDecodingCB.setChecked(configuration.setting("EnableQuickTextDecoding")) self.autocompletionSpinBox.setValue(configuration.setting("AutocompletionThreshold")) diff --git a/cc3d/twedit5/ui_configurationdlg.py b/cc3d/twedit5/ui_configurationdlg.py index 82bd2f3..fae56fd 100644 --- a/cc3d/twedit5/ui_configurationdlg.py +++ b/cc3d/twedit5/ui_configurationdlg.py @@ -152,6 +152,14 @@ def setupUi(self, ConfigurationDlg): self.verticalLayout.addWidget(self.autocompletionCheckBox) + self.autoPairCharactersCheckBox = QtWidgets.QCheckBox(self.editingTab) + + self.autoPairCharactersCheckBox.setChecked(True) + + self.autoPairCharactersCheckBox.setObjectName("autoPairCharactersCheckBox") + + self.verticalLayout.addWidget(self.autoPairCharactersCheckBox) + self.quickTextDecodingCB = QtWidgets.QCheckBox(self.editingTab) self.quickTextDecodingCB.setChecked(True) @@ -500,6 +508,10 @@ def retranslateUi(self, ConfigurationDlg): self.autocompletionCheckBox.setText(_translate("ConfigurationDlg", "Enable Autocompletion")) + self.autoPairCharactersCheckBox.setToolTip(_translate("ConfigurationDlg", "Automatically insert matching closing quotes, parentheses, brackets, and braces")) + + self.autoPairCharactersCheckBox.setText(_translate("ConfigurationDlg", "Auto-pair quotes and brackets")) + self.quickTextDecodingCB.setToolTip(_translate("ConfigurationDlg", "\n" "\n" - -"

Set this option if you want to use multiple spaces when Tab key is pressed instead of "\\t" character.

\n" - -"

This is highly recommended when editing Python scripts (unwritten standard is 4 spaces per tab)

")) - + self.tabSpacesCheckBox.setToolTip(_translate("ConfigurationDlg", "Use multiple spaces when Tab is pressed instead of a tab character. This is recommended for Python scripts.")) self.tabSpacesCheckBox.setText(_translate("ConfigurationDlg", "Use spaces instead of tabs")) - self.tabWidthLabel.setText(_translate("ConfigurationDlg", "Tab width")) - self.lineNumberCheckBox.setText(_translate("ConfigurationDlg", "Display Line Number")) - self.foldTextCheckBox.setText(_translate("ConfigurationDlg", "Enable Text Folding")) - self.tabGuidelinesCheckBox.setToolTip(_translate("ConfigurationDlg", "Display/hide vertical marks that help visualize indentation")) - self.tabGuidelinesCheckBox.setText(_translate("ConfigurationDlg", "Enable Tab Guidelines")) - self.whiteSpaceCheckBox.setToolTip(_translate("ConfigurationDlg", "Display/hide normally invisible white spaces")) - self.whiteSpaceCheckBox.setText(_translate("ConfigurationDlg", "Display whitespaces")) - self.eolCheckBox.setText(_translate("ConfigurationDlg", "Display End of Line")) - self.restoreTabsCheckBox.setText(_translate("ConfigurationDlg", "Restore tabs on startup")) - self.wrapLinesCheckBox.setText(_translate("ConfigurationDlg", "Wrap Lines")) - self.showWrapSymbolCheckBox.setText(_translate("ConfigurationDlg", "Show Wrap Symbol")) - self.autocompletionCheckBox.setText(_translate("ConfigurationDlg", "Enable Autocompletion")) - self.autoPairCharactersCheckBox.setToolTip(_translate("ConfigurationDlg", "Automatically insert matching closing quotes, parentheses, brackets, and braces")) - self.autoPairCharactersCheckBox.setText(_translate("ConfigurationDlg", "Auto-pair quotes and brackets")) - - self.quickTextDecodingCB.setToolTip(_translate("ConfigurationDlg", "\n" - -"\n" - -"

Enales text decoding to be based on first 1000 characters.

\n" - -"

It can be less acurate then full text scanning but documents open faster

")) - + self.quickTextDecodingCB.setToolTip(_translate("ConfigurationDlg", "Enable text decoding based on the first 1000 characters. This can be less accurate than full text scanning, but documents open faster.")) self.quickTextDecodingCB.setText(_translate("ConfigurationDlg", "Enable Quick Text Decoding")) - self.autocompletionLabel.setToolTip(_translate("ConfigurationDlg", "Determines minimum number of characters after which autocompletion options will be displayed")) - self.autocompletionLabel.setText(_translate("ConfigurationDlg", "Autocompletion threshold")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.editingTab), _translate("ConfigurationDlg", "Editing")) - self.groupBox.setTitle(_translate("ConfigurationDlg", "Editor Theme")) - self.fontGroupBox.setTitle(_translate("ConfigurationDlg", "Fonts")) - self.fontLabel.setText(_translate("ConfigurationDlg", "Font")) - self.fontSizeLabel.setText(_translate("ConfigurationDlg", "Size")) - self.fontSizeComboBox.setItemText(0, _translate("ConfigurationDlg", "8")) - self.fontSizeComboBox.setItemText(1, _translate("ConfigurationDlg", "9")) - self.fontSizeComboBox.setItemText(2, _translate("ConfigurationDlg", "10")) - self.fontSizeComboBox.setItemText(3, _translate("ConfigurationDlg", "11")) - self.fontSizeComboBox.setItemText(4, _translate("ConfigurationDlg", "12")) - self.fontSizeComboBox.setItemText(5, _translate("ConfigurationDlg", "14")) - self.fontSizeComboBox.setItemText(6, _translate("ConfigurationDlg", "16")) - self.fontSizeComboBox.setItemText(7, _translate("ConfigurationDlg", "18")) - self.fontSizeComboBox.setItemText(8, _translate("ConfigurationDlg", "20")) - self.fontSizeComboBox.setItemText(9, _translate("ConfigurationDlg", "22")) - self.fontSizeComboBox.setItemText(10, _translate("ConfigurationDlg", "24")) - self.fontSizeComboBox.setItemText(11, _translate("ConfigurationDlg", "26")) - self.fontSizeComboBox.setItemText(12, _translate("ConfigurationDlg", "28")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("ConfigurationDlg", "Style Config")) - self.loadPB.setText(_translate("ConfigurationDlg", "Load")) - self.unloadPB.setText(_translate("ConfigurationDlg", "Unload")) - self.loadOnStartupCHB.setText(_translate("ConfigurationDlg", "Load on startup")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("ConfigurationDlg", "Plugins")) - self.okButton.setText(_translate("ConfigurationDlg", "OK")) - self.cancelButton.setText(_translate("ConfigurationDlg", "Cancel")) - - From 3a280488b255edf1f36d7741dd26c73e88356dcb Mon Sep 17 00:00:00 2001 From: compucell3d Date: Sat, 27 Jun 2026 18:38:28 -0600 Subject: [PATCH 3/5] fixing settings persistence --- cc3d/twedit5/twedit/editor/Configuration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cc3d/twedit5/twedit/editor/Configuration.py b/cc3d/twedit5/twedit/editor/Configuration.py index 0839dc9..899b837 100644 --- a/cc3d/twedit5/twedit/editor/Configuration.py +++ b/cc3d/twedit5/twedit/editor/Configuration.py @@ -357,9 +357,9 @@ def initSyncSettings(self): val = self.settings.value(key) - # if not val.isValid(): - - if not val: + # QSettings.value returns None only when the setting is missing. + # False, 0, empty lists, and empty strings are valid persisted values. + if val is None: self.setSetting(key, self.defaultConfigs[key]) # initialize self.modifiedKeyboardShortcuts From 4c1d68163796fc56b3806fde342a707c6b73e8e9 Mon Sep 17 00:00:00 2001 From: compucell3d Date: Sat, 27 Jun 2026 19:43:04 -0600 Subject: [PATCH 4/5] Added Autosave feature - on by default --- cc3d/twedit5/EditorWindow.py | 80 +++++ cc3d/twedit5/configurationdlg.ui | 281 +++++++++++++++--- cc3d/twedit5/twedit/editor/Configuration.py | 15 +- .../twedit5/twedit/editor/configurationdlg.py | 10 + cc3d/twedit5/ui_configurationdlg.py | 57 +++- 5 files changed, 382 insertions(+), 61 deletions(-) diff --git a/cc3d/twedit5/EditorWindow.py b/cc3d/twedit5/EditorWindow.py index 6a9af71..b6d4661 100644 --- a/cc3d/twedit5/EditorWindow.py +++ b/cc3d/twedit5/EditorWindow.py @@ -165,6 +165,7 @@ def __init__(self, _editor, _editorWindow): def handleChangedText(self): self.editorWindow.updateTextSizeLabel() + self.editorWindow.scheduleAutoSave(self.editor) def handleModificationChanged(self, m): @@ -454,6 +455,11 @@ def __init__(self, _startFileListener=True): self.defaultEditor = None self.textChangedHandlers = {} + self.autoSavePendingEditors = set() + self.autoSaveTimer = QTimer(self) + self.autoSaveTimer.setSingleShot(True) + self.autoSaveTimer.setInterval(self.configuration.setting("AutoSaveInterval")) + self.autoSaveTimer.timeout.connect(self.performAutoSave) # class variables used in searches @@ -1429,6 +1435,8 @@ def closeEvent(self, event): openFilesToRestore = [{}, {}] self.deactivateChangeSensing = True + self.autoSaveTimer.stop() + self.autoSavePendingEditors.clear() # determining index of the current tab @@ -4337,6 +4345,30 @@ def configureAutoPairCharacters(self, _flag): self.configuration.setSetting("AutoPairCharacters", _flag) + def configureEnableAutoSave(self, _flag): + + """ + + fcn handling EnableAutoSave configuration change + + """ + + self.configuration.setSetting("EnableAutoSave", _flag) + if not _flag: + self.autoSaveTimer.stop() + self.autoSavePendingEditors.clear() + + def configureAutoSaveInterval(self, _value): + + """ + + fcn handling AutoSaveInterval configuration change + + """ + + self.configuration.setSetting("AutoSaveInterval", _value) + self.autoSaveTimer.setInterval(_value) + def configureAutocompletionThreshold(self, _value): """ @@ -5167,6 +5199,54 @@ def saveAll(self): currentEditor.setFocus(Qt.MouseFocusReason) + def scheduleAutoSave(self, editor): + + """ + + schedules autosave for a changed editor + + """ + + if self.deactivateChangeSensing: + return + + if not self.configuration.setting("EnableAutoSave"): + return + + if editor is None or editor.isReadOnly(): + return + + file_name = self.getEditorFileName(editor) + if not file_name: + return + + self.autoSavePendingEditors.add(editor) + self.autoSaveTimer.start(self.configuration.setting("AutoSaveInterval")) + + def performAutoSave(self): + + """ + + saves modified named documents after the configured autosave delay + + """ + + if self.deactivateChangeSensing: + return + + pending_editors = list(self.autoSavePendingEditors) + self.autoSavePendingEditors.clear() + + for editor in pending_editors: + if editor is None or editor.isReadOnly() or not editor.isModified(): + continue + + file_name = self.getEditorFileName(editor) + if not file_name: + continue + + self.saveFile(file_name, editor) + def about(self): """ diff --git a/cc3d/twedit5/configurationdlg.ui b/cc3d/twedit5/configurationdlg.ui index d0dfb22..4cf4bd2 100644 --- a/cc3d/twedit5/configurationdlg.ui +++ b/cc3d/twedit5/configurationdlg.ui @@ -6,8 +6,8 @@ 0 0 - 530 - 446 + 590 + 503 @@ -23,20 +23,8 @@ Editing - - - 0 - - - 0 - - - 0 - - - 0 - - + + @@ -187,6 +175,19 @@ + + + + Automatically save modified named files after a short delay + + + Enable Auto-save + + + true + + + @@ -201,9 +202,65 @@ - - + + + QFormLayout::FieldsStayAtSizeHint + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + 210 + 0 + + + + Delay in milliseconds after typing stops before autosave runs + + + Auto-save timeout (ms) + + + + + + + + 90 + 0 + + + + Delay in milliseconds after typing stops before autosave runs + + + 100 + + + 600000 + + + 100 + + + 1000 + + + + + + + 210 + 0 + + Determines minimum number of characters after which autocompletion options will be displayed @@ -212,8 +269,14 @@ - + + + + 90 + 0 + + 1 @@ -228,28 +291,28 @@ - - + + - Qt::Horizontal + Qt::Vertical - 204 - 291 + 177 + 10 - - + + - Qt::Vertical + Qt::Horizontal - 177 - 10 + 204 + 291 @@ -342,19 +405,71 @@ - 8 - 9 - 10 - 11 - 12 - 14 - 16 - 18 - 20 - 22 - 24 - 26 - 28 + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 14 + + + + + 16 + + + + + 18 + + + + + 20 + + + + + 22 + + + + + 24 + + + + + 26 + + + + + 28 + + @@ -530,30 +645,112 @@ toggled(bool) spacesSpinBox setEnabled(bool) + + + 20 + 20 + + + 20 + 20 + + cancelButton clicked() ConfigurationDlg reject() + + + 20 + 20 + + + 20 + 20 + + okButton clicked() ConfigurationDlg accept() + + + 20 + 20 + + + 20 + 20 + + wrapLinesCheckBox toggled(bool) showWrapSymbolCheckBox setEnabled(bool) + + + 20 + 20 + + + 20 + 20 + + autocompletionCheckBox toggled(bool) autocompletionSpinBox setEnabled(bool) + + + 20 + 20 + + + 20 + 20 + + + + + autoSaveCheckBox + toggled(bool) + autoSaveIntervalLabel + setEnabled(bool) + + + 20 + 20 + + + 20 + 20 + + + + + autoSaveCheckBox + toggled(bool) + autoSaveIntervalSpinBox + setEnabled(bool) + + + 20 + 20 + + + 20 + 20 + + diff --git a/cc3d/twedit5/twedit/editor/Configuration.py b/cc3d/twedit5/twedit/editor/Configuration.py index 899b837..4ebd3dc 100644 --- a/cc3d/twedit5/twedit/editor/Configuration.py +++ b/cc3d/twedit5/twedit/editor/Configuration.py @@ -72,6 +72,10 @@ def initialize_default_settings(self): self.defaultConfigs["AutoPairCharacters"] = True + self.defaultConfigs["EnableAutoSave"] = True + + self.defaultConfigs["AutoSaveInterval"] = 1000 + self.defaultConfigs["EnableQuickTextDecoding"] = True self.defaultConfigs["AutocompletionThreshold"] = 2 @@ -168,7 +172,8 @@ def setting(self, _key): "RestoreTabsOnStartup", "EnableAutocompletion", "EnableQuickTextDecoding", "FRInSelection", - "AutoPairCharacters", "FRInAllSubfolders", "FRTransparencyEnable", "FROnLosingFocus", "FRAlways"]: + "AutoPairCharacters", "EnableAutoSave", "FRInAllSubfolders", "FRTransparencyEnable", + "FROnLosingFocus", "FRAlways"]: variant = self.settings.value(_key) if variant is not None: @@ -191,7 +196,8 @@ def setting(self, _key): elif _key in ["TabSpaces", "ZoomRange", "ZoomRangeFindDisplayWidget", "AutocompletionThreshold", - "FRSyntaxIndex", "FROpacity", "CurrentTabIndex", "CurrentPanelIndex"]: # integer values + "AutoSaveInterval", "FRSyntaxIndex", "FROpacity", "CurrentTabIndex", + "CurrentPanelIndex"]: # integer values variant = self.settings.value(_key) if variant is not None: @@ -265,13 +271,14 @@ def setSetting(self, _key, _value): if _key in ["UseTabSpaces", "DisplayLineNumbers", "FoldText", "TabGuidelines", "DisplayWhitespace", "DisplayEOL", "WrapLines", "ShowWrapSymbol", "DontShowWrapLinesWarning", "RestoreTabsOnStartup", "EnableAutocompletion", "EnableQuickTextDecoding", "FRInSelection", - "AutoPairCharacters", "FRInAllSubfolders", "FRTransparencyEnable", "FROnLosingFocus", "FRAlways"]: + "AutoPairCharacters", "EnableAutoSave", "FRInAllSubfolders", "FRTransparencyEnable", + "FROnLosingFocus", "FRAlways"]: self.settings.setValue(_key, QVariant(_value)) # integer values elif _key in ["TabSpaces", "ZoomRange", "ZoomRangeFindDisplayWidget", "AutocompletionThreshold", - "FRSyntaxIndex", "FROpacity", "CurrentTabIndex", "CurrentPanelIndex"]: + "AutoSaveInterval", "FRSyntaxIndex", "FROpacity", "CurrentTabIndex", "CurrentPanelIndex"]: self.settings.setValue(_key, _value) diff --git a/cc3d/twedit5/twedit/editor/configurationdlg.py b/cc3d/twedit5/twedit/editor/configurationdlg.py index 3503d77..dd07f07 100644 --- a/cc3d/twedit5/twedit/editor/configurationdlg.py +++ b/cc3d/twedit5/twedit/editor/configurationdlg.py @@ -232,6 +232,12 @@ def findChangedConfigs(self): if configuration.setting("AutoPairCharacters") != self.autoPairCharactersCheckBox.isChecked(): configuration.updatedConfigs["AutoPairCharacters"] = self.autoPairCharactersCheckBox.isChecked() + if configuration.setting("EnableAutoSave") != self.autoSaveCheckBox.isChecked(): + configuration.updatedConfigs["EnableAutoSave"] = self.autoSaveCheckBox.isChecked() + + if configuration.setting("AutoSaveInterval") != self.autoSaveIntervalSpinBox.value(): + configuration.updatedConfigs["AutoSaveInterval"] = self.autoSaveIntervalSpinBox.value() + if configuration.setting("EnableQuickTextDecoding") != self.quickTextDecodingCB.isChecked(): configuration.updatedConfigs["EnableQuickTextDecoding"] = self.quickTextDecodingCB.isChecked() @@ -284,6 +290,10 @@ def updateUi(self): self.autoPairCharactersCheckBox.setChecked(configuration.setting("AutoPairCharacters")) + self.autoSaveCheckBox.setChecked(configuration.setting("EnableAutoSave")) + + self.autoSaveIntervalSpinBox.setValue(configuration.setting("AutoSaveInterval")) + self.quickTextDecodingCB.setChecked(configuration.setting("EnableQuickTextDecoding")) self.autocompletionSpinBox.setValue(configuration.setting("AutocompletionThreshold")) diff --git a/cc3d/twedit5/ui_configurationdlg.py b/cc3d/twedit5/ui_configurationdlg.py index 8a32118..8cbefd9 100644 --- a/cc3d/twedit5/ui_configurationdlg.py +++ b/cc3d/twedit5/ui_configurationdlg.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/Users/m/src/conda-build-repos/cc3d-twedit5/cc3d/twedit5/configurationdlg.ui' +# Form implementation generated from reading ui file 'configurationdlg.ui' # # Created by: PyQt5 UI code generator 5.15.9 # @@ -14,16 +14,15 @@ class Ui_ConfigurationDlg(object): def setupUi(self, ConfigurationDlg): ConfigurationDlg.setObjectName("ConfigurationDlg") - ConfigurationDlg.resize(530, 446) + ConfigurationDlg.resize(590, 503) self.verticalLayout_3 = QtWidgets.QVBoxLayout(ConfigurationDlg) self.verticalLayout_3.setObjectName("verticalLayout_3") self.tabWidget = QtWidgets.QTabWidget(ConfigurationDlg) self.tabWidget.setObjectName("tabWidget") self.editingTab = QtWidgets.QWidget() self.editingTab.setObjectName("editingTab") - self.gridLayout_2 = QtWidgets.QGridLayout(self.editingTab) - self.gridLayout_2.setContentsMargins(0, 0, 0, 0) - self.gridLayout_2.setObjectName("gridLayout_2") + self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.editingTab) + self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.gridLayout = QtWidgets.QGridLayout() @@ -82,27 +81,48 @@ def setupUi(self, ConfigurationDlg): self.autoPairCharactersCheckBox.setChecked(True) self.autoPairCharactersCheckBox.setObjectName("autoPairCharactersCheckBox") self.verticalLayout.addWidget(self.autoPairCharactersCheckBox) + self.autoSaveCheckBox = QtWidgets.QCheckBox(self.editingTab) + self.autoSaveCheckBox.setChecked(True) + self.autoSaveCheckBox.setObjectName("autoSaveCheckBox") + self.verticalLayout.addWidget(self.autoSaveCheckBox) self.quickTextDecodingCB = QtWidgets.QCheckBox(self.editingTab) self.quickTextDecodingCB.setChecked(True) self.quickTextDecodingCB.setObjectName("quickTextDecodingCB") self.verticalLayout.addWidget(self.quickTextDecodingCB) - self.horizontalLayout_3 = QtWidgets.QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.editingOptionsFormLayout = QtWidgets.QFormLayout() + self.editingOptionsFormLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldsStayAtSizeHint) + self.editingOptionsFormLayout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.editingOptionsFormLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.editingOptionsFormLayout.setObjectName("editingOptionsFormLayout") + self.autoSaveIntervalLabel = QtWidgets.QLabel(self.editingTab) + self.autoSaveIntervalLabel.setMinimumSize(QtCore.QSize(210, 0)) + self.autoSaveIntervalLabel.setObjectName("autoSaveIntervalLabel") + self.editingOptionsFormLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.autoSaveIntervalLabel) + self.autoSaveIntervalSpinBox = QtWidgets.QSpinBox(self.editingTab) + self.autoSaveIntervalSpinBox.setMinimumSize(QtCore.QSize(90, 0)) + self.autoSaveIntervalSpinBox.setMinimum(100) + self.autoSaveIntervalSpinBox.setMaximum(600000) + self.autoSaveIntervalSpinBox.setSingleStep(100) + self.autoSaveIntervalSpinBox.setProperty("value", 1000) + self.autoSaveIntervalSpinBox.setObjectName("autoSaveIntervalSpinBox") + self.editingOptionsFormLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.autoSaveIntervalSpinBox) self.autocompletionLabel = QtWidgets.QLabel(self.editingTab) + self.autocompletionLabel.setMinimumSize(QtCore.QSize(210, 0)) self.autocompletionLabel.setObjectName("autocompletionLabel") - self.horizontalLayout_3.addWidget(self.autocompletionLabel) + self.editingOptionsFormLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.autocompletionLabel) self.autocompletionSpinBox = QtWidgets.QSpinBox(self.editingTab) + self.autocompletionSpinBox.setMinimumSize(QtCore.QSize(90, 0)) self.autocompletionSpinBox.setMinimum(1) self.autocompletionSpinBox.setProperty("value", 2) self.autocompletionSpinBox.setObjectName("autocompletionSpinBox") - self.horizontalLayout_3.addWidget(self.autocompletionSpinBox) - self.verticalLayout.addLayout(self.horizontalLayout_3) + self.editingOptionsFormLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.autocompletionSpinBox) + self.verticalLayout.addLayout(self.editingOptionsFormLayout) self.verticalLayout_2.addLayout(self.verticalLayout) - self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1) - spacerItem1 = QtWidgets.QSpacerItem(204, 291, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_2.addItem(spacerItem1, 0, 1, 1, 1) - spacerItem2 = QtWidgets.QSpacerItem(177, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem2, 1, 0, 1, 1) + self.horizontalLayout_3.addLayout(self.verticalLayout_2) + spacerItem1 = QtWidgets.QSpacerItem(177, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.horizontalLayout_3.addItem(spacerItem1) + spacerItem2 = QtWidgets.QSpacerItem(204, 291, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_3.addItem(spacerItem2) self.tabWidget.addTab(self.editingTab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") @@ -231,6 +251,8 @@ def setupUi(self, ConfigurationDlg): self.okButton.clicked.connect(ConfigurationDlg.accept) # type: ignore self.wrapLinesCheckBox.toggled['bool'].connect(self.showWrapSymbolCheckBox.setEnabled) # type: ignore self.autocompletionCheckBox.toggled['bool'].connect(self.autocompletionSpinBox.setEnabled) # type: ignore + self.autoSaveCheckBox.toggled['bool'].connect(self.autoSaveIntervalLabel.setEnabled) # type: ignore + self.autoSaveCheckBox.toggled['bool'].connect(self.autoSaveIntervalSpinBox.setEnabled) # type: ignore QtCore.QMetaObject.connectSlotsByName(ConfigurationDlg) def retranslateUi(self, ConfigurationDlg): @@ -252,8 +274,13 @@ def retranslateUi(self, ConfigurationDlg): self.autocompletionCheckBox.setText(_translate("ConfigurationDlg", "Enable Autocompletion")) self.autoPairCharactersCheckBox.setToolTip(_translate("ConfigurationDlg", "Automatically insert matching closing quotes, parentheses, brackets, and braces")) self.autoPairCharactersCheckBox.setText(_translate("ConfigurationDlg", "Auto-pair quotes and brackets")) + self.autoSaveCheckBox.setToolTip(_translate("ConfigurationDlg", "Automatically save modified named files after a short delay")) + self.autoSaveCheckBox.setText(_translate("ConfigurationDlg", "Enable Auto-save")) self.quickTextDecodingCB.setToolTip(_translate("ConfigurationDlg", "Enable text decoding based on the first 1000 characters. This can be less accurate than full text scanning, but documents open faster.")) self.quickTextDecodingCB.setText(_translate("ConfigurationDlg", "Enable Quick Text Decoding")) + self.autoSaveIntervalLabel.setToolTip(_translate("ConfigurationDlg", "Delay in milliseconds after typing stops before autosave runs")) + self.autoSaveIntervalLabel.setText(_translate("ConfigurationDlg", "Auto-save timeout (ms)")) + self.autoSaveIntervalSpinBox.setToolTip(_translate("ConfigurationDlg", "Delay in milliseconds after typing stops before autosave runs")) self.autocompletionLabel.setToolTip(_translate("ConfigurationDlg", "Determines minimum number of characters after which autocompletion options will be displayed")) self.autocompletionLabel.setText(_translate("ConfigurationDlg", "Autocompletion threshold")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.editingTab), _translate("ConfigurationDlg", "Editing")) From 5771209afd1559615ade1c79a5983216824ecf9b Mon Sep 17 00:00:00 2001 From: compucell3d Date: Sat, 27 Jun 2026 19:50:49 -0600 Subject: [PATCH 5/5] Fixing configuration dialog --- cc3d/twedit5/configurationdlg.ui | 268 +++++++++++++--------------- cc3d/twedit5/ui_configurationdlg.py | 102 ++++++----- 2 files changed, 175 insertions(+), 195 deletions(-) diff --git a/cc3d/twedit5/configurationdlg.ui b/cc3d/twedit5/configurationdlg.ui index 4cf4bd2..faabddb 100644 --- a/cc3d/twedit5/configurationdlg.ui +++ b/cc3d/twedit5/configurationdlg.ui @@ -6,8 +6,8 @@ 0 0 - 590 - 503 + 579 + 557 @@ -23,7 +23,7 @@ Editing - + @@ -76,105 +76,108 @@ + + + + Display Line Number + + + true + + + + + + + Enable Text Folding + + + true + + + + + + + Display/hide vertical marks that help visualize indentation + + + Enable Tab Guidelines + + + true + + + + + + + Display/hide normally invisible white spaces + + + Display whitespaces + + + + + + + Display End of Line + + + + + + + Restore tabs on startup + + + true + + + + + + + Wrap Lines + + + + + + + Show Wrap Symbol + + + + + + + Automatically insert matching closing quotes, parentheses, brackets, and braces + + + Auto-pair quotes and brackets + + + true + + + + + + + Enable text decoding based on the first 1000 characters. This can be less accurate than full text scanning, but documents open faster. + + + Enable Quick Text Decoding + + + true + + + - - - - Display Line Number - - - true - - - - - - - Enable Text Folding - - - true - - - - - - - Display/hide vertical marks that help visualize indentation - - - Enable Tab Guidelines - - - true - - - - - - - Display/hide normally invisible white spaces - - - Display whitespaces - - - - - - - Display End of Line - - - - - - - Restore tabs on startup - - - true - - - - - - - Wrap Lines - - - - - - - Show Wrap Symbol - - - - - - - Enable Autocompletion - - - true - - - - - - - Automatically insert matching closing quotes, parentheses, brackets, and braces - - - Auto-pair quotes and brackets - - - true - - - @@ -189,30 +192,8 @@ - - - Enable text decoding based on the first 1000 characters. This can be less accurate than full text scanning, but documents open faster. - - - Enable Quick Text Decoding - - - true - - - - - - - QFormLayout::FieldsStayAtSizeHint - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - + + @@ -228,7 +209,7 @@ - + @@ -253,7 +234,21 @@ - + + + + + + Enable Autocompletion + + + true + + + + + + @@ -269,7 +264,7 @@ - + @@ -292,27 +287,14 @@ - - - Qt::Vertical - - - - 177 - 10 - - - - - - + Qt::Horizontal - 204 - 291 + 164 + 20 diff --git a/cc3d/twedit5/ui_configurationdlg.py b/cc3d/twedit5/ui_configurationdlg.py index 8cbefd9..a34ef4e 100644 --- a/cc3d/twedit5/ui_configurationdlg.py +++ b/cc3d/twedit5/ui_configurationdlg.py @@ -14,15 +14,15 @@ class Ui_ConfigurationDlg(object): def setupUi(self, ConfigurationDlg): ConfigurationDlg.setObjectName("ConfigurationDlg") - ConfigurationDlg.resize(590, 503) + ConfigurationDlg.resize(579, 557) self.verticalLayout_3 = QtWidgets.QVBoxLayout(ConfigurationDlg) self.verticalLayout_3.setObjectName("verticalLayout_3") self.tabWidget = QtWidgets.QTabWidget(ConfigurationDlg) self.tabWidget.setObjectName("tabWidget") self.editingTab = QtWidgets.QWidget() self.editingTab.setObjectName("editingTab") - self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.editingTab) - self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.horizontalLayout_10 = QtWidgets.QHBoxLayout(self.editingTab) + self.horizontalLayout_10.setObjectName("horizontalLayout_10") self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.gridLayout = QtWidgets.QGridLayout() @@ -43,61 +43,54 @@ def setupUi(self, ConfigurationDlg): spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem, 1, 2, 1, 1) self.verticalLayout_2.addLayout(self.gridLayout) - self.verticalLayout = QtWidgets.QVBoxLayout() - self.verticalLayout.setObjectName("verticalLayout") self.lineNumberCheckBox = QtWidgets.QCheckBox(self.editingTab) self.lineNumberCheckBox.setChecked(True) self.lineNumberCheckBox.setObjectName("lineNumberCheckBox") - self.verticalLayout.addWidget(self.lineNumberCheckBox) + self.verticalLayout_2.addWidget(self.lineNumberCheckBox) self.foldTextCheckBox = QtWidgets.QCheckBox(self.editingTab) self.foldTextCheckBox.setChecked(True) self.foldTextCheckBox.setObjectName("foldTextCheckBox") - self.verticalLayout.addWidget(self.foldTextCheckBox) + self.verticalLayout_2.addWidget(self.foldTextCheckBox) self.tabGuidelinesCheckBox = QtWidgets.QCheckBox(self.editingTab) self.tabGuidelinesCheckBox.setChecked(True) self.tabGuidelinesCheckBox.setObjectName("tabGuidelinesCheckBox") - self.verticalLayout.addWidget(self.tabGuidelinesCheckBox) + self.verticalLayout_2.addWidget(self.tabGuidelinesCheckBox) self.whiteSpaceCheckBox = QtWidgets.QCheckBox(self.editingTab) self.whiteSpaceCheckBox.setObjectName("whiteSpaceCheckBox") - self.verticalLayout.addWidget(self.whiteSpaceCheckBox) + self.verticalLayout_2.addWidget(self.whiteSpaceCheckBox) self.eolCheckBox = QtWidgets.QCheckBox(self.editingTab) self.eolCheckBox.setObjectName("eolCheckBox") - self.verticalLayout.addWidget(self.eolCheckBox) + self.verticalLayout_2.addWidget(self.eolCheckBox) self.restoreTabsCheckBox = QtWidgets.QCheckBox(self.editingTab) self.restoreTabsCheckBox.setChecked(True) self.restoreTabsCheckBox.setObjectName("restoreTabsCheckBox") - self.verticalLayout.addWidget(self.restoreTabsCheckBox) + self.verticalLayout_2.addWidget(self.restoreTabsCheckBox) self.wrapLinesCheckBox = QtWidgets.QCheckBox(self.editingTab) self.wrapLinesCheckBox.setObjectName("wrapLinesCheckBox") - self.verticalLayout.addWidget(self.wrapLinesCheckBox) + self.verticalLayout_2.addWidget(self.wrapLinesCheckBox) self.showWrapSymbolCheckBox = QtWidgets.QCheckBox(self.editingTab) self.showWrapSymbolCheckBox.setObjectName("showWrapSymbolCheckBox") - self.verticalLayout.addWidget(self.showWrapSymbolCheckBox) - self.autocompletionCheckBox = QtWidgets.QCheckBox(self.editingTab) - self.autocompletionCheckBox.setChecked(True) - self.autocompletionCheckBox.setObjectName("autocompletionCheckBox") - self.verticalLayout.addWidget(self.autocompletionCheckBox) + self.verticalLayout_2.addWidget(self.showWrapSymbolCheckBox) self.autoPairCharactersCheckBox = QtWidgets.QCheckBox(self.editingTab) self.autoPairCharactersCheckBox.setChecked(True) self.autoPairCharactersCheckBox.setObjectName("autoPairCharactersCheckBox") - self.verticalLayout.addWidget(self.autoPairCharactersCheckBox) + self.verticalLayout_2.addWidget(self.autoPairCharactersCheckBox) + self.quickTextDecodingCB = QtWidgets.QCheckBox(self.editingTab) + self.quickTextDecodingCB.setChecked(True) + self.quickTextDecodingCB.setObjectName("quickTextDecodingCB") + self.verticalLayout_2.addWidget(self.quickTextDecodingCB) + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") self.autoSaveCheckBox = QtWidgets.QCheckBox(self.editingTab) self.autoSaveCheckBox.setChecked(True) self.autoSaveCheckBox.setObjectName("autoSaveCheckBox") self.verticalLayout.addWidget(self.autoSaveCheckBox) - self.quickTextDecodingCB = QtWidgets.QCheckBox(self.editingTab) - self.quickTextDecodingCB.setChecked(True) - self.quickTextDecodingCB.setObjectName("quickTextDecodingCB") - self.verticalLayout.addWidget(self.quickTextDecodingCB) - self.editingOptionsFormLayout = QtWidgets.QFormLayout() - self.editingOptionsFormLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldsStayAtSizeHint) - self.editingOptionsFormLayout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.editingOptionsFormLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.editingOptionsFormLayout.setObjectName("editingOptionsFormLayout") + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.autoSaveIntervalLabel = QtWidgets.QLabel(self.editingTab) self.autoSaveIntervalLabel.setMinimumSize(QtCore.QSize(210, 0)) self.autoSaveIntervalLabel.setObjectName("autoSaveIntervalLabel") - self.editingOptionsFormLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.autoSaveIntervalLabel) + self.horizontalLayout_3.addWidget(self.autoSaveIntervalLabel) self.autoSaveIntervalSpinBox = QtWidgets.QSpinBox(self.editingTab) self.autoSaveIntervalSpinBox.setMinimumSize(QtCore.QSize(90, 0)) self.autoSaveIntervalSpinBox.setMinimum(100) @@ -105,24 +98,29 @@ def setupUi(self, ConfigurationDlg): self.autoSaveIntervalSpinBox.setSingleStep(100) self.autoSaveIntervalSpinBox.setProperty("value", 1000) self.autoSaveIntervalSpinBox.setObjectName("autoSaveIntervalSpinBox") - self.editingOptionsFormLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.autoSaveIntervalSpinBox) + self.horizontalLayout_3.addWidget(self.autoSaveIntervalSpinBox) + self.verticalLayout.addLayout(self.horizontalLayout_3) + self.autocompletionCheckBox = QtWidgets.QCheckBox(self.editingTab) + self.autocompletionCheckBox.setChecked(True) + self.autocompletionCheckBox.setObjectName("autocompletionCheckBox") + self.verticalLayout.addWidget(self.autocompletionCheckBox) + self.horizontalLayout_9 = QtWidgets.QHBoxLayout() + self.horizontalLayout_9.setObjectName("horizontalLayout_9") self.autocompletionLabel = QtWidgets.QLabel(self.editingTab) self.autocompletionLabel.setMinimumSize(QtCore.QSize(210, 0)) self.autocompletionLabel.setObjectName("autocompletionLabel") - self.editingOptionsFormLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.autocompletionLabel) + self.horizontalLayout_9.addWidget(self.autocompletionLabel) self.autocompletionSpinBox = QtWidgets.QSpinBox(self.editingTab) self.autocompletionSpinBox.setMinimumSize(QtCore.QSize(90, 0)) self.autocompletionSpinBox.setMinimum(1) self.autocompletionSpinBox.setProperty("value", 2) self.autocompletionSpinBox.setObjectName("autocompletionSpinBox") - self.editingOptionsFormLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.autocompletionSpinBox) - self.verticalLayout.addLayout(self.editingOptionsFormLayout) + self.horizontalLayout_9.addWidget(self.autocompletionSpinBox) + self.verticalLayout.addLayout(self.horizontalLayout_9) self.verticalLayout_2.addLayout(self.verticalLayout) - self.horizontalLayout_3.addLayout(self.verticalLayout_2) - spacerItem1 = QtWidgets.QSpacerItem(177, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.horizontalLayout_3.addItem(spacerItem1) - spacerItem2 = QtWidgets.QSpacerItem(204, 291, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_3.addItem(spacerItem2) + self.horizontalLayout_10.addLayout(self.verticalLayout_2) + spacerItem1 = QtWidgets.QSpacerItem(164, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_10.addItem(spacerItem1) self.tabWidget.addTab(self.editingTab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") @@ -165,8 +163,8 @@ def setupUi(self, ConfigurationDlg): self.fontSizeLabel = QtWidgets.QLabel(self.fontGroupBox) self.fontSizeLabel.setObjectName("fontSizeLabel") self.horizontalLayout_5.addWidget(self.fontSizeLabel) - spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_5.addItem(spacerItem3) + spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_5.addItem(spacerItem2) self.fontSizeComboBox = QtWidgets.QComboBox(self.fontGroupBox) self.fontSizeComboBox.setObjectName("fontSizeComboBox") self.fontSizeComboBox.addItem("") @@ -187,11 +185,11 @@ def setupUi(self, ConfigurationDlg): self.verticalLayout_7.addLayout(self.verticalLayout_4) self.verticalLayout_8.addWidget(self.fontGroupBox) self.horizontalLayout_8.addLayout(self.verticalLayout_8) - spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_8.addItem(spacerItem4) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_8.addItem(spacerItem3) self.verticalLayout_9.addLayout(self.horizontalLayout_8) - spacerItem5 = QtWidgets.QSpacerItem(17, 165, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout_9.addItem(spacerItem5) + spacerItem4 = QtWidgets.QSpacerItem(17, 165, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_9.addItem(spacerItem4) self.tabWidget.addTab(self.tab_2, "") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") @@ -220,19 +218,19 @@ def setupUi(self, ConfigurationDlg): self.loadOnStartupCHB = QtWidgets.QCheckBox(self.tab) self.loadOnStartupCHB.setObjectName("loadOnStartupCHB") self.horizontalLayout_6.addWidget(self.loadOnStartupCHB) - spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_6.addItem(spacerItem6) + spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_6.addItem(spacerItem5) self.verticalLayout_6.addLayout(self.horizontalLayout_6) - spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout_6.addItem(spacerItem7) + spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_6.addItem(spacerItem6) self.horizontalLayout_7.addLayout(self.verticalLayout_6) self.verticalLayout_10.addLayout(self.horizontalLayout_7) self.tabWidget.addTab(self.tab, "") self.verticalLayout_3.addWidget(self.tabWidget) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") - spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_2.addItem(spacerItem8) + spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_2.addItem(spacerItem7) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.okButton = QtWidgets.QPushButton(ConfigurationDlg) @@ -271,16 +269,16 @@ def retranslateUi(self, ConfigurationDlg): self.restoreTabsCheckBox.setText(_translate("ConfigurationDlg", "Restore tabs on startup")) self.wrapLinesCheckBox.setText(_translate("ConfigurationDlg", "Wrap Lines")) self.showWrapSymbolCheckBox.setText(_translate("ConfigurationDlg", "Show Wrap Symbol")) - self.autocompletionCheckBox.setText(_translate("ConfigurationDlg", "Enable Autocompletion")) self.autoPairCharactersCheckBox.setToolTip(_translate("ConfigurationDlg", "Automatically insert matching closing quotes, parentheses, brackets, and braces")) self.autoPairCharactersCheckBox.setText(_translate("ConfigurationDlg", "Auto-pair quotes and brackets")) - self.autoSaveCheckBox.setToolTip(_translate("ConfigurationDlg", "Automatically save modified named files after a short delay")) - self.autoSaveCheckBox.setText(_translate("ConfigurationDlg", "Enable Auto-save")) self.quickTextDecodingCB.setToolTip(_translate("ConfigurationDlg", "Enable text decoding based on the first 1000 characters. This can be less accurate than full text scanning, but documents open faster.")) self.quickTextDecodingCB.setText(_translate("ConfigurationDlg", "Enable Quick Text Decoding")) + self.autoSaveCheckBox.setToolTip(_translate("ConfigurationDlg", "Automatically save modified named files after a short delay")) + self.autoSaveCheckBox.setText(_translate("ConfigurationDlg", "Enable Auto-save")) self.autoSaveIntervalLabel.setToolTip(_translate("ConfigurationDlg", "Delay in milliseconds after typing stops before autosave runs")) self.autoSaveIntervalLabel.setText(_translate("ConfigurationDlg", "Auto-save timeout (ms)")) self.autoSaveIntervalSpinBox.setToolTip(_translate("ConfigurationDlg", "Delay in milliseconds after typing stops before autosave runs")) + self.autocompletionCheckBox.setText(_translate("ConfigurationDlg", "Enable Autocompletion")) self.autocompletionLabel.setToolTip(_translate("ConfigurationDlg", "Determines minimum number of characters after which autocompletion options will be displayed")) self.autocompletionLabel.setText(_translate("ConfigurationDlg", "Autocompletion threshold")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.editingTab), _translate("ConfigurationDlg", "Editing"))