689 self.tr("Delete translation files"), |
689 self.tr("Delete translation files"), |
690 self.tr("Do you really want to delete these translation files" |
690 self.tr("Do you really want to delete these translation files" |
691 " from the project?"), |
691 " from the project?"), |
692 translationFiles) |
692 translationFiles) |
693 |
693 |
694 if dlg.exec() == QDialog.Accepted: |
694 if dlg.exec() == QDialog.DialogCode.Accepted: |
695 for fn in translationFiles: |
695 for fn in translationFiles: |
696 self.closeSourceWindow.emit(fn) |
696 self.closeSourceWindow.emit(fn) |
697 self.project.deleteLanguageFile(fn) |
697 self.project.deleteLanguageFile(fn) |
698 |
698 |
699 def __TRPreview(self, previewAll=False): |
699 def __TRPreview(self, previewAll=False): |
868 @param proc process to read from (QProcess) |
868 @param proc process to read from (QProcess) |
869 @param ps prompt string (string) |
869 @param ps prompt string (string) |
870 """ |
870 """ |
871 ioEncoding = Preferences.getSystem("IOEncoding") |
871 ioEncoding = Preferences.getSystem("IOEncoding") |
872 |
872 |
873 proc.setReadChannel(QProcess.StandardOutput) |
873 proc.setReadChannel(QProcess.ProcessChannel.StandardOutput) |
874 while proc and proc.canReadLine(): |
874 while proc and proc.canReadLine(): |
875 s = ps |
875 s = ps |
876 output = str(proc.readLine(), ioEncoding, 'replace') |
876 output = str(proc.readLine(), ioEncoding, 'replace') |
877 s += output |
877 s += output |
878 self.appendStdout.emit(s) |
878 self.appendStdout.emit(s) |
904 @param proc process to read from (QProcess) |
904 @param proc process to read from (QProcess) |
905 @param ps propmt string (string) |
905 @param ps propmt string (string) |
906 """ |
906 """ |
907 ioEncoding = Preferences.getSystem("IOEncoding") |
907 ioEncoding = Preferences.getSystem("IOEncoding") |
908 |
908 |
909 proc.setReadChannel(QProcess.StandardError) |
909 proc.setReadChannel(QProcess.ProcessChannel.StandardError) |
910 while proc and proc.canReadLine(): |
910 while proc and proc.canReadLine(): |
911 s = ps |
911 s = ps |
912 error = str(proc.readLine(), ioEncoding, 'replace') |
912 error = str(proc.readLine(), ioEncoding, 'replace') |
913 s += error |
913 s += error |
914 self.appendStderr.emit(s) |
914 self.appendStderr.emit(s) |
934 @type int |
934 @type int |
935 @param exitStatus exit status of the process |
935 @param exitStatus exit status of the process |
936 @type QProcess.ExitStatus |
936 @type QProcess.ExitStatus |
937 """ |
937 """ |
938 ui = e5App().getObject("UserInterface") |
938 ui = e5App().getObject("UserInterface") |
939 if exitStatus == QProcess.NormalExit and exitCode == 0: |
939 if exitStatus == QProcess.ExitStatus.NormalExit and exitCode == 0: |
940 ui.showNotification( |
940 ui.showNotification( |
941 UI.PixmapCache.getPixmap("linguist48"), |
941 UI.PixmapCache.getPixmap("linguist48"), |
942 self.tr("Translation file generation"), |
942 self.tr("Translation file generation"), |
943 self.tr( |
943 self.tr( |
944 "The generation of the translation files (*.ts)" |
944 "The generation of the translation files (*.ts)" |
945 " was successful.")) |
945 " was successful.")) |
946 else: |
946 else: |
947 if exitStatus == QProcess.CrashExit: |
947 if exitStatus == QProcess.ExitStatus.CrashExit: |
948 info = self.tr(" The process has crashed.") |
948 info = self.tr(" The process has crashed.") |
949 else: |
949 else: |
950 info = "" |
950 info = "" |
951 ui.showNotification( |
951 ui.showNotification( |
952 UI.PixmapCache.getPixmap("linguist48"), |
952 UI.PixmapCache.getPixmap("linguist48"), |
1187 @type int |
1187 @type int |
1188 @param exitStatus exit status of the process |
1188 @param exitStatus exit status of the process |
1189 @type QProcess.ExitStatus |
1189 @type QProcess.ExitStatus |
1190 """ |
1190 """ |
1191 ui = e5App().getObject("UserInterface") |
1191 ui = e5App().getObject("UserInterface") |
1192 if exitStatus == QProcess.NormalExit and exitCode == 0: |
1192 if exitStatus == QProcess.ExitStatus.NormalExit and exitCode == 0: |
1193 ui.showNotification( |
1193 ui.showNotification( |
1194 UI.PixmapCache.getPixmap("linguist48"), |
1194 UI.PixmapCache.getPixmap("linguist48"), |
1195 self.tr("Translation file release"), |
1195 self.tr("Translation file release"), |
1196 self.tr("The release of the translation files (*.qm)" |
1196 self.tr("The release of the translation files (*.qm)" |
1197 " was successful.")) |
1197 " was successful.")) |