src/eric7/QScintilla/Editor.py

branch
eric7
changeset 9517
d73c3a1e432b
parent 9482
a2bc06a54d9d
child 9535
8b5402794fb6
--- a/src/eric7/QScintilla/Editor.py	Wed Nov 16 18:11:52 2022 +0100
+++ b/src/eric7/QScintilla/Editor.py	Thu Nov 17 18:11:42 2022 +0100
@@ -605,7 +605,7 @@
         if (
             self.fileName
             and self.project.isOpen()
-            and self.project.isProjectSource(self.fileName)
+            and self.project.isProjectCategory(self.fileName, "SOURCES")
         ):
             self.project.projectPropertiesChanged.connect(
                 self.__projectPropertiesChanged
@@ -5716,7 +5716,9 @@
         coEnable = False
 
         # first check if the file belongs to a project
-        if self.project.isOpen() and self.project.isProjectSource(self.fileName):
+        if self.project.isOpen() and self.project.isProjectCategory(
+            self.fileName, "SOURCES"
+        ):
             fn = self.project.getMainScript(True)
             if fn is not None:
                 prEnable = self.project.isPy3Project() and bool(
@@ -5756,7 +5758,9 @@
         Private slot handling the aboutToShow signal of the diagrams context
         menu.
         """
-        if self.project.isOpen() and self.project.isProjectSource(self.fileName):
+        if self.project.isOpen() and self.project.isProjectCategory(
+            self.fileName, "SOURCES"
+        ):
             self.applicationDiagramMenuAct.setEnabled(True)
         else:
             self.applicationDiagramMenuAct.setEnabled(False)
@@ -6140,7 +6144,9 @@
 
         # first check if the file belongs to a project and there is
         # a project coverage file
-        if self.project.isOpen() and self.project.isProjectSource(self.fileName):
+        if self.project.isOpen() and self.project.isProjectCategory(
+            self.fileName, "SOURCES"
+        ):
             pfn = self.project.getMainScript(True)
             if pfn is not None:
                 files |= set(Utilities.getCoverageFileNames(pfn))
@@ -6317,7 +6323,9 @@
 
         # first check if the file belongs to a project and there is
         # a project profile file
-        if self.project.isOpen() and self.project.isProjectSource(self.fileName):
+        if self.project.isOpen() and self.project.isProjectCategory(
+            self.fileName, "SOURCES"
+        ):
             fn = self.project.getMainScript(True)
             if fn is not None:
                 files |= set(Utilities.getProfileFileNames(fn))
@@ -7907,7 +7915,7 @@
         """
         Public slot to handle the opening of a project.
         """
-        if self.fileName and self.project.isProjectSource(self.fileName):
+        if self.fileName and self.project.isProjectCategory(self.fileName, "SOURCES"):
             self.project.projectPropertiesChanged.connect(
                 self.__projectPropertiesChanged
             )
@@ -7980,7 +7988,7 @@
         if (
             self.fileName
             and self.project.isOpen()
-            and self.project.isProjectSource(self.fileName)
+            and self.project.isProjectCategory(self.fileName, "SOURCES")
         ):
             pwl, pel = self.project.getProjectDictionaries()
             self.__setSpellingLanguage(
@@ -9103,7 +9111,7 @@
             withProject = (
                 self.fileName
                 and self.project.isOpen()
-                and self.project.isProjectSource(self.fileName)
+                and self.project.isProjectCategory(self.fileName, "SOURCES")
             )
             dlg = BlackConfigurationDialog(withProject=withProject)
             if dlg.exec() == QDialog.DialogCode.Accepted:
@@ -9139,7 +9147,7 @@
             withProject = (
                 self.fileName
                 and self.project.isOpen()
-                and self.project.isProjectSource(self.fileName)
+                and self.project.isProjectCategory(self.fileName, "SOURCES")
             )
             dlg = IsortConfigurationDialog(withProject=withProject)
             if dlg.exec() == QDialog.DialogCode.Accepted:

eric ide

mercurial