Project/ProjectTranslationsBrowser.py

changeset 2191
7c7251ce9497
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
equal deleted inserted replaced
2190:abd65b78425e 2191:7c7251ce9497
13 13
14 from PyQt4.QtCore import pyqtSignal, QProcess 14 from PyQt4.QtCore import pyqtSignal, QProcess
15 from PyQt4.QtGui import QDialog, QMenu 15 from PyQt4.QtGui import QDialog, QMenu
16 16
17 from E5Gui import E5MessageBox 17 from E5Gui import E5MessageBox
18 from E5Gui.E5Application import e5App
18 19
19 from .ProjectBrowserModel import ProjectBrowserFileItem, \ 20 from .ProjectBrowserModel import ProjectBrowserFileItem, \
20 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \ 21 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \
21 ProjectBrowserTranslationType 22 ProjectBrowserTranslationType
22 from .ProjectBaseBrowser import ProjectBaseBrowser 23 from .ProjectBaseBrowser import ProjectBaseBrowser
23 24
24 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog 25 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
26 import UI.PixmapCache
25 27
26 import Preferences 28 import Preferences
27 import Utilities 29 import Utilities
28 30
29 31
831 @param exitCode exit code of the process (integer) 833 @param exitCode exit code of the process (integer)
832 @param exitStatus exit status of the process (QProcess.ExitStatus) 834 @param exitStatus exit status of the process (QProcess.ExitStatus)
833 """ 835 """
834 self.pylupdateProcRunning = False 836 self.pylupdateProcRunning = False
835 if exitStatus == QProcess.NormalExit and exitCode == 0: 837 if exitStatus == QProcess.NormalExit and exitCode == 0:
836 E5MessageBox.information(self, 838 ui = e5App().getObject("UserInterface")
837 self.trUtf8("Translation file generation"), 839 if ui.notificationsEnabled():
838 self.trUtf8("The generation of the translation files (*.ts)" 840 ui.showNotification(UI.PixmapCache.getPixmap("linguist48.png"),
839 " was successful.")) 841 self.trUtf8("Translation file generation"),
842 self.trUtf8("The generation of the translation files (*.ts)"
843 " was successful."))
844 else:
845 E5MessageBox.information(self,
846 self.trUtf8("Translation file generation"),
847 self.trUtf8("The generation of the translation files (*.ts)"
848 " was successful."))
840 else: 849 else:
841 E5MessageBox.critical(self, 850 E5MessageBox.critical(self,
842 self.trUtf8("Translation file generation"), 851 self.trUtf8("Translation file generation"),
843 self.trUtf8("The generation of the translation files (*.ts) has failed.")) 852 self.trUtf8("The generation of the translation files (*.ts) has failed."))
844 self.pylupdateProc = None 853 self.pylupdateProc = None
970 """ 979 """
971 Private slot to handle the finished signal of the lrelease process. 980 Private slot to handle the finished signal of the lrelease process.
972 """ 981 """
973 self.lreleaseProcRunning = False 982 self.lreleaseProcRunning = False
974 if exitStatus == QProcess.NormalExit and exitCode == 0: 983 if exitStatus == QProcess.NormalExit and exitCode == 0:
975 E5MessageBox.information(self, 984 ui = e5App().getObject("UserInterface")
976 self.trUtf8("Translation file release"), 985 if ui.notificationsEnabled():
977 self.trUtf8("The release of the translation files (*.qm)" 986 ui.showNotification(UI.PixmapCache.getPixmap("linguist48.png"),
978 " was successful.")) 987 self.trUtf8("Translation file release"),
988 self.trUtf8("The release of the translation files (*.qm)"
989 " was successful."))
990 else:
991 E5MessageBox.information(self,
992 self.trUtf8("Translation file release"),
993 self.trUtf8("The release of the translation files (*.qm)"
994 " was successful."))
979 if self.project.pdata["TRANSLATIONSBINPATH"]: 995 if self.project.pdata["TRANSLATIONSBINPATH"]:
980 target = os.path.join(self.project.ppath, 996 target = os.path.join(self.project.ppath,
981 self.project.pdata["TRANSLATIONSBINPATH"][0]) 997 self.project.pdata["TRANSLATIONSBINPATH"][0])
982 for langFile in self.project.pdata["TRANSLATIONS"][:]: 998 for langFile in self.project.pdata["TRANSLATIONS"][:]:
983 if langFile.endswith('.ts'): 999 if langFile.endswith('.ts'):

eric ide

mercurial