640 ########################################################################### |
640 ########################################################################### |
641 |
641 |
642 def __readStdout(self): |
642 def __readStdout(self): |
643 """ |
643 """ |
644 Private slot to handle the readyReadStandardOutput signal of the |
644 Private slot to handle the readyReadStandardOutput signal of the |
645 pyuic/rbuic process. |
645 pyuic4/pyuic5/pyside-uic/rbuic4 process. |
646 """ |
646 """ |
647 if self.compileProc is None: |
647 if self.compileProc is None: |
648 return |
648 return |
649 self.compileProc.setReadChannel(QProcess.StandardOutput) |
649 self.compileProc.setReadChannel(QProcess.StandardOutput) |
650 |
650 |
748 self.buf = "" |
748 self.buf = "" |
749 |
749 |
750 if self.project.getProjectLanguage() in \ |
750 if self.project.getProjectLanguage() in \ |
751 ["Python", "Python2", "Python3"]: |
751 ["Python", "Python2", "Python3"]: |
752 if self.project.getProjectType() in ["Qt4", ]: |
752 if self.project.getProjectType() in ["Qt4", ]: |
753 self.uicompiler = 'pyuic4' |
753 self.uicompiler = Utilities.generatePyQtToolPath('pyuic4') |
754 if Utilities.isWindowsPlatform(): |
|
755 uic = Utilities.getWindowsExecutablePath(self.uicompiler) |
|
756 else: |
|
757 uic = self.uicompiler |
|
758 elif self.project.getProjectType() in ["PyQt5"]: |
754 elif self.project.getProjectType() in ["PyQt5"]: |
759 self.uicompiler = 'pyuic5' |
755 self.uicompiler = Utilities.generatePyQtToolPath('pyuic5') |
760 if Utilities.isWindowsPlatform(): |
|
761 uic = Utilities.getWindowsExecutablePath(self.uicompiler) |
|
762 else: |
|
763 uic = self.uicompiler |
|
764 elif self.project.getProjectType() in ["E6Plugin"]: |
756 elif self.project.getProjectType() in ["E6Plugin"]: |
765 if PYQT_VERSION < 0x050000: |
757 if PYQT_VERSION < 0x050000: |
766 self.uicompiler = 'pyuic4' |
758 self.uicompiler = Utilities.generatePyQtToolPath('pyuic4') |
767 else: |
759 else: |
768 self.uicompiler = 'pyuic5' |
760 self.uicompiler = Utilities.generatePyQtToolPath('pyuic5') |
769 if Utilities.isWindowsPlatform(): |
|
770 uic = Utilities.getWindowsExecutablePath(self.uicompiler) |
|
771 else: |
|
772 uic = self.uicompiler |
|
773 elif self.project.getProjectType() == "PySide": |
761 elif self.project.getProjectType() == "PySide": |
774 self.uicompiler = 'pyside-uic' |
762 self.uicompiler = \ |
775 uic = Utilities.generatePySideToolPath(self.uicompiler) |
763 Utilities.generatePySideToolPath('pyside-uic') |
776 else: |
764 else: |
777 return None |
765 return None |
778 elif self.project.getProjectLanguage() == "Ruby": |
766 elif self.project.getProjectLanguage() == "Ruby": |
779 if self.project.getProjectType() == "Qt4": |
767 if self.project.getProjectType() == "Qt4": |
780 self.uicompiler = 'rbuic4' |
768 self.uicompiler = 'rbuic4' |
781 if Utilities.isWindowsPlatform(): |
769 if Utilities.isWindowsPlatform(): |
782 uic = Utilities.getWindowsExecutablePath(self.uicompiler) |
770 self.uicompiler = \ |
783 else: |
771 Utilities.getWindowsExecutablePath(self.uicompiler) |
784 uic = self.uicompiler |
|
785 else: |
772 else: |
786 return None |
773 return None |
787 else: |
774 else: |
788 return None |
775 return None |
789 |
776 |
808 self.compileProc.finished.connect(self.__compileUIDone) |
795 self.compileProc.finished.connect(self.__compileUIDone) |
809 self.compileProc.readyReadStandardOutput.connect(self.__readStdout) |
796 self.compileProc.readyReadStandardOutput.connect(self.__readStdout) |
810 self.compileProc.readyReadStandardError.connect(self.__readStderr) |
797 self.compileProc.readyReadStandardError.connect(self.__readStderr) |
811 |
798 |
812 self.noDialog = noDialog |
799 self.noDialog = noDialog |
813 self.compileProc.start(uic, args) |
800 self.compileProc.start(self.uicompiler, args) |
814 procStarted = self.compileProc.waitForStarted(5000) |
801 procStarted = self.compileProc.waitForStarted(5000) |
815 if procStarted: |
802 if procStarted: |
816 self.compileRunning = True |
803 self.compileRunning = True |
817 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(False) |
804 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(False) |
818 return self.compileProc |
805 return self.compileProc |