Project/ProjectResourcesBrowser.py

changeset 2192
61b3849df76d
parent 1676
54f387117fee
child 2302
f29e9405c851
equal deleted inserted replaced
2191:7c7251ce9497 2192:61b3849df76d
19 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \ 19 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \
20 ProjectBrowserResourceType 20 ProjectBrowserResourceType
21 from .ProjectBaseBrowser import ProjectBaseBrowser 21 from .ProjectBaseBrowser import ProjectBaseBrowser
22 22
23 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog 23 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
24 import UI.PixmapCache
24 25
25 import Preferences 26 import Preferences
26 import Utilities 27 import Utilities
27 28
28 29
505 @param exitCode exit code of the process (integer) 506 @param exitCode exit code of the process (integer)
506 @param exitStatus exit status of the process (QProcess.ExitStatus) 507 @param exitStatus exit status of the process (QProcess.ExitStatus)
507 """ 508 """
508 self.compileRunning = False 509 self.compileRunning = False
509 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True) 510 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True)
511 ui = e5App().getObject("UserInterface")
510 if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf: 512 if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf:
511 ofn = os.path.join(self.project.ppath, self.compiledFile) 513 ofn = os.path.join(self.project.ppath, self.compiledFile)
512 try: 514 try:
513 if self.project.useSystemEol(): 515 if self.project.useSystemEol():
514 newline = None 516 newline = None
518 for line in self.buf.splitlines(): 520 for line in self.buf.splitlines():
519 f.write(line + "\n") 521 f.write(line + "\n")
520 f.close() 522 f.close()
521 if self.compiledFile not in self.project.pdata["SOURCES"]: 523 if self.compiledFile not in self.project.pdata["SOURCES"]:
522 self.project.appendFile(ofn) 524 self.project.appendFile(ofn)
523 if not self.noDialog: 525 if not self.noDialog and not ui.notificationsEnabled():
524 E5MessageBox.information(self, 526 E5MessageBox.information(self,
527 self.trUtf8("Resource Compilation"),
528 self.trUtf8("The compilation of the resource file"
529 " was successful."))
530 else:
531 ui.showNotification(
532 UI.PixmapCache.getPixmap("resourcesCompiler48.png"),
525 self.trUtf8("Resource Compilation"), 533 self.trUtf8("Resource Compilation"),
526 self.trUtf8("The compilation of the resource file" 534 self.trUtf8("The compilation of the resource file"
527 " was successful.")) 535 " was successful."))
528 except IOError as msg: 536 except IOError as msg:
529 if not self.noDialog: 537 if not self.noDialog:
532 self.trUtf8("<p>The compilation of the resource file failed.</p>" 540 self.trUtf8("<p>The compilation of the resource file failed.</p>"
533 "<p>Reason: {0}</p>").format(str(msg))) 541 "<p>Reason: {0}</p>").format(str(msg)))
534 else: 542 else:
535 if not self.noDialog: 543 if not self.noDialog:
536 E5MessageBox.information(self, 544 E5MessageBox.information(self,
545 self.trUtf8("Resource Compilation"),
546 self.trUtf8("The compilation of the resource file failed."))
547 else:
548 ui.showNotification(UI.PixmapCache.getPixmap("resourcesCompiler48.png"),
537 self.trUtf8("Resource Compilation"), 549 self.trUtf8("Resource Compilation"),
538 self.trUtf8("The compilation of the resource file failed.")) 550 self.trUtf8("The compilation of the resource file failed."))
539 self.compileProc = None 551 self.compileProc = None
540 552
541 def __compileQRC(self, fn, noDialog=False, progress=None): 553 def __compileQRC(self, fn, noDialog=False, progress=None):

eric ide

mercurial