462 self.tr("Delete interfaces"), |
462 self.tr("Delete interfaces"), |
463 self.tr("Do you really want to delete these interfaces from" |
463 self.tr("Do you really want to delete these interfaces from" |
464 " the project?"), |
464 " the project?"), |
465 files) |
465 files) |
466 |
466 |
467 if dlg.exec() == QDialog.Accepted: |
467 if dlg.exec() == QDialog.DialogCode.Accepted: |
468 for fn2, fn in zip(fullNames, files): |
468 for fn2, fn in zip(fullNames, files): |
469 self.closeSourceWindow.emit(fn2) |
469 self.closeSourceWindow.emit(fn2) |
470 self.project.deleteFile(fn) |
470 self.project.deleteFile(fn) |
471 |
471 |
472 ########################################################################### |
472 ########################################################################### |
481 if self.compileProc is None: |
481 if self.compileProc is None: |
482 return |
482 return |
483 |
483 |
484 ioEncoding = Preferences.getSystem("IOEncoding") |
484 ioEncoding = Preferences.getSystem("IOEncoding") |
485 |
485 |
486 self.compileProc.setReadChannel(QProcess.StandardOutput) |
486 self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardOutput) |
487 while self.compileProc and self.compileProc.canReadLine(): |
487 while self.compileProc and self.compileProc.canReadLine(): |
488 s = 'omniidl: ' |
488 s = 'omniidl: ' |
489 output = str(self.compileProc.readLine(), ioEncoding, 'replace') |
489 output = str(self.compileProc.readLine(), ioEncoding, 'replace') |
490 s += output |
490 s += output |
491 self.appendStdout.emit(s) |
491 self.appendStdout.emit(s) |
498 if self.compileProc is None: |
498 if self.compileProc is None: |
499 return |
499 return |
500 |
500 |
501 ioEncoding = Preferences.getSystem("IOEncoding") |
501 ioEncoding = Preferences.getSystem("IOEncoding") |
502 |
502 |
503 self.compileProc.setReadChannel(QProcess.StandardError) |
503 self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardError) |
504 while self.compileProc and self.compileProc.canReadLine(): |
504 while self.compileProc and self.compileProc.canReadLine(): |
505 s = 'omniidl: ' |
505 s = 'omniidl: ' |
506 error = str(self.compileProc.readLine(), ioEncoding, 'replace') |
506 error = str(self.compileProc.readLine(), ioEncoding, 'replace') |
507 s += error |
507 s += error |
508 self.appendStderr.emit(s) |
508 self.appendStderr.emit(s) |
514 @param exitCode exit code of the process (integer) |
514 @param exitCode exit code of the process (integer) |
515 @param exitStatus exit status of the process (QProcess.ExitStatus) |
515 @param exitStatus exit status of the process (QProcess.ExitStatus) |
516 """ |
516 """ |
517 self.compileRunning = False |
517 self.compileRunning = False |
518 ui = e5App().getObject("UserInterface") |
518 ui = e5App().getObject("UserInterface") |
519 if exitStatus == QProcess.NormalExit and exitCode == 0: |
519 if exitStatus == QProcess.ExitStatus.NormalExit and exitCode == 0: |
520 path = os.path.dirname(self.idlFile) |
520 path = os.path.dirname(self.idlFile) |
521 poaList = glob.glob(os.path.join(path, "*__POA")) |
521 poaList = glob.glob(os.path.join(path, "*__POA")) |
522 npoaList = [f.replace("__POA", "") for f in poaList] |
522 npoaList = [f.replace("__POA", "") for f in poaList] |
523 fileList = glob.glob(os.path.join(path, "*_idl.py")) |
523 fileList = glob.glob(os.path.join(path, "*_idl.py")) |
524 for directory in poaList + npoaList: |
524 for directory in poaList + npoaList: |
622 progress.setValue(i) |
622 progress.setValue(i) |
623 if progress.wasCanceled(): |
623 if progress.wasCanceled(): |
624 break |
624 break |
625 proc = self.__compileIDL(fn, True, progress) |
625 proc = self.__compileIDL(fn, True, progress) |
626 if proc is not None: |
626 if proc is not None: |
627 while proc.state() == QProcess.Running: |
627 while proc.state() == QProcess.ProcessState.Running: |
628 QApplication.processEvents() |
628 QApplication.processEvents() |
629 QThread.msleep(300) |
629 QThread.msleep(300) |
630 QApplication.processEvents() |
630 QApplication.processEvents() |
631 else: |
631 else: |
632 break |
632 break |
657 progress.setValue(i) |
657 progress.setValue(i) |
658 if progress.wasCanceled(): |
658 if progress.wasCanceled(): |
659 break |
659 break |
660 proc = self.__compileIDL(fn, True, progress) |
660 proc = self.__compileIDL(fn, True, progress) |
661 if proc is not None: |
661 if proc is not None: |
662 while proc.state() == QProcess.Running: |
662 while proc.state() == QProcess.ProcessState.Running: |
663 QApplication.processEvents() |
663 QApplication.processEvents() |
664 QThread.msleep(300) |
664 QThread.msleep(300) |
665 QApplication.processEvents() |
665 QApplication.processEvents() |
666 else: |
666 else: |
667 break |
667 break |
678 |
678 |
679 from .IdlCompilerOptionsDialog import IdlCompilerOptionsDialog |
679 from .IdlCompilerOptionsDialog import IdlCompilerOptionsDialog |
680 dlg = IdlCompilerOptionsDialog( |
680 dlg = IdlCompilerOptionsDialog( |
681 params["IncludeDirs"][:], params["DefinedNames"][:], |
681 params["IncludeDirs"][:], params["DefinedNames"][:], |
682 params["UndefinedNames"][:], self.project, self) |
682 params["UndefinedNames"][:], self.project, self) |
683 if dlg.exec() == QDialog.Accepted: |
683 if dlg.exec() == QDialog.DialogCode.Accepted: |
684 include, defined, undefined = dlg.getData() |
684 include, defined, undefined = dlg.getData() |
685 if include != params["IncludeDirs"]: |
685 if include != params["IncludeDirs"]: |
686 params["IncludeDirs"] = include[:] |
686 params["IncludeDirs"] = include[:] |
687 self.project.setDirty(True) |
687 self.project.setDirty(True) |
688 if defined != params["DefinedNames"]: |
688 if defined != params["DefinedNames"]: |