Project/ProjectFormsBrowser.py

changeset 2191
7c7251ce9497
parent 1864
1c8d0747ba9f
child 2302
f29e9405c851
--- a/Project/ProjectFormsBrowser.py	Sun Nov 04 16:55:20 2012 +0100
+++ b/Project/ProjectFormsBrowser.py	Sun Nov 04 17:39:08 2012 +0100
@@ -23,6 +23,7 @@
 from .ProjectBaseBrowser import ProjectBaseBrowser
 
 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
+import UI.PixmapCache
 
 import Preferences
 import Utilities
@@ -603,6 +604,7 @@
         """
         self.compileRunning = False
         e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True)
+        ui = e5App().getObject("UserInterface")
         if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf:
             ofn = os.path.join(self.project.ppath, self.compiledFile)
             try:
@@ -616,11 +618,16 @@
                 f.close()
                 if self.compiledFile not in self.project.pdata["SOURCES"]:
                     self.project.appendFile(ofn)
-                if not self.noDialog:
+                if not self.noDialog and not ui.notificationsEnabled():
                     E5MessageBox.information(self,
                         self.trUtf8("Form Compilation"),
                         self.trUtf8("The compilation of the form file"
                             " was successful."))
+                else:
+                    ui.showNotification(UI.PixmapCache.getPixmap("designer48.png"),
+                        self.trUtf8("Form Compilation"),
+                        self.trUtf8("The compilation of the form file"
+                            " was successful."))
                 self.project.projectFormCompiled.emit(self.compiledFile)
             except IOError as msg:
                 if not self.noDialog:
@@ -628,11 +635,20 @@
                         self.trUtf8("Form Compilation"),
                         self.trUtf8("<p>The compilation of the form file failed.</p>"
                             "<p>Reason: {0}</p>").format(str(msg)))
+                else:
+                    ui.showNotification(UI.PixmapCache.getPixmap("designer48.png"),
+                        self.trUtf8("Form Compilation"),
+                        self.trUtf8("<p>The compilation of the form file failed.</p>"
+                            "<p>Reason: {0}</p>").format(str(msg)))
         else:
             if not self.noDialog:
                 E5MessageBox.information(self,
                     self.trUtf8("Form Compilation"),
                     self.trUtf8("The compilation of the form file failed."))
+            else:
+                ui.showNotification(UI.PixmapCache.getPixmap("designer48.png"),
+                    self.trUtf8("Form Compilation"),
+                    self.trUtf8("The compilation of the form file failed."))
         self.compileProc = None
         
     def __compileUI(self, fn, noDialog=False, progress=None):

eric ide

mercurial