eric7/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8322
b422b4e77d19
child 8358
144a6b854f70
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat May 22 17:01:51 2021 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat May 22 18:51:46 2021 +0200
@@ -21,9 +21,9 @@
     QLineEdit, QMenu, QInputDialog
 )
 
-from E5Gui.E5Application import e5App
-from E5Gui import E5MessageBox, E5FileDialog
-from E5Gui.E5OverrideCursor import E5OverrideCursor
+from E5Gui.EricApplication import ericApp
+from E5Gui import EricMessageBox, EricFileDialog
+from E5Gui.EricOverrideCursor import EricOverrideCursor
 
 from .Ui_HgLogBrowserDialog import Ui_HgLogBrowserDialog
 
@@ -230,7 +230,7 @@
         self.__logTreeNormalFont.setBold(False)
         self.__logTreeBoldFont = self.logTree.font()
         self.__logTreeBoldFont.setBold(True)
-        self.__logTreeHasDarkBackground = e5App().usesDarkPalette()
+        self.__logTreeHasDarkBackground = ericApp().usesDarkPalette()
         
         self.detailsEdit.anchorClicked.connect(self.__revisionClicked)
         
@@ -762,7 +762,7 @@
         output, errMsg = self.__hgClient.runcommand(args)
         
         if errMsg:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self,
                 self.tr("Mercurial Error"),
                 errMsg)
@@ -791,7 +791,7 @@
         output, errMsg = self.__hgClient.runcommand(args)
         
         if errMsg:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self,
                 self.tr("Mercurial Error"),
                 errMsg)
@@ -818,7 +818,7 @@
         output, errMsg = self.__hgClient.runcommand(args)
         
         if errMsg:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self,
                 self.tr("Mercurial Error"),
                 errMsg)
@@ -845,7 +845,7 @@
         output, errMsg = self.__hgClient.runcommand(args)
         
         if errMsg:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self,
                 self.tr("Mercurial Error"),
                 errMsg)
@@ -984,7 +984,7 @@
             QDialogButtonBox.StandardButton.Cancel).setDefault(True)
         QApplication.processEvents()
         
-        with E5OverrideCursor():
+        with EricOverrideCursor():
             self.buf = []
             self.cancelled = False
             self.errors.clear()
@@ -1021,7 +1021,7 @@
                 if self.__bundle:
                     args.append(self.__bundle)
                 elif not self.vcs.hasSubrepositories():
-                    project = e5App().getObject("Project")
+                    project = ericApp().getObject("Project")
                     self.vcs.bundleFile = os.path.join(
                         project.getProjectManagementDir(), "hg-bundle.hg")
                     if os.path.exists(self.vcs.bundleFile):
@@ -2008,14 +2008,14 @@
         if revs:
             shouldReopen = self.vcs.hgGraft(revs)
             if shouldReopen:
-                res = E5MessageBox.yesNo(
+                res = EricMessageBox.yesNo(
                     None,
                     self.tr("Copy Changesets"),
                     self.tr(
                         """The project should be reread. Do this now?"""),
                     yesDefault=True)
                 if res:
-                    e5App().getObject("Project").reopenProject()
+                    ericApp().getObject("Project").reopenProject()
                     return
             
             self.on_refreshButton_clicked()
@@ -2079,14 +2079,14 @@
             if rev:
                 shouldReopen = self.vcs.vcsUpdate(revision=rev)
                 if shouldReopen:
-                    res = E5MessageBox.yesNo(
+                    res = EricMessageBox.yesNo(
                         None,
                         self.tr("Switch"),
                         self.tr(
                             """The project should be reread. Do this now?"""),
                         yesDefault=True)
                     if res:
-                        e5App().getObject("Project").reopenProject()
+                        ericApp().getObject("Project").reopenProject()
                         return
                 
                 self.on_refreshButton_clicked()
@@ -2176,14 +2176,14 @@
                 addNext = True
         
         if shouldReopen:
-            res = E5MessageBox.yesNo(
+            res = EricMessageBox.yesNo(
                 None,
                 self.tr("Pull Changes"),
                 self.tr(
                     """The project should be reread. Do this now?"""),
                 yesDefault=True)
             if res:
-                e5App().getObject("Project").reopenProject()
+                ericApp().getObject("Project").reopenProject()
                 return
         
         if refresh:
@@ -2222,14 +2222,14 @@
             shouldReopen = self.vcs.getExtensionObject("strip").hgStrip(
                 rev=rev)
             if shouldReopen:
-                res = E5MessageBox.yesNo(
+                res = EricMessageBox.yesNo(
                     None,
                     self.tr("Strip Changesets"),
                     self.tr(
                         """The project should be reread. Do this now?"""),
                     yesDefault=True)
                 if res:
-                    e5App().getObject("Project").reopenProject()
+                    ericApp().getObject("Project").reopenProject()
                     return
             
         self.on_refreshButton_clicked()
@@ -2310,13 +2310,13 @@
         if self.initialCommandMode == "incoming" and bool(self.__bundle):
             shouldReopen = self.vcs.hgUnbundle(files=[self.__bundle])
             if shouldReopen:
-                res = E5MessageBox.yesNo(
+                res = EricMessageBox.yesNo(
                     None,
                     self.tr("Apply Changegroup"),
                     self.tr("""The project should be reread. Do this now?"""),
                     yesDefault=True)
                 if res:
-                    e5App().getObject("Project").reopenProject()
+                    ericApp().getObject("Project").reopenProject()
                     return
             
             self.vcs.vcsLogBrowser()
@@ -2451,7 +2451,7 @@
                 self.logTree.setCurrentItem(self.logTree.topLevelItem(index))
                 break
         else:
-            E5MessageBox.information(
+            EricMessageBox.information(
                 self,
                 self.tr("Find Commit"),
                 self.tr("""'{0}' was not found.""").format(self.rxEdit.text()))
@@ -2653,13 +2653,13 @@
             else:
                 fname = dname
         
-        fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
+        fname, selectedFilter = EricFileDialog.getSaveFileNameAndFilter(
             self,
             self.tr("Save Diff"),
             fname,
             self.tr("Patch Files (*.diff)"),
             None,
-            E5FileDialog.DontConfirmOverwrite)
+            EricFileDialog.DontConfirmOverwrite)
         
         if not fname:
             return  # user aborted
@@ -2670,22 +2670,22 @@
             if ex:
                 fname += ex
         if QFileInfo(fname).exists():
-            res = E5MessageBox.yesNo(
+            res = EricMessageBox.yesNo(
                 self,
                 self.tr("Save Diff"),
                 self.tr("<p>The patch file <b>{0}</b> already exists."
                         " Overwrite it?</p>").format(fname),
-                icon=E5MessageBox.Warning)
+                icon=EricMessageBox.Warning)
             if not res:
                 return
         fname = Utilities.toNativeSeparators(fname)
         
-        eol = e5App().getObject("Project").getEolString()
+        eol = ericApp().getObject("Project").getEolString()
         try:
             with open(fname, "w", encoding="utf-8", newline="") as f:
                 f.write(eol.join(self.diffEdit.toPlainText().splitlines()))
         except OSError as why:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self, self.tr('Save Diff'),
                 self.tr(
                     '<p>The patch file <b>{0}</b> could not be saved.'

eric ide

mercurial