92 matchingPairs = ['()', '[]', '{}', '<>', "''", '""'] |
92 matchingPairs = ['()', '[]', '{}', '<>', "''", '""'] |
93 # __IGNORE_WARNING_M613__ |
93 # __IGNORE_WARNING_M613__ |
94 if text in matchingPairs: |
94 if text in matchingPairs: |
95 self.delete() |
95 self.delete() |
96 |
96 |
97 super(MiniScintilla, self).editorCommand(cmd) |
97 super().editorCommand(cmd) |
98 |
98 |
99 def keyPressEvent(self, ev): |
99 def keyPressEvent(self, ev): |
100 """ |
100 """ |
101 Protected method to handle the user input a key at a time. |
101 Protected method to handle the user input a key at a time. |
102 |
102 |
157 except AttributeError: |
157 except AttributeError: |
158 pass |
158 pass |
159 |
159 |
160 self.setCursorFlashTime(QApplication.cursorFlashTime()) |
160 self.setCursorFlashTime(QApplication.cursorFlashTime()) |
161 |
161 |
162 super(MiniScintilla, self).focusInEvent(event) |
162 super().focusInEvent(event) |
163 |
163 |
164 def focusOutEvent(self, event): |
164 def focusOutEvent(self, event): |
165 """ |
165 """ |
166 Protected method called when the editor loses focus. |
166 Protected method called when the editor loses focus. |
167 |
167 |
169 @type QFocusEvent |
169 @type QFocusEvent |
170 """ |
170 """ |
171 self.mw.editorActGrp.setEnabled(False) |
171 self.mw.editorActGrp.setEnabled(False) |
172 self.setCaretWidth(0) |
172 self.setCaretWidth(0) |
173 |
173 |
174 super(MiniScintilla, self).focusOutEvent(event) |
174 super().focusOutEvent(event) |
175 |
175 |
176 def removeTrailingWhitespace(self): |
176 def removeTrailingWhitespace(self): |
177 """ |
177 """ |
178 Public method to remove trailing whitespace. |
178 Public method to remove trailing whitespace. |
179 """ |
179 """ |
214 @param filename name of the file to open (string) |
214 @param filename name of the file to open (string) |
215 @param filetype type of the source file (string) |
215 @param filetype type of the source file (string) |
216 @param parent reference to the parent widget (QWidget) |
216 @param parent reference to the parent widget (QWidget) |
217 @param name object name of the window (string) |
217 @param name object name of the window (string) |
218 """ |
218 """ |
219 super(MiniEditor, self).__init__(parent) |
219 super().__init__(parent) |
220 if name is not None: |
220 if name is not None: |
221 self.setObjectName(name) |
221 self.setObjectName(name) |
222 self.setWindowIcon(UI.PixmapCache.getIcon("editor")) |
222 self.setWindowIcon(UI.PixmapCache.getIcon("editor")) |
223 |
223 |
224 self.setStyle(Preferences.getUI("Style"), |
224 self.setStyle(Preferences.getUI("Style"), |
2738 @type bool |
2738 @type bool |
2739 """ |
2739 """ |
2740 if "[*]" not in self.windowTitle(): |
2740 if "[*]" not in self.windowTitle(): |
2741 self.setWindowTitle(self.tr("[*] - {0}") |
2741 self.setWindowTitle(self.tr("[*] - {0}") |
2742 .format(self.tr("Mini Editor"))) |
2742 .format(self.tr("Mini Editor"))) |
2743 super(MiniEditor, self).setWindowModified(modified) |
2743 super().setWindowModified(modified) |
2744 |
2744 |
2745 def __setCurrentFile(self, fileName): |
2745 def __setCurrentFile(self, fileName): |
2746 """ |
2746 """ |
2747 Private method to register the file name of the current file. |
2747 Private method to register the file name of the current file. |
2748 |
2748 |