21 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \ |
21 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \ |
22 ProjectBrowserFormType |
22 ProjectBrowserFormType |
23 from .ProjectBaseBrowser import ProjectBaseBrowser |
23 from .ProjectBaseBrowser import ProjectBaseBrowser |
24 |
24 |
25 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
25 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
|
26 import UI.PixmapCache |
26 |
27 |
27 import Preferences |
28 import Preferences |
28 import Utilities |
29 import Utilities |
29 |
30 |
30 from eric5config import getConfig |
31 from eric5config import getConfig |
601 @param exitCode exit code of the process (integer) |
602 @param exitCode exit code of the process (integer) |
602 @param exitStatus exit status of the process (QProcess.ExitStatus) |
603 @param exitStatus exit status of the process (QProcess.ExitStatus) |
603 """ |
604 """ |
604 self.compileRunning = False |
605 self.compileRunning = False |
605 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True) |
606 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True) |
|
607 ui = e5App().getObject("UserInterface") |
606 if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf: |
608 if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf: |
607 ofn = os.path.join(self.project.ppath, self.compiledFile) |
609 ofn = os.path.join(self.project.ppath, self.compiledFile) |
608 try: |
610 try: |
609 if self.project.useSystemEol(): |
611 if self.project.useSystemEol(): |
610 newline = None |
612 newline = None |
614 for line in self.buf.splitlines(): |
616 for line in self.buf.splitlines(): |
615 f.write(line + "\n") |
617 f.write(line + "\n") |
616 f.close() |
618 f.close() |
617 if self.compiledFile not in self.project.pdata["SOURCES"]: |
619 if self.compiledFile not in self.project.pdata["SOURCES"]: |
618 self.project.appendFile(ofn) |
620 self.project.appendFile(ofn) |
619 if not self.noDialog: |
621 if not self.noDialog and not ui.notificationsEnabled(): |
620 E5MessageBox.information(self, |
622 E5MessageBox.information(self, |
|
623 self.trUtf8("Form Compilation"), |
|
624 self.trUtf8("The compilation of the form file" |
|
625 " was successful.")) |
|
626 else: |
|
627 ui.showNotification(UI.PixmapCache.getPixmap("designer48.png"), |
621 self.trUtf8("Form Compilation"), |
628 self.trUtf8("Form Compilation"), |
622 self.trUtf8("The compilation of the form file" |
629 self.trUtf8("The compilation of the form file" |
623 " was successful.")) |
630 " was successful.")) |
624 self.project.projectFormCompiled.emit(self.compiledFile) |
631 self.project.projectFormCompiled.emit(self.compiledFile) |
625 except IOError as msg: |
632 except IOError as msg: |
626 if not self.noDialog: |
633 if not self.noDialog: |
627 E5MessageBox.information(self, |
634 E5MessageBox.information(self, |
628 self.trUtf8("Form Compilation"), |
635 self.trUtf8("Form Compilation"), |
629 self.trUtf8("<p>The compilation of the form file failed.</p>" |
636 self.trUtf8("<p>The compilation of the form file failed.</p>" |
630 "<p>Reason: {0}</p>").format(str(msg))) |
637 "<p>Reason: {0}</p>").format(str(msg))) |
|
638 else: |
|
639 ui.showNotification(UI.PixmapCache.getPixmap("designer48.png"), |
|
640 self.trUtf8("Form Compilation"), |
|
641 self.trUtf8("<p>The compilation of the form file failed.</p>" |
|
642 "<p>Reason: {0}</p>").format(str(msg))) |
631 else: |
643 else: |
632 if not self.noDialog: |
644 if not self.noDialog: |
633 E5MessageBox.information(self, |
645 E5MessageBox.information(self, |
|
646 self.trUtf8("Form Compilation"), |
|
647 self.trUtf8("The compilation of the form file failed.")) |
|
648 else: |
|
649 ui.showNotification(UI.PixmapCache.getPixmap("designer48.png"), |
634 self.trUtf8("Form Compilation"), |
650 self.trUtf8("Form Compilation"), |
635 self.trUtf8("The compilation of the form file failed.")) |
651 self.trUtf8("The compilation of the form file failed.")) |
636 self.compileProc = None |
652 self.compileProc = None |
637 |
653 |
638 def __compileUI(self, fn, noDialog=False, progress=None): |
654 def __compileUI(self, fn, noDialog=False, progress=None): |