Project/ProjectResourcesBrowser.py

changeset 3071
83d066710d60
parent 3047
2a3c730dbb58
child 3080
6c0a430b19df
child 3160
209a07d7e401
equal deleted inserted replaced
3070:04e342ebf697 3071:83d066710d60
8 """ 8 """
9 9
10 import os 10 import os
11 11
12 from PyQt4.QtCore import QThread, QFileInfo, pyqtSignal, PYQT_VERSION, QProcess 12 from PyQt4.QtCore import QThread, QFileInfo, pyqtSignal, PYQT_VERSION, QProcess
13 from PyQt4.QtGui import QDialog, QApplication, QMenu, QProgressDialog 13 from PyQt4.QtGui import QDialog, QApplication, QMenu
14 14
15 from E5Gui.E5Application import e5App 15 from E5Gui.E5Application import e5App
16 from E5Gui import E5MessageBox, E5FileDialog 16 from E5Gui import E5MessageBox, E5FileDialog
17 from E5Gui.E5ProgressDialog import E5ProgressDialog
17 18
18 from .ProjectBrowserModel import ProjectBrowserFileItem, \ 19 from .ProjectBrowserModel import ProjectBrowserFileItem, \
19 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \ 20 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \
20 ProjectBrowserResourceType 21 ProjectBrowserResourceType
21 from .ProjectBaseBrowser import ProjectBaseBrowser 22 from .ProjectBaseBrowser import ProjectBaseBrowser
623 args = [] 624 args = []
624 self.buf = "" 625 self.buf = ""
625 626
626 if self.project.pdata["PROGLANGUAGE"][0] in \ 627 if self.project.pdata["PROGLANGUAGE"][0] in \
627 ["Python", "Python2", "Python3"]: 628 ["Python", "Python2", "Python3"]:
628 if self.project.getProjectType() in ["Qt4", "Qt4C","E4Plugin"]: 629 if self.project.getProjectType() in ["Qt4", "Qt4C", "E4Plugin"]:
629 self.rccCompiler = 'pyrcc4' 630 self.rccCompiler = 'pyrcc4'
630 if Utilities.isWindowsPlatform(): 631 if Utilities.isWindowsPlatform():
631 self.rccCompiler += '.exe' 632 self.rccCompiler += '.exe'
632 if PYQT_VERSION >= 0x040500: 633 if PYQT_VERSION >= 0x040500:
633 if self.project.pdata["PROGLANGUAGE"][0] in \ 634 if self.project.pdata["PROGLANGUAGE"][0] in \
716 """ 717 """
717 if self.hooks["compileAllResources"] is not None: 718 if self.hooks["compileAllResources"] is not None:
718 self.hooks["compileAllResources"](self.project.pdata["RESOURCES"]) 719 self.hooks["compileAllResources"](self.project.pdata["RESOURCES"])
719 else: 720 else:
720 numResources = len(self.project.pdata["RESOURCES"]) 721 numResources = len(self.project.pdata["RESOURCES"])
721 progress = QProgressDialog( 722 progress = E5ProgressDialog(
722 self.trUtf8("Compiling resources..."), 723 self.trUtf8("Compiling resources..."),
723 self.trUtf8("Abort"), 0, numResources, self) 724 self.trUtf8("Abort"), 0, numResources,
725 self.trUtf8("%v/%m Resources"), self)
724 progress.setModal(True) 726 progress.setModal(True)
725 progress.setMinimumDuration(0) 727 progress.setMinimumDuration(0)
726 i = 0 728 i = 0
727 729
728 for fn in self.project.pdata["RESOURCES"]: 730 for fn in self.project.pdata["RESOURCES"]:
751 753
752 if self.hooks["compileSelectedResources"] is not None: 754 if self.hooks["compileSelectedResources"] is not None:
753 self.hooks["compileSelectedResources"](files) 755 self.hooks["compileSelectedResources"](files)
754 else: 756 else:
755 numResources = len(files) 757 numResources = len(files)
756 progress = QProgressDialog( 758 progress = E5ProgressDialog(
757 self.trUtf8("Compiling resources..."), 759 self.trUtf8("Compiling resources..."),
758 self.trUtf8("Abort"), 0, numResources, self) 760 self.trUtf8("Abort"), 0, numResources,
761 self.trUtf8("%v/%m Resources"), self)
759 progress.setModal(True) 762 progress.setModal(True)
760 progress.setMinimumDuration(0) 763 progress.setMinimumDuration(0)
761 i = 0 764 i = 0
762 765
763 for fn in files: 766 for fn in files:
820 """ 823 """
821 if self.hooks["compileChangedResources"] is not None: 824 if self.hooks["compileChangedResources"] is not None:
822 self.hooks["compileChangedResources"]( 825 self.hooks["compileChangedResources"](
823 self.project.pdata["RESOURCES"]) 826 self.project.pdata["RESOURCES"])
824 else: 827 else:
825 progress = QProgressDialog( 828 progress = E5ProgressDialog(
826 self.trUtf8("Determining changed resources..."), 829 self.trUtf8("Determining changed resources..."),
827 None, 0, 100) 830 None, 0, 100, self.trUtf8("%v/%m Resources"))
828 progress.setMinimumDuration(0) 831 progress.setMinimumDuration(0)
829 i = 0 832 i = 0
830 833
831 # get list of changed resources 834 # get list of changed resources
832 changedResources = [] 835 changedResources = []

eric ide

mercurial