MiniEditor: ensure it has a correct window title when setting the 'modified' status

Tue, 13 Mar 2018 18:17:15 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 13 Mar 2018 18:17:15 +0100
changeset 6190
5ecba04d31f2
parent 6189
337eb6283a57
child 6191
bf6bd1ecfac7

MiniEditor: ensure it has a correct window title when setting the 'modified' status

QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
--- a/QScintilla/MiniEditor.py	Tue Mar 13 18:16:30 2018 +0100
+++ b/QScintilla/MiniEditor.py	Tue Mar 13 18:17:15 2018 +0100
@@ -2342,9 +2342,6 @@
         self.__textEdit.setText(txt)
         QApplication.restoreOverrideCursor()
         
-        self.__textEdit.setModified(modified)
-        self.setWindowModified(modified)
-        
         if filetype is None:
             self.filetype = ""
         else:
@@ -2434,6 +2431,18 @@
         
         return True
     
+    def setWindowModified(self, modified):
+        """
+        Public method to set the window modification status.
+        
+        @param modified flag indicating the modification status
+        @type bool
+        """
+        if "[*]" not in self.windowTitle():
+            self.setWindowTitle(self.tr("[*] - {0}")
+                                .format(self.tr("Mini Editor")))
+        super(MiniEditor, self).setWindowModified(modified)
+        
     def __setCurrentFile(self, fileName):
         """
         Private method to register the file name of the current file.

eric ide

mercurial