542 self.tr( |
542 self.tr( |
543 "Do you really want to delete these resources from the" |
543 "Do you really want to delete these resources from the" |
544 " project?"), |
544 " project?"), |
545 files) |
545 files) |
546 |
546 |
547 if dlg.exec() == QDialog.Accepted: |
547 if dlg.exec() == QDialog.DialogCode.Accepted: |
548 for fn2, fn in zip(fullNames, files): |
548 for fn2, fn in zip(fullNames, files): |
549 self.closeSourceWindow.emit(fn2) |
549 self.closeSourceWindow.emit(fn2) |
550 self.project.deleteFile(fn) |
550 self.project.deleteFile(fn) |
551 |
551 |
552 ########################################################################### |
552 ########################################################################### |
558 Private slot to handle the readyReadStandardOutput signal of the |
558 Private slot to handle the readyReadStandardOutput signal of the |
559 pyrcc5/pyside2-rcc/pyside6-rcc process. |
559 pyrcc5/pyside2-rcc/pyside6-rcc process. |
560 """ |
560 """ |
561 if self.compileProc is None: |
561 if self.compileProc is None: |
562 return |
562 return |
563 self.compileProc.setReadChannel(QProcess.StandardOutput) |
563 self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardOutput) |
564 |
564 |
565 while self.compileProc and self.compileProc.canReadLine(): |
565 while self.compileProc and self.compileProc.canReadLine(): |
566 self.buf += str(self.compileProc.readLine(), |
566 self.buf += str(self.compileProc.readLine(), |
567 Preferences.getSystem("IOEncoding"), |
567 Preferences.getSystem("IOEncoding"), |
568 'replace') |
568 'replace') |
575 if self.compileProc is None: |
575 if self.compileProc is None: |
576 return |
576 return |
577 |
577 |
578 ioEncoding = Preferences.getSystem("IOEncoding") |
578 ioEncoding = Preferences.getSystem("IOEncoding") |
579 |
579 |
580 self.compileProc.setReadChannel(QProcess.StandardError) |
580 self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardError) |
581 while self.compileProc and self.compileProc.canReadLine(): |
581 while self.compileProc and self.compileProc.canReadLine(): |
582 s = self.rccCompiler + ': ' |
582 s = self.rccCompiler + ': ' |
583 error = str(self.compileProc.readLine(), |
583 error = str(self.compileProc.readLine(), |
584 ioEncoding, 'replace') |
584 ioEncoding, 'replace') |
585 s += error |
585 s += error |
593 @param exitStatus exit status of the process (QProcess.ExitStatus) |
593 @param exitStatus exit status of the process (QProcess.ExitStatus) |
594 """ |
594 """ |
595 self.compileRunning = False |
595 self.compileRunning = False |
596 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True) |
596 e5App().getObject("ViewManager").enableEditorsCheckFocusIn(True) |
597 ui = e5App().getObject("UserInterface") |
597 ui = e5App().getObject("UserInterface") |
598 if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf: |
598 if ( |
|
599 exitStatus == QProcess.ExitStatus.NormalExit and |
|
600 exitCode == 0 and |
|
601 self.buf |
|
602 ): |
599 ofn = os.path.join(self.project.ppath, self.compiledFile) |
603 ofn = os.path.join(self.project.ppath, self.compiledFile) |
600 try: |
604 try: |
601 if self.project.useSystemEol(): |
605 if self.project.useSystemEol(): |
602 newline = None |
606 newline = None |
603 else: |
607 else: |
752 progress.setValue(i) |
756 progress.setValue(i) |
753 if progress.wasCanceled(): |
757 if progress.wasCanceled(): |
754 break |
758 break |
755 proc = self.__compileQRC(fn, True, progress) |
759 proc = self.__compileQRC(fn, True, progress) |
756 if proc is not None: |
760 if proc is not None: |
757 while proc.state() == QProcess.Running: |
761 while proc.state() == QProcess.ProcessState.Running: |
758 QApplication.processEvents() |
762 QApplication.processEvents() |
759 QThread.msleep(300) |
763 QThread.msleep(300) |
760 QApplication.processEvents() |
764 QApplication.processEvents() |
761 else: |
765 else: |
762 break |
766 break |
790 if progress.wasCanceled(): |
794 if progress.wasCanceled(): |
791 break |
795 break |
792 if not fn.endswith('.ui.h'): |
796 if not fn.endswith('.ui.h'): |
793 proc = self.__compileQRC(fn, True, progress) |
797 proc = self.__compileQRC(fn, True, progress) |
794 if proc is not None: |
798 if proc is not None: |
795 while proc.state() == QProcess.Running: |
799 while proc.state() == QProcess.ProcessState.Running: |
796 QApplication.processEvents() |
800 QApplication.processEvents() |
797 QThread.msleep(300) |
801 QThread.msleep(300) |
798 QApplication.processEvents() |
802 QApplication.processEvents() |
799 else: |
803 else: |
800 break |
804 break |
896 progress.setValue(i) |
900 progress.setValue(i) |
897 if progress.wasCanceled(): |
901 if progress.wasCanceled(): |
898 break |
902 break |
899 proc = self.__compileQRC(fn, True, progress) |
903 proc = self.__compileQRC(fn, True, progress) |
900 if proc is not None: |
904 if proc is not None: |
901 while proc.state() == QProcess.Running: |
905 while proc.state() == QProcess.ProcessState.Running: |
902 QApplication.processEvents() |
906 QApplication.processEvents() |
903 QThread.msleep(300) |
907 QThread.msleep(300) |
904 QApplication.processEvents() |
908 QApplication.processEvents() |
905 else: |
909 else: |
906 break |
910 break |
921 from .RccCompilerOptionsDialog import RccCompilerOptionsDialog |
925 from .RccCompilerOptionsDialog import RccCompilerOptionsDialog |
922 |
926 |
923 params = self.project.pdata["RCCPARAMS"] |
927 params = self.project.pdata["RCCPARAMS"] |
924 |
928 |
925 dlg = RccCompilerOptionsDialog(params) |
929 dlg = RccCompilerOptionsDialog(params) |
926 if dlg.exec() == QDialog.Accepted: |
930 if dlg.exec() == QDialog.DialogCode.Accepted: |
927 threshold, compression, noCompression, root = dlg.getData() |
931 threshold, compression, noCompression, root = dlg.getData() |
928 if threshold != params["CompressionThreshold"]: |
932 if threshold != params["CompressionThreshold"]: |
929 params["CompressionThreshold"] = threshold |
933 params["CompressionThreshold"] = threshold |
930 self.project.setDirty(True) |
934 self.project.setDirty(True) |
931 if compression != params["CompressLevel"]: |
935 if compression != params["CompressLevel"]: |