eric6/Project/ProjectTranslationsBrowser.py

changeset 7955
567f2ec958c3
parent 7938
1d3a2a0dac22
child 7959
44e15eda6506
--- a/eric6/Project/ProjectTranslationsBrowser.py	Mon Jan 04 16:39:09 2021 +0100
+++ b/eric6/Project/ProjectTranslationsBrowser.py	Mon Jan 04 16:39:37 2021 +0100
@@ -934,33 +934,26 @@
         @param exitStatus exit status of the process
         @type QProcess.ExitStatus
         """
+        ui = e5App().getObject("UserInterface")
         if exitStatus == QProcess.NormalExit and exitCode == 0:
-            ui = e5App().getObject("UserInterface")
-            if ui.notificationsEnabled():
-                ui.showNotification(
-                    UI.PixmapCache.getPixmap("linguist48"),
-                    self.tr("Translation file generation"),
-                    self.tr(
-                        "The generation of the translation files (*.ts)"
-                        " was successful."))
-            else:
-                E5MessageBox.information(
-                    self,
-                    self.tr("Translation file generation"),
-                    self.tr(
-                        "The generation of the translation files (*.ts)"
-                        " was successful."))
+            ui.showNotification(
+                UI.PixmapCache.getPixmap("linguist48"),
+                self.tr("Translation file generation"),
+                self.tr(
+                    "The generation of the translation files (*.ts)"
+                    " was successful."))
         else:
             if exitStatus == QProcess.CrashExit:
                 info = self.tr(" The process has crashed.")
             else:
                 info = ""
-            E5MessageBox.critical(
-                self,
+            ui.showNotification(
+                UI.PixmapCache.getPixmap("linguist48"),
                 self.tr("Translation file generation"),
                 self.tr(
                     "The generation of the translation files (*.ts) has"
-                    " failed.{0}").format(info))
+                    " failed.{0}").format(info),
+                timeout=0)
         
         for index in range(len(self.__pylupdateProcesses)):
             if proc == self.__pylupdateProcesses[index][0]:
@@ -1193,20 +1186,13 @@
         @param exitStatus exit status of the process
         @type QProcess.ExitStatus
         """
+        ui = e5App().getObject("UserInterface")
         if exitStatus == QProcess.NormalExit and exitCode == 0:
-            ui = e5App().getObject("UserInterface")
-            if ui.notificationsEnabled():
-                ui.showNotification(
-                    UI.PixmapCache.getPixmap("linguist48"),
-                    self.tr("Translation file release"),
-                    self.tr("The release of the translation files (*.qm)"
-                            " was successful."))
-            else:
-                E5MessageBox.information(
-                    self,
-                    self.tr("Translation file release"),
-                    self.tr("The release of the translation files (*.qm)"
-                            " was successful."))
+            ui.showNotification(
+                UI.PixmapCache.getPixmap("linguist48"),
+                self.tr("Translation file release"),
+                self.tr("The release of the translation files (*.qm)"
+                        " was successful."))
             if self.project.pdata["TRANSLATIONSBINPATH"]:
                 target = os.path.join(
                     self.project.ppath,
@@ -1218,11 +1204,12 @@
                         if os.path.exists(qmFile):
                             shutil.move(qmFile, target)
         else:
-            E5MessageBox.critical(
-                self,
+            ui.showNotification(
+                UI.PixmapCache.getPixmap("linguist48"),
                 self.tr("Translation file release"),
                 self.tr(
-                    "The release of the translation files (*.qm) has failed."))
+                    "The release of the translation files (*.qm) has failed."),
+                timeout=0)
         
         for index in range(len(self.__lreleaseProcesses)):
             if proc == self.__lreleaseProcesses[index]:

eric ide

mercurial