src/eric7/Plugins/ViewManagerPlugins/Tabview/Tabview.py

branch
eric7
changeset 9758
6d24ab9c0404
parent 9653
e67609152c5e
child 10069
435cc5875135
--- a/src/eric7/Plugins/ViewManagerPlugins/Tabview/Tabview.py	Mon Feb 13 17:51:03 2023 +0100
+++ b/src/eric7/Plugins/ViewManagerPlugins/Tabview/Tabview.py	Mon Feb 13 17:52:26 2023 +0100
@@ -488,7 +488,7 @@
             maxFileNameChars = Preferences.getUI("TabViewManagerFilenameLength")
             if len(txt) > maxFileNameChars:
                 txt = "...{0}".format(txt[-maxFileNameChars:])
-            if editor.isReadOnly():
+            if editor.checkReadOnly():
                 txt = self.tr("{0} (ro)").format(txt)
 
             assembly = editor.parent()
@@ -1052,7 +1052,7 @@
                 txt = ericApp().getObject("Project").getRelativePath(fn)
             if len(txt) > self.maxFileNameChars:
                 txt = "...{0}".format(txt[-self.maxFileNameChars :])
-            if not os.access(fn, os.W_OK):
+            if editor.checkReadOnly():
                 txt = self.tr("{0} (ro)").format(txt)
             if addNext:
                 index = self.currentTabWidget.currentIndex() + 1
@@ -1107,7 +1107,7 @@
                 txt = ericApp().getObject("Project").getRelativePath(fn)
             if len(txt) > self.maxFileNameChars:
                 txt = "...{0}".format(txt[-self.maxFileNameChars :])
-            if not os.access(fn, os.W_OK):
+            if editor.checkReadOnly():
                 txt = self.tr("{0} (ro)").format(txt)
             nindex = tabWidget.insertWidget(index, win, txt)
             tabWidget.setTabToolTip(nindex, fn)
@@ -1498,7 +1498,7 @@
                             txt = ericApp().getObject("Project").getRelativePath(fn)
                         if len(txt) > self.maxFileNameChars:
                             txt = "...{0}".format(txt[-self.maxFileNameChars :])
-                        if not os.access(fn, os.W_OK):
+                        if editor.checkReadOnly():
                             txt = self.tr("{0} (ro)").format(txt)
                         tabWidget.setTabText(index, txt)
 

eric ide

mercurial