660 self.tr("Delete forms"), |
660 self.tr("Delete forms"), |
661 self.tr( |
661 self.tr( |
662 "Do you really want to delete these forms from the project?"), |
662 "Do you really want to delete these forms from the project?"), |
663 files) |
663 files) |
664 |
664 |
665 if dlg.exec() == QDialog.Accepted: |
665 if dlg.exec() == QDialog.DialogCode.Accepted: |
666 for fn2, fn in zip(fullNames, files): |
666 for fn2, fn in zip(fullNames, files): |
667 self.closeSourceWindow.emit(fn2) |
667 self.closeSourceWindow.emit(fn2) |
668 self.project.deleteFile(fn) |
668 self.project.deleteFile(fn) |
669 |
669 |
670 ########################################################################### |
670 ########################################################################### |
717 Private slot to handle the readyReadStandardOutput signal of the |
717 Private slot to handle the readyReadStandardOutput signal of the |
718 pyuic5/pyuic6/pyside2-uic/pyside6-uic process. |
718 pyuic5/pyuic6/pyside2-uic/pyside6-uic process. |
719 """ |
719 """ |
720 if self.compileProc is None: |
720 if self.compileProc is None: |
721 return |
721 return |
722 self.compileProc.setReadChannel(QProcess.StandardOutput) |
722 self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardOutput) |
723 |
723 |
724 while self.compileProc and self.compileProc.canReadLine(): |
724 while self.compileProc and self.compileProc.canReadLine(): |
725 self.buf += str(self.compileProc.readLine(), |
725 self.buf += str(self.compileProc.readLine(), |
726 "utf-8", 'replace') |
726 "utf-8", 'replace') |
727 |
727 |
733 if self.compileProc is None: |
733 if self.compileProc is None: |
734 return |
734 return |
735 |
735 |
736 ioEncoding = Preferences.getSystem("IOEncoding") |
736 ioEncoding = Preferences.getSystem("IOEncoding") |
737 |
737 |
738 self.compileProc.setReadChannel(QProcess.StandardError) |
738 self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardError) |
739 while self.compileProc and self.compileProc.canReadLine(): |
739 while self.compileProc and self.compileProc.canReadLine(): |
740 s = self.__uicompiler + ': ' |
740 s = self.__uicompiler + ': ' |
741 error = str(self.compileProc.readLine(), |
741 error = str(self.compileProc.readLine(), |
742 ioEncoding, 'replace') |
742 ioEncoding, 'replace') |
743 s += error |
743 s += error |
751 @param exitStatus exit status of the process (QProcess.ExitStatus) |
751 @param exitStatus exit status of the process (QProcess.ExitStatus) |
752 """ |
752 """ |
753 self.compileRunning = False |
753 self.compileRunning = False |
754 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True) |
754 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True) |
755 ui = e5App().getObject("UserInterface") |
755 ui = e5App().getObject("UserInterface") |
756 if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf: |
756 if ( |
|
757 exitStatus == QProcess.ExitStatus.NormalExit and |
|
758 exitCode == 0 and |
|
759 self.buf |
|
760 ): |
757 ofn = os.path.join(self.project.ppath, self.compiledFile) |
761 ofn = os.path.join(self.project.ppath, self.compiledFile) |
758 try: |
762 try: |
759 if self.project.useSystemEol(): |
763 if self.project.useSystemEol(): |
760 newline = None |
764 newline = None |
761 else: |
765 else: |
935 if progress.wasCanceled(): |
939 if progress.wasCanceled(): |
936 break |
940 break |
937 |
941 |
938 proc = self.__compileUI(fn, True, progress) |
942 proc = self.__compileUI(fn, True, progress) |
939 if proc is not None: |
943 if proc is not None: |
940 while proc.state() == QProcess.Running: |
944 while proc.state() == QProcess.ProcessState.Running: |
941 QApplication.processEvents() |
945 QApplication.processEvents() |
942 QThread.msleep(300) |
946 QThread.msleep(300) |
943 QApplication.processEvents() |
947 QApplication.processEvents() |
944 else: |
948 else: |
945 break |
949 break |
973 if progress.wasCanceled(): |
977 if progress.wasCanceled(): |
974 break |
978 break |
975 |
979 |
976 proc = self.__compileUI(fn, True, progress) |
980 proc = self.__compileUI(fn, True, progress) |
977 if proc is not None: |
981 if proc is not None: |
978 while proc.state() == QProcess.Running: |
982 while proc.state() == QProcess.ProcessState.Running: |
979 QApplication.processEvents() |
983 QApplication.processEvents() |
980 QThread.msleep(300) |
984 QThread.msleep(300) |
981 QApplication.processEvents() |
985 QApplication.processEvents() |
982 else: |
986 else: |
983 break |
987 break |
1039 if progress.wasCanceled(): |
1043 if progress.wasCanceled(): |
1040 break |
1044 break |
1041 |
1045 |
1042 proc = self.__compileUI(fn, True, progress) |
1046 proc = self.__compileUI(fn, True, progress) |
1043 if proc is not None: |
1047 if proc is not None: |
1044 while proc.state() == QProcess.Running: |
1048 while proc.state() == QProcess.ProcessState.Running: |
1045 QApplication.processEvents() |
1049 QApplication.processEvents() |
1046 QThread.msleep(300) |
1050 QThread.msleep(300) |
1047 QApplication.processEvents() |
1051 QApplication.processEvents() |
1048 else: |
1052 else: |
1049 break |
1053 break |
1067 |
1071 |
1068 params = self.project.pdata["UICPARAMS"] |
1072 params = self.project.pdata["UICPARAMS"] |
1069 |
1073 |
1070 if self.project.getProjectType() in ["PyQt5", "PyQt6", "E6Plugin"]: |
1074 if self.project.getProjectType() in ["PyQt5", "PyQt6", "E6Plugin"]: |
1071 dlg = UicCompilerOptionsDialog(params, self.getUiCompiler()) |
1075 dlg = UicCompilerOptionsDialog(params, self.getUiCompiler()) |
1072 if dlg.exec() == QDialog.Accepted: |
1076 if dlg.exec() == QDialog.DialogCode.Accepted: |
1073 package, suffix, root = dlg.getData() |
1077 package, suffix, root = dlg.getData() |
1074 if package != params["Package"]: |
1078 if package != params["Package"]: |
1075 params["Package"] = package |
1079 params["Package"] = package |
1076 self.project.setDirty(True) |
1080 self.project.setDirty(True) |
1077 if suffix != params["RcSuffix"]: |
1081 if suffix != params["RcSuffix"]: |