Project/ProjectTranslationsBrowser.py

changeset 537
72b32daeb8d6
parent 536
6d8d39753c82
child 539
87f9bce38a44
equal deleted inserted replaced
536:6d8d39753c82 537:72b32daeb8d6
730 730
731 pf.close() 731 pf.close()
732 self.tmpProject = pfile 732 self.tmpProject = pfile
733 return True 733 return True
734 except IOError: 734 except IOError:
735 QMessageBox.critical(None, 735 E5MessageBox.critical(self,
736 self.trUtf8("Write temporary project file"), 736 self.trUtf8("Write temporary project file"),
737 self.trUtf8("<p>The temporary project file <b>{0}</b> could not" 737 self.trUtf8("<p>The temporary project file <b>{0}</b> could not"
738 " be written.</p>").format(pfile)) 738 " be written.</p>").format(pfile))
739 self.tmpProject = None 739 self.tmpProject = None
740 return False 740 return False
834 E5MessageBox.information(self, 834 E5MessageBox.information(self,
835 self.trUtf8("Translation file generation"), 835 self.trUtf8("Translation file generation"),
836 self.trUtf8("The generation of the translation files (*.ts)" 836 self.trUtf8("The generation of the translation files (*.ts)"
837 " was successful.")) 837 " was successful."))
838 else: 838 else:
839 QMessageBox.critical(self, 839 E5MessageBox.critical(self,
840 self.trUtf8("Translation file generation"), 840 self.trUtf8("Translation file generation"),
841 self.trUtf8("The generation of the translation files (*.ts) has failed.")) 841 self.trUtf8("The generation of the translation files (*.ts) has failed."))
842 self.pylupdateProc = None 842 self.pylupdateProc = None
843 self.pylupdate = "" 843 self.pylupdate = ""
844 try: 844 try:
919 self.pylupdateProc.start(self.pylupdate, args) 919 self.pylupdateProc.start(self.pylupdate, args)
920 procStarted = self.pylupdateProc.waitForStarted() 920 procStarted = self.pylupdateProc.waitForStarted()
921 if procStarted: 921 if procStarted:
922 self.pylupdateProcRunning = True 922 self.pylupdateProcRunning = True
923 else: 923 else:
924 QMessageBox.critical(self, 924 E5MessageBox.critical(self,
925 self.trUtf8('Process Generation Error'), 925 self.trUtf8('Process Generation Error'),
926 self.trUtf8( 926 self.trUtf8(
927 'Could not start {0}.<br>' 927 'Could not start {0}.<br>'
928 'Ensure that it is in the search path.' 928 'Ensure that it is in the search path.'
929 ).format(self.pylupdate)) 929 ).format(self.pylupdate))
982 qmFile = os.path.join(self.project.ppath, 982 qmFile = os.path.join(self.project.ppath,
983 langFile.replace('.ts', '.qm')) 983 langFile.replace('.ts', '.qm'))
984 if os.path.exists(qmFile): 984 if os.path.exists(qmFile):
985 shutil.move(qmFile, target) 985 shutil.move(qmFile, target)
986 else: 986 else:
987 QMessageBox.critical(self, 987 E5MessageBox.critical(self,
988 self.trUtf8("Translation file release"), 988 self.trUtf8("Translation file release"),
989 self.trUtf8("The release of the translation files (*.qm) has failed.")) 989 self.trUtf8("The release of the translation files (*.qm) has failed."))
990 self.lreleaseProc = None 990 self.lreleaseProc = None
991 try: 991 try:
992 os.remove(self.tmpProject) 992 os.remove(self.tmpProject)
1048 self.lreleaseProc.start(lrelease, args) 1048 self.lreleaseProc.start(lrelease, args)
1049 procStarted = self.lreleaseProc.waitForStarted() 1049 procStarted = self.lreleaseProc.waitForStarted()
1050 if procStarted: 1050 if procStarted:
1051 self.lreleaseProcRunning = True 1051 self.lreleaseProcRunning = True
1052 else: 1052 else:
1053 QMessageBox.critical(self, 1053 E5MessageBox.critical(self,
1054 self.trUtf8('Process Generation Error'), 1054 self.trUtf8('Process Generation Error'),
1055 self.trUtf8( 1055 self.trUtf8(
1056 '<p>Could not start lrelease.<br>' 1056 '<p>Could not start lrelease.<br>'
1057 'Ensure that it is available as <b>{0}</b>.</p>' 1057 'Ensure that it is available as <b>{0}</b>.</p>'
1058 ).format(lrelease)) 1058 ).format(lrelease))

eric ide

mercurial