eric7/Project/Project.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8351
7d13e08ddb3f
child 8357
a081458cc57b
--- a/eric7/Project/Project.py	Sat May 22 17:01:51 2021 +0200
+++ b/eric7/Project/Project.py	Sat May 22 18:51:46 2021 +0200
@@ -26,18 +26,18 @@
 )
 from PyQt6.Qsci import QsciScintilla
 
-from E5Gui.E5Application import e5App
-from E5Gui import E5FileDialog, E5MessageBox
-from E5Gui.E5ListSelectionDialog import E5ListSelectionDialog
-from E5Gui.E5ProgressDialog import E5ProgressDialog
-from E5Gui.E5OverrideCursor import E5OverrideCursor, E5OverridenCursor
+from E5Gui.EricApplication import ericApp
+from E5Gui import EricFileDialog, EricMessageBox
+from E5Gui.EricListSelectionDialog import EricListSelectionDialog
+from E5Gui.EricProgressDialog import EricProgressDialog
+from E5Gui.EricOverrideCursor import EricOverrideCursor, EricOverridenCursor
 
 from Globals import recentNameProject
 
 import UI.PixmapCache
 from UI.NotificationWidget import NotificationTypes
 
-from E5Gui.E5Action import E5Action, createActionGroup
+from E5Gui.EricAction import EricAction, createActionGroup
 
 import Preferences
 import Utilities
@@ -361,7 +361,7 @@
         if progLanguages:
             for progLanguage in progLanguages:
                 if progLanguage not in self.__projectProgLanguages:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Registering Project Type"),
                         self.tr(
@@ -372,7 +372,7 @@
                     return
                 
                 if type_ in self.__projectProgLanguages[progLanguage]:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Registering Project Type"),
                         self.tr(
@@ -384,7 +384,7 @@
                     return
             
         if type_ in self.__projectTypes:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Registering Project Type"),
                 self.tr("""<p>The Project type <b>{0}</b> is already"""
@@ -805,7 +805,7 @@
         """
         if os.path.splitext(fn)[1] == ".epj":
             # new JSON based format
-            with E5OverrideCursor():
+            with EricOverrideCursor():
                 res = self.__projectFile.readFile(fn)
         else:
             # old XML based format
@@ -826,7 +826,7 @@
                     self.pdata["HASH"] = hashStr
                     self.setDirty(True)
             else:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Read Project File"),
                     self.tr(
@@ -914,7 +914,7 @@
         if fn is None:
             fn = self.pfile
         
-        with E5OverrideCursor():
+        with EricOverrideCursor():
             res = self.__projectFile.writeFile(fn)
         
         if res:
@@ -954,7 +954,7 @@
                     reader.readXML()
                     f.close()
                 else:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Read User Project Properties"),
                         self.tr(
@@ -971,7 +971,7 @@
         fn, ext = os.path.splitext(os.path.basename(self.pfile))
         fn = os.path.join(self.getProjectManagementDir(), '{0}.eqj'.format(fn))
         
-        with E5OverrideCursor():
+        with EricOverrideCursor():
             self.__userProjectFile.writeFile(fn)
     
     def __showContextMenuSession(self):
@@ -1004,7 +1004,7 @@
         """
         if self.pfile is None:
             if not quiet:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Read Project Session"),
                     self.tr("Please save the project first."))
@@ -1029,7 +1029,7 @@
                     f.close()
                 else:
                     if not quiet:
-                        E5MessageBox.critical(
+                        EricMessageBox.critical(
                             self.ui,
                             self.tr("Read project session"),
                             self.tr(
@@ -1047,7 +1047,7 @@
         """
         if self.pfile is None:
             if not quiet:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Save Project Session"),
                     self.tr("Please save the project first."))
@@ -1064,7 +1064,7 @@
         Private method to delete the session file.
         """
         if self.pfile is None:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Delete Project Session"),
                 self.tr("Please save the project first."))
@@ -1079,7 +1079,7 @@
                 try:
                     os.remove(fn)
                 except OSError:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Delete Project Session"),
                         self.tr(
@@ -1091,7 +1091,7 @@
         Private method to read in the project tasks file (.etj or .e6t).
         """
         if self.pfile is None:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Read Tasks"),
                 self.tr("Please save the project first."))
@@ -1115,7 +1115,7 @@
                     reader.readXML()
                     f.close()
                 else:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Read Tasks"),
                         self.tr(
@@ -1169,7 +1169,7 @@
         """
         if self.pfile is None:
             if not quiet:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Read Debugger Properties"),
                     self.tr("Please save the project first."))
@@ -1198,7 +1198,7 @@
                 self.debugPropertiesChanged = False
             else:
                 if not quiet:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Read Debugger Properties"),
                         self.tr(
@@ -1215,7 +1215,7 @@
         """
         if self.pfile is None:
             if not quiet:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Save Debugger Properties"),
                     self.tr("Please save the project first."))
@@ -1224,7 +1224,7 @@
         fn, ext = os.path.splitext(os.path.basename(self.pfile))
         fn = os.path.join(self.getProjectManagementDir(), '{0}.edj'.format(fn))
         
-        with E5OverrideCursor():
+        with EricOverrideCursor():
             self.__debuggerPropertiesFile.writeFile(fn)
     
     def __deleteDebugProperties(self):
@@ -1233,7 +1233,7 @@
         (.edj or .e4d).
         """
         if self.pfile is None:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Delete Debugger Properties"),
                 self.tr("Please save the project first."))
@@ -1248,7 +1248,7 @@
                 try:
                     os.remove(fn)
                 except OSError:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Delete Debugger Properties"),
                         self.tr(
@@ -1305,7 +1305,7 @@
         """
         if key == "INTERPRETER":
             return (
-                e5App().getObject("VirtualEnvManager")
+                ericApp().getObject("VirtualEnvManager")
                 .getVirtualenvInterpreter(self.debugProperties["VIRTUALENV"])
             )
         else:
@@ -1392,7 +1392,7 @@
         Public slot used to add a language to the project.
         """
         if not self.pdata["TRANSLATIONPATTERN"]:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Add Language"),
                 self.tr(
@@ -1494,7 +1494,7 @@
             if os.path.exists(fn):
                 s2t(fn)
         except OSError as err:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Delete translation"),
                 self.tr(
@@ -1516,7 +1516,7 @@
                 if os.path.exists(fn):
                     s2t(fn)
             except OSError as err:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Delete translation"),
                     self.tr(
@@ -1652,20 +1652,20 @@
                                 os.makedirs(target)
                                 
                             if os.path.exists(targetfile):
-                                res = E5MessageBox.yesNo(
+                                res = EricMessageBox.yesNo(
                                     self.ui,
                                     self.tr("Add file"),
                                     self.tr(
                                         "<p>The file <b>{0}</b> already"
                                         " exists.</p><p>Overwrite it?</p>")
                                     .format(targetfile),
-                                    icon=E5MessageBox.Warning)
+                                    icon=EricMessageBox.Warning)
                                 if not res:
                                     return  # don't overwrite
                                     
                             shutil.copy(fn, target)
                         except OSError as why:
-                            E5MessageBox.critical(
+                            EricMessageBox.critical(
                                 self.ui,
                                 self.tr("Add file"),
                                 self.tr(
@@ -1678,7 +1678,7 @@
                     self.appendFile(targetfile,
                                     isSource or fileTypeFilter == 'source')
             else:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Add file"),
                     self.tr("The target directory must not be empty."))
@@ -1709,7 +1709,7 @@
         
         if len(files) == 0:
             if not quiet:
-                E5MessageBox.information(
+                EricMessageBox.information(
                     self.ui,
                     self.tr("Add directory"),
                     self.tr(
@@ -1724,7 +1724,7 @@
             try:
                 os.makedirs(target)
             except OSError as why:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Add directory"),
                     self.tr(
@@ -1742,14 +1742,14 @@
             if not Utilities.samepath(target, source):
                 try:
                     if os.path.exists(targetfile):
-                        res = E5MessageBox.yesNo(
+                        res = EricMessageBox.yesNo(
                             self.ui,
                             self.tr("Add directory"),
                             self.tr(
                                 "<p>The file <b>{0}</b> already exists.</p>"
                                 "<p>Overwrite it?</p>")
                             .format(targetfile),
-                            icon=E5MessageBox.Warning)
+                            icon=EricMessageBox.Warning)
                         if not res:
                             continue
                             # don't overwrite, carry on with next file
@@ -1810,7 +1810,7 @@
         if dlg.exec() == QDialog.DialogCode.Accepted:
             filetype, source, target, recursive = dlg.getData()
             if target == '':
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Add directory"),
                     self.tr("The target directory must not be empty."))
@@ -1821,7 +1821,7 @@
                 return
             
             if source == '':
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Add directory"),
                     self.tr("The source directory must not be empty."))
@@ -1958,31 +1958,31 @@
         isSourceFile = fn in self.pdata["SOURCES"]
         
         if newfn is None:
-            newfn = E5FileDialog.getSaveFileName(
+            newfn = EricFileDialog.getSaveFileName(
                 None,
                 self.tr("Rename file"),
                 oldfn,
                 "",
-                E5FileDialog.DontConfirmOverwrite)
+                EricFileDialog.DontConfirmOverwrite)
             if not newfn:
                 return False
             newfn = Utilities.toNativeSeparators(newfn)
         
         if os.path.exists(newfn):
-            res = E5MessageBox.yesNo(
+            res = EricMessageBox.yesNo(
                 self.ui,
                 self.tr("Rename File"),
                 self.tr("""<p>The file <b>{0}</b> already exists."""
                         """ Overwrite it?</p>""")
                     .format(newfn),
-                icon=E5MessageBox.Warning)
+                icon=EricMessageBox.Warning)
             if not res:
                 return False
         
         try:
             os.rename(oldfn, newfn)
         except OSError as msg:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Rename File"),
                 self.tr(
@@ -2229,7 +2229,7 @@
                 for f in glob.glob(pat):
                     s2t(f)
         except OSError as err:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Delete file"),
                 self.tr(
@@ -2259,7 +2259,7 @@
             except ImportError:
                 shutil.rmtree(dn, True)
         except OSError as err:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Delete directory"),
                 self.tr(
@@ -2351,7 +2351,7 @@
                 try:
                     os.makedirs(self.ppath)
                 except OSError:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Create project directory"),
                         self.tr(
@@ -2416,7 +2416,7 @@
                     # create management directory if not present
                     self.createProjectManagementDir()
                 except OSError:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Create project management directory"),
                         self.tr(
@@ -2437,7 +2437,7 @@
                             with open(ms, "w"):
                                 pass
                         except OSError as err:
-                            E5MessageBox.critical(
+                            EricMessageBox.critical(
                                 self.ui,
                                 self.tr("Create main script"),
                                 self.tr(
@@ -2461,7 +2461,7 @@
                             with open(mf, "w"):
                                 pass
                         except OSError as err:
-                            E5MessageBox.critical(
+                            EricMessageBox.critical(
                                 self.ui,
                                 self.tr("Create Makefile"),
                                 self.tr(
@@ -2471,7 +2471,7 @@
                     self.appendFile(mf)
                 
                 # add existing files to the project
-                res = E5MessageBox.yesNo(
+                res = EricMessageBox.yesNo(
                     self.ui,
                     self.tr("New Project"),
                     self.tr("""Add existing files to the project?"""),
@@ -2493,7 +2493,7 @@
                 
                 # check, if the existing project directory is already under
                 # VCS control
-                pluginManager = e5App().getObject("PluginManager")
+                pluginManager = ericApp().getObject("PluginManager")
                 for indicator, vcsData in list(
                         pluginManager.getVcsSystemIndicators().items()):
                     if os.path.exists(os.path.join(self.ppath, indicator)):
@@ -2524,7 +2524,7 @@
                         if self.vcs is not None:
                             # edit VCS command options
                             if self.vcs.vcsSupportCommandOptions():
-                                vcores = E5MessageBox.yesNo(
+                                vcores = EricMessageBox.yesNo(
                                     self.ui,
                                     self.tr("New Project"),
                                     self.tr(
@@ -2541,7 +2541,7 @@
                                     self.vcs.vcsSetOptions(codlg.getOptions())
                             # add project file to repository
                             if res == 0:
-                                apres = E5MessageBox.yesNo(
+                                apres = EricMessageBox.yesNo(
                                     self.ui,
                                     self.tr("New project"),
                                     self.tr(
@@ -2563,7 +2563,7 @@
                 self.vcsRequested
             ):
                 vcsSystemsDict = (
-                    e5App().getObject("PluginManager")
+                    ericApp().getObject("PluginManager")
                     .getPluginDisplayStrings("version_control")
                 )
                 vcsSystemsDisplay = [self.tr("None")]
@@ -2598,7 +2598,7 @@
                 if self.vcs is not None:
                     # edit VCS command options
                     if self.vcs.vcsSupportCommandOptions():
-                        vcores = E5MessageBox.yesNo(
+                        vcores = EricMessageBox.yesNo(
                             self.ui,
                             self.tr("New Project"),
                             self.tr(
@@ -2636,7 +2636,7 @@
         # Show the file type associations for the user to change
         self.__showFiletypeAssociations()
         
-        with E5OverrideCursor():
+        with EricOverrideCursor():
             # search the project directory for files with known extensions
             filespecs = list(self.pdata["FILETYPES"].keys())
             for filespec in filespecs:
@@ -2752,7 +2752,7 @@
                         with open(mf, "w"):
                             pass
                     except OSError as err:
-                        E5MessageBox.critical(
+                        EricMessageBox.critical(
                             self.ui,
                             self.tr("Create Makefile"),
                             self.tr(
@@ -2819,7 +2819,7 @@
                     self.vcs.vcsShutdown()
                     self.vcs.deleteLater()
                     self.vcs = None
-                    e5App().getObject("PluginManager").deactivateVcsPlugins()
+                    ericApp().getObject("PluginManager").deactivateVcsPlugins()
                 # reinit VCS
                 self.vcs = self.initVCS()
                 # start the VCS monitor thread
@@ -2915,7 +2915,7 @@
             return
         
         if fn is None:
-            fn = E5FileDialog.getOpenFileName(
+            fn = EricFileDialog.getOpenFileName(
                 self.parent(),
                 self.tr("Open project"),
                 Preferences.getMultiProject("Workspace") or
@@ -2925,7 +2925,7 @@
         QApplication.processEvents()
         
         if fn and self.closeProject():
-            with E5OverrideCursor():
+            with EricOverrideCursor():
                 ok = self.__readProject(fn)
             if ok:
                 self.opened = True
@@ -2938,7 +2938,7 @@
                     # create management directory if not present
                     self.createProjectManagementDir()
                 except OSError:
-                    E5MessageBox.critical(
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Create project management directory"),
                         self.tr(
@@ -2950,12 +2950,12 @@
                 # read a user specific project file
                 self.__readUserProperties()
                 
-                with E5OverrideCursor():
+                with EricOverrideCursor():
                     oldState = self.isDirty()
                     self.vcs = self.initVCS()
                     if self.vcs is None and self.isDirty() == oldState:
                         # check, if project is version controlled
-                        pluginManager = e5App().getObject("PluginManager")
+                        pluginManager = ericApp().getObject("PluginManager")
                         for indicator, vcsData in (
                             pluginManager.getVcsSystemIndicators().items()
                         ):
@@ -2967,7 +2967,7 @@
                                         _vcsSystemStr, vcsSystemDisplay
                                     ) in vcsData:
                                         vcsList.append(vcsSystemDisplay)
-                                    with E5OverridenCursor():
+                                    with EricOverridenCursor():
                                         res, vcs_ok = QInputDialog.getItem(
                                             None,
                                             self.tr("New Project"),
@@ -3041,7 +3041,7 @@
                 self.ui.taskViewer.setProjectOpen(True)
                 # rescan project tasks
                 if Preferences.getProject("TasksProjectRescanOnOpen"):
-                    e5App().getObject("TaskViewer"
+                    ericApp().getObject("TaskViewer"
                                       ).regenerateProjectTasks(quiet=True)
                 
                 if restoreSession:
@@ -3114,13 +3114,13 @@
             (Preferences.getMultiProject("Workspace") or
              Utilities.getHomeDir())
         )
-        fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
+        fn, selectedFilter = EricFileDialog.getSaveFileNameAndFilter(
             self.parent(),
             self.tr("Save Project"),
             defaultPath,
             self.tr("Project Files (*.epj)"),
             defaultFilter,
-            E5FileDialog.DontConfirmOverwrite)
+            EricFileDialog.DontConfirmOverwrite)
         
         if fn:
             ext = QFileInfo(fn).suffix()
@@ -3129,12 +3129,12 @@
                 if ex:
                     fn += ex
             if QFileInfo(fn).exists():
-                res = E5MessageBox.yesNo(
+                res = EricMessageBox.yesNo(
                     self.ui,
                     self.tr("Save File"),
                     self.tr("""<p>The file <b>{0}</b> already exists."""
                             """ Overwrite it?</p>""").format(fn),
-                    icon=E5MessageBox.Warning)
+                    icon=EricMessageBox.Warning)
                 if not res:
                     return False
                 
@@ -3165,7 +3165,7 @@
         @return flag indicating whether this operation was successful (boolean)
         """
         if self.isDirty():
-            res = E5MessageBox.okToClearData(
+            res = EricMessageBox.okToClearData(
                 self.parent(),
                 self.tr("Close Project"),
                 self.tr("The current project has unsaved changes."),
@@ -3204,7 +3204,7 @@
         if not self.checkDirty():
             return False
         
-        e5App().getObject("TaskViewer").stopProjectTaskExtraction()
+        ericApp().getObject("TaskViewer").stopProjectTaskExtraction()
         
         # save the user project properties
         if not noSave:
@@ -3224,7 +3224,7 @@
         ):
             self.__writeDebugProperties(True)
         
-        vm = e5App().getObject("ViewManager")
+        vm = ericApp().getObject("ViewManager")
         
         # check dirty status of all project files first
         for fn in vm.getOpenFilenames():
@@ -3257,7 +3257,7 @@
             self.vcs.vcsShutdown()
             self.vcs.deleteLater()
             self.vcs = None
-            e5App().getObject("PluginManager").deactivateVcsPlugins()
+            ericApp().getObject("PluginManager").deactivateVcsPlugins()
         
         # now close all project related tool windows
         self.__closeAllWindows()
@@ -3298,7 +3298,7 @@
             for syntax errors (boolean)
         @return flag indicating success (boolean)
         """
-        vm = e5App().getObject("ViewManager")
+        vm = ericApp().getObject("ViewManager")
         success = True
         filesWithSyntaxErrors = 0
         for fn in vm.getOpenFilenames():
@@ -3310,7 +3310,7 @@
                     filesWithSyntaxErrors += 1
         
         if reportSyntaxErrors and filesWithSyntaxErrors > 0:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Syntax errors detected"),
                 self.tr(
@@ -3330,7 +3330,7 @@
             for syntax errors (boolean)
         @return flag indicating success (boolean)
         """
-        vm = e5App().getObject("ViewManager")
+        vm = ericApp().getObject("ViewManager")
         success = True
         filesWithSyntaxErrors = 0
         for fn in vm.getOpenFilenames():
@@ -3342,7 +3342,7 @@
                     filesWithSyntaxErrors += 1
         
         if reportSyntaxErrors and filesWithSyntaxErrors > 0:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Syntax errors detected"),
                 self.tr(
@@ -3828,7 +3828,7 @@
         
         self.actGrp1 = createActionGroup(self)
         
-        act = E5Action(
+        act = EricAction(
             self.tr('New project'),
             UI.PixmapCache.getIcon("projectNew"),
             self.tr('&New...'), 0, 0,
@@ -3842,7 +3842,7 @@
         act.triggered.connect(self.createNewProject)
         self.actions.append(act)
 
-        act = E5Action(
+        act = EricAction(
             self.tr('Open project'),
             UI.PixmapCache.getIcon("projectOpen"),
             self.tr('&Open...'), 0, 0,
@@ -3855,7 +3855,7 @@
         act.triggered.connect(self.openProject)
         self.actions.append(act)
 
-        self.closeAct = E5Action(
+        self.closeAct = EricAction(
             self.tr('Close project'),
             UI.PixmapCache.getIcon("projectClose"),
             self.tr('&Close'), 0, 0, self, 'project_close')
@@ -3867,7 +3867,7 @@
         self.closeAct.triggered.connect(self.closeProject)
         self.actions.append(self.closeAct)
 
-        self.saveAct = E5Action(
+        self.saveAct = EricAction(
             self.tr('Save project'),
             UI.PixmapCache.getIcon("projectSave"),
             self.tr('&Save'), 0, 0, self, 'project_save')
@@ -3879,7 +3879,7 @@
         self.saveAct.triggered.connect(self.saveProject)
         self.actions.append(self.saveAct)
 
-        self.saveasAct = E5Action(
+        self.saveasAct = EricAction(
             self.tr('Save project as'),
             UI.PixmapCache.getIcon("projectSaveAs"),
             self.tr('Save &as...'), 0, 0, self, 'project_save_as')
@@ -3894,7 +3894,7 @@
 
         self.actGrp2 = createActionGroup(self)
         
-        self.addFilesAct = E5Action(
+        self.addFilesAct = EricAction(
             self.tr('Add files to project'),
             UI.PixmapCache.getIcon("fileMisc"),
             self.tr('Add &files...'), 0, 0,
@@ -3910,7 +3910,7 @@
         self.addFilesAct.triggered.connect(self.addFiles)
         self.actions.append(self.addFilesAct)
 
-        self.addDirectoryAct = E5Action(
+        self.addDirectoryAct = EricAction(
             self.tr('Add directory to project'),
             UI.PixmapCache.getIcon("dirOpen"),
             self.tr('Add directory...'), 0, 0,
@@ -3925,7 +3925,7 @@
         self.addDirectoryAct.triggered.connect(self.addDirectory)
         self.actions.append(self.addDirectoryAct)
 
-        self.addLanguageAct = E5Action(
+        self.addLanguageAct = EricAction(
             self.tr('Add translation to project'),
             UI.PixmapCache.getIcon("linguist4"),
             self.tr('Add &translation...'), 0, 0,
@@ -3940,7 +3940,7 @@
         self.addLanguageAct.triggered.connect(self.addLanguage)
         self.actions.append(self.addLanguageAct)
 
-        act = E5Action(
+        act = EricAction(
             self.tr('Search new files'),
             self.tr('Searc&h new files...'), 0, 0,
             self.actGrp2, 'project_search_new_files')
@@ -3955,7 +3955,7 @@
         act.triggered.connect(self.__searchNewFiles)
         self.actions.append(act)
 
-        act = E5Action(
+        act = EricAction(
             self.tr('Search Project File'),
             self.tr('Search Project File...'),
             QKeySequence(self.tr("Alt+Ctrl+P", "Project|Search Project File")),
@@ -3970,7 +3970,7 @@
         act.triggered.connect(self.__searchProjectFile)
         self.actions.append(act)
         
-        self.propsAct = E5Action(
+        self.propsAct = EricAction(
             self.tr('Project properties'),
             UI.PixmapCache.getIcon("projectProps"),
             self.tr('&Properties...'), 0, 0, self,
@@ -3983,7 +3983,7 @@
         self.propsAct.triggered.connect(self.__showProperties)
         self.actions.append(self.propsAct)
 
-        self.userPropsAct = E5Action(
+        self.userPropsAct = EricAction(
             self.tr('User project properties'),
             UI.PixmapCache.getIcon("projectUserProps"),
             self.tr('&User Properties...'), 0, 0, self,
@@ -3998,7 +3998,7 @@
         self.userPropsAct.triggered.connect(self.__showUserProperties)
         self.actions.append(self.userPropsAct)
 
-        self.filetypesAct = E5Action(
+        self.filetypesAct = EricAction(
             self.tr('Filetype Associations'),
             self.tr('Filetype Associations...'), 0, 0,
             self, 'project_filetype_associations')
@@ -4016,7 +4016,7 @@
             self.__showFiletypeAssociations)
         self.actions.append(self.filetypesAct)
 
-        self.lexersAct = E5Action(
+        self.lexersAct = EricAction(
             self.tr('Lexer Associations'),
             self.tr('Lexer Associations...'), 0, 0,
             self, 'project_lexer_associations')
@@ -4034,7 +4034,7 @@
 
         self.dbgActGrp = createActionGroup(self)
         
-        act = E5Action(
+        act = EricAction(
             self.tr('Debugger Properties'),
             self.tr('Debugger &Properties...'), 0, 0,
             self.dbgActGrp, 'project_debugger_properties')
@@ -4047,7 +4047,7 @@
         act.triggered.connect(self.__showDebugProperties)
         self.actions.append(act)
         
-        act = E5Action(
+        act = EricAction(
             self.tr('Load'),
             self.tr('&Load'), 0, 0,
             self.dbgActGrp, 'project_debugger_properties_load')
@@ -4059,7 +4059,7 @@
         act.triggered.connect(self.__readDebugProperties)
         self.actions.append(act)
         
-        act = E5Action(
+        act = EricAction(
             self.tr('Save'),
             self.tr('&Save'), 0, 0,
             self.dbgActGrp, 'project_debugger_properties_save')
@@ -4071,7 +4071,7 @@
         act.triggered.connect(self.__writeDebugProperties)
         self.actions.append(act)
         
-        act = E5Action(
+        act = EricAction(
             self.tr('Delete'),
             self.tr('&Delete'), 0, 0,
             self.dbgActGrp, 'project_debugger_properties_delete')
@@ -4084,7 +4084,7 @@
         act.triggered.connect(self.__deleteDebugProperties)
         self.actions.append(act)
         
-        act = E5Action(
+        act = EricAction(
             self.tr('Reset'),
             self.tr('&Reset'), 0, 0,
             self.dbgActGrp, 'project_debugger_properties_resets')
@@ -4098,7 +4098,7 @@
         
         self.sessActGrp = createActionGroup(self)
 
-        act = E5Action(
+        act = EricAction(
             self.tr('Load session'),
             self.tr('Load session'), 0, 0,
             self.sessActGrp, 'project_load_session')
@@ -4116,7 +4116,7 @@
         act.triggered.connect(self.__readSession)
         self.actions.append(act)
 
-        act = E5Action(
+        act = EricAction(
             self.tr('Save session'),
             self.tr('Save session'), 0, 0,
             self.sessActGrp, 'project_save_session')
@@ -4134,7 +4134,7 @@
         act.triggered.connect(self.__writeSession)
         self.actions.append(act)
         
-        act = E5Action(
+        act = EricAction(
             self.tr('Delete session'),
             self.tr('Delete session'), 0, 0,
             self.sessActGrp, 'project_delete_session')
@@ -4148,7 +4148,7 @@
         
         self.chkGrp = createActionGroup(self)
 
-        self.codeMetricsAct = E5Action(
+        self.codeMetricsAct = EricAction(
             self.tr('Code Metrics'),
             self.tr('&Code Metrics...'), 0, 0,
             self.chkGrp, 'project_code_metrics')
@@ -4162,7 +4162,7 @@
         self.codeMetricsAct.triggered.connect(self.__showCodeMetrics)
         self.actions.append(self.codeMetricsAct)
 
-        self.codeCoverageAct = E5Action(
+        self.codeCoverageAct = EricAction(
             self.tr('Python Code Coverage'),
             self.tr('Code Co&verage...'), 0, 0,
             self.chkGrp, 'project_code_coverage')
@@ -4176,7 +4176,7 @@
         self.codeCoverageAct.triggered.connect(self.__showCodeCoverage)
         self.actions.append(self.codeCoverageAct)
 
-        self.codeProfileAct = E5Action(
+        self.codeProfileAct = EricAction(
             self.tr('Profile Data'),
             self.tr('&Profile Data...'), 0, 0,
             self.chkGrp, 'project_profile_data')
@@ -4191,7 +4191,7 @@
 
         self.graphicsGrp = createActionGroup(self)
 
-        self.applicationDiagramAct = E5Action(
+        self.applicationDiagramAct = EricAction(
             self.tr('Application Diagram'),
             self.tr('&Application Diagram...'), 0, 0,
             self.graphicsGrp, 'project_application_diagram')
@@ -4205,7 +4205,7 @@
             self.handleApplicationDiagram)
         self.actions.append(self.applicationDiagramAct)
 
-        self.loadDiagramAct = E5Action(
+        self.loadDiagramAct = EricAction(
             self.tr('Load Diagram'),
             self.tr('&Load Diagram...'), 0, 0,
             self.graphicsGrp, 'project_load_diagram')
@@ -4220,7 +4220,7 @@
 
         self.pluginGrp = createActionGroup(self)
 
-        self.pluginPkgListAct = E5Action(
+        self.pluginPkgListAct = EricAction(
             self.tr('Create Package List'),
             UI.PixmapCache.getIcon("pluginArchiveList"),
             self.tr('Create &Package List'), 0, 0,
@@ -4236,7 +4236,7 @@
         self.pluginPkgListAct.triggered.connect(self.__pluginCreatePkgList)
         self.actions.append(self.pluginPkgListAct)
 
-        self.pluginArchiveAct = E5Action(
+        self.pluginArchiveAct = EricAction(
             self.tr('Create Plugin Archives'),
             UI.PixmapCache.getIcon("pluginArchive"),
             self.tr('Create Plugin &Archives'), 0, 0,
@@ -4253,7 +4253,7 @@
         self.pluginArchiveAct.triggered.connect(self.__pluginCreateArchives)
         self.actions.append(self.pluginArchiveAct)
     
-        self.pluginSArchiveAct = E5Action(
+        self.pluginSArchiveAct = EricAction(
             self.tr('Create Plugin Archives (Snapshot)'),
             UI.PixmapCache.getIcon("pluginArchiveSnapshot"),
             self.tr('Create Plugin Archives (&Snapshot)'), 0, 0,
@@ -4274,7 +4274,7 @@
 
         self.makeGrp = createActionGroup(self)
 
-        self.makeExecuteAct = E5Action(
+        self.makeExecuteAct = EricAction(
             self.tr('Execute Make'),
             self.tr('&Execute Make'), 0, 0,
             self.makeGrp, 'project_make_execute')
@@ -4288,7 +4288,7 @@
         self.makeExecuteAct.triggered.connect(self.__executeMake)
         self.actions.append(self.makeExecuteAct)
 
-        self.makeTestAct = E5Action(
+        self.makeTestAct = EricAction(
             self.tr('Test for Changes'),
             self.tr('&Test for Changes'), 0, 0,
             self.makeGrp, 'project_make_test')
@@ -4456,7 +4456,7 @@
         toolbar.
         
         @param toolbarManager reference to a toolbar manager object
-            (E5ToolBarManager)
+            (EricToolBarManager)
         @return tuple of the generated toolbars (tuple of two QToolBar)
         """
         tb = QToolBar(self.tr("Project"), self.ui)
@@ -4683,7 +4683,7 @@
         # if newfiles is empty, put up message box informing user nothing found
         if not newFiles:
             if onUserDemand:
-                E5MessageBox.information(
+                EricMessageBox.information(
                     self.ui,
                     self.tr("Search New Files"),
                     self.tr("There were no new files found to be added."))
@@ -4721,23 +4721,23 @@
         """
         Public method to get a list of all actions.
         
-        @return list of all actions (list of E5Action)
+        @return list of all actions (list of EricAction)
         """
         return self.actions[:]
         
-    def addE5Actions(self, actions):
+    def addEricActions(self, actions):
         """
         Public method to add actions to the list of actions.
         
-        @param actions list of actions (list of E5Action)
+        @param actions list of actions (list of EricAction)
         """
         self.actions.extend(actions)
         
-    def removeE5Actions(self, actions):
+    def removeEricActions(self, actions):
         """
         Public method to remove actions from the list of actions.
         
-        @param actions list of actions (list of E5Action)
+        @param actions list of actions (list of EricAction)
         """
         for act in actions:
             with contextlib.suppress(ValueError):
@@ -4764,7 +4764,7 @@
         if not self.isOpen():
             return
         
-        with E5OverrideCursor():
+        with EricOverrideCursor():
             name = self.getRelativePath(fullname)
             self.prepareRepopulateItem.emit(name)
             self.__model.repopulateItem(name)
@@ -4818,8 +4818,8 @@
             if not vcsExists:
                 if override:
                     # override failed, revert to original
-                    with E5OverridenCursor():
-                        E5MessageBox.critical(
+                    with EricOverridenCursor():
+                        EricMessageBox.critical(
                             self.ui,
                             self.tr("Version Control System"),
                             self.tr(
@@ -4830,8 +4830,8 @@
                         self.pudata["VCSOVERRIDE"] = ""
                     return self.initVCS(nooverride=True)
                 
-                with E5OverridenCursor():
-                    E5MessageBox.critical(
+                with EricOverridenCursor():
+                    EricMessageBox.critical(
                         self.ui,
                         self.tr("Version Control System"),
                         self.tr(
@@ -4876,7 +4876,7 @@
         """
         self.pdata["VCS"] = 'None'
         self.vcs = self.initVCS()
-        e5App().getObject("PluginManager").deactivateVcsPlugins()
+        ericApp().getObject("PluginManager").deactivateVcsPlugins()
     
     def __showContextMenuVCS(self):
         """
@@ -4894,7 +4894,7 @@
         @return flag indicating availability of VCS software (boolean)
         """
         vcsSystemsDict = (
-            e5App().getObject("PluginManager")
+            ericApp().getObject("PluginManager")
             .getPluginDisplayStrings("version_control")
         )
         return len(vcsSystemsDict) != 0
@@ -4957,7 +4957,7 @@
         """
         fn = self.getMainScript(True)
         if fn is None:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Coverage Data"),
                 self.tr(
@@ -5007,7 +5007,7 @@
         """
         fn = self.getMainScript(True)
         if fn is None:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Profile Data"),
                 self.tr(
@@ -5084,7 +5084,7 @@
         """
         Public method to handle the application diagram context menu action.
         """
-        res = E5MessageBox.yesNo(
+        res = EricMessageBox.yesNo(
             self.ui,
             self.tr("Application Diagram"),
             self.tr("""Include module names?"""),
@@ -5229,13 +5229,13 @@
         """
         pkglist = os.path.join(self.ppath, "PKGLIST")
         if os.path.exists(pkglist):
-            res = E5MessageBox.yesNo(
+            res = EricMessageBox.yesNo(
                 self.ui,
                 self.tr("Create Package List"),
                 self.tr(
                     "<p>The file <b>PKGLIST</b> already"
                     " exists.</p><p>Overwrite it?</p>"),
-                icon=E5MessageBox.Warning)
+                icon=EricMessageBox.Warning)
             if not res:
                 return  # don't overwrite
         
@@ -5277,7 +5277,7 @@
                 pkglistFile.write("\n")
                 # ensure the file ends with an empty line
         except OSError as why:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Create Package List"),
                 self.tr(
@@ -5296,7 +5296,7 @@
         @param snapshot flag indicating snapshot archives (boolean)
         """
         if not self.pdata["MAINSCRIPT"]:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Create Plugin Archive"),
                 self.tr(
@@ -5310,7 +5310,7 @@
         if len(pkglists) == 1:
             selectedLists = [os.path.join(self.ppath, pkglists[0])]
         elif len(pkglists) > 1:
-            dlg = E5ListSelectionDialog(
+            dlg = EricListSelectionDialog(
                 sorted(pkglists), title=self.tr("Create Plugin Archive"),
                 message=self.tr("Select package lists:"),
                 checkBoxSelection=True)
@@ -5321,14 +5321,14 @@
                 return
         
         if not selectedLists:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Create Plugin Archive"),
                 self.tr("""<p>No package list files (PKGLIST*) available or"""
                         """ selected. Aborting...</p>"""))
             return
         
-        progress = E5ProgressDialog(
+        progress = EricProgressDialog(
             self.tr("Creating plugin archives..."), self.tr("Abort"),
             0, len(selectedLists), self.tr("%v/%m Archives"))
         progress.setMinimumDuration(0)
@@ -5343,7 +5343,7 @@
                 with open(pkglist, "r", encoding="utf-8") as pkglistFile:
                     names = pkglistFile.read()
             except OSError as why:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Create Plugin Archive"),
                     self.tr(
@@ -5370,7 +5370,7 @@
                     elif line.startswith("archive_version="):
                         archiveVersion = line.split("=")[1]
                     elif line.startswith("initial_list "):
-                        E5MessageBox.critical(
+                        EricMessageBox.critical(
                             self.ui,
                             self.tr("Create Plugin Archive"),
                             self.tr(
@@ -5397,7 +5397,7 @@
             try:
                 archiveFile = zipfile.ZipFile(archive, "w")
             except OSError as why:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Create Plugin Archive"),
                     self.tr(
@@ -5432,7 +5432,7 @@
                                 ):
                                     version = archiveVersion
                     except OSError as why:
-                        E5MessageBox.critical(
+                        EricMessageBox.critical(
                             self.ui,
                             self.tr("Create Plugin Archive"),
                             self.tr(
@@ -5501,7 +5501,7 @@
             sourcelines, encoding = Utilities.readEncodedFile(filename)
             sourcelines = sourcelines.splitlines(True)
         except (OSError, UnicodeError) as why:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Create Plugin Archive"),
                 self.tr("""<p>The plugin file <b>{0}</b> could """
@@ -5542,7 +5542,7 @@
             sourcelines = Utilities.readEncodedFile(filename)[0]
             sourcelines = sourcelines.splitlines(True)
         except (OSError, UnicodeError) as why:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Create Plugin Archive"),
                 self.tr(
@@ -5657,7 +5657,7 @@
         self.__makeProcess.start(prog, args)
         
         if not self.__makeProcess.waitForStarted():
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Execute Make"),
                 self.tr("""The make process did not start."""))
@@ -5702,7 +5702,7 @@
         @type bool
         """
         if exitStatus == QProcess.ExitStatus.CrashExit:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.ui,
                 self.tr("Execute Make"),
                 self.tr("""The make process crashed."""))
@@ -5728,7 +5728,7 @@
                     kind=NotificationTypes.WARNING,
                     timeout=0)
             elif exitCode > 1:
-                E5MessageBox.critical(
+                EricMessageBox.critical(
                     self.ui,
                     self.tr("Execute Make"),
                     self.tr("""The makefile contains errors."""))

eric ide

mercurial