Tools/TRPreviewer.py

changeset 3039
8dd0165d805d
parent 3034
7ce719013078
child 3060
5883ce99ee12
child 3160
209a07d7e401
equal deleted inserted replaced
3038:7fe9a53280bd 3039:8dd0165d805d
158 self.openUIAct = QAction( 158 self.openUIAct = QAction(
159 UI.PixmapCache.getIcon("openUI.png"), 159 UI.PixmapCache.getIcon("openUI.png"),
160 self.trUtf8('&Open UI Files...'), self) 160 self.trUtf8('&Open UI Files...'), self)
161 self.openUIAct.setStatusTip(self.trUtf8('Open UI files for display')) 161 self.openUIAct.setStatusTip(self.trUtf8('Open UI files for display'))
162 self.openUIAct.setWhatsThis(self.trUtf8( 162 self.openUIAct.setWhatsThis(self.trUtf8(
163 """<b>Open UI Files</b>""" 163 """<b>Open UI Files</b>"""
164 """<p>This opens some UI files for display.</p>""" 164 """<p>This opens some UI files for display.</p>"""
165 )) 165 ))
166 self.openUIAct.triggered[()].connect(self.__openWidget) 166 self.openUIAct.triggered[()].connect(self.__openWidget)
167 167
168 self.openQMAct = QAction( 168 self.openQMAct = QAction(
169 UI.PixmapCache.getIcon("openQM.png"), 169 UI.PixmapCache.getIcon("openQM.png"),
170 self.trUtf8('Open &Translation Files...'), self) 170 self.trUtf8('Open &Translation Files...'), self)
171 self.openQMAct.setStatusTip(self.trUtf8( 171 self.openQMAct.setStatusTip(self.trUtf8(
172 'Open Translation files for display')) 172 'Open Translation files for display'))
173 self.openQMAct.setWhatsThis(self.trUtf8( 173 self.openQMAct.setWhatsThis(self.trUtf8(
174 """<b>Open Translation Files</b>""" 174 """<b>Open Translation Files</b>"""
175 """<p>This opens some translation files for display.</p>""" 175 """<p>This opens some translation files for display.</p>"""
176 )) 176 ))
177 self.openQMAct.triggered[()].connect(self.__openTranslation) 177 self.openQMAct.triggered[()].connect(self.__openTranslation)
178 178
179 self.reloadAct = QAction( 179 self.reloadAct = QAction(
180 UI.PixmapCache.getIcon("reload.png"), 180 UI.PixmapCache.getIcon("reload.png"),
192 UI.PixmapCache.getIcon("exit.png"), self.trUtf8('&Quit'), self) 192 UI.PixmapCache.getIcon("exit.png"), self.trUtf8('&Quit'), self)
193 self.exitAct.setShortcut(QKeySequence( 193 self.exitAct.setShortcut(QKeySequence(
194 self.trUtf8("Ctrl+Q", "File|Quit"))) 194 self.trUtf8("Ctrl+Q", "File|Quit")))
195 self.exitAct.setStatusTip(self.trUtf8('Quit the application')) 195 self.exitAct.setStatusTip(self.trUtf8('Quit the application'))
196 self.exitAct.setWhatsThis(self.trUtf8( 196 self.exitAct.setWhatsThis(self.trUtf8(
197 """<b>Quit</b>""" 197 """<b>Quit</b>"""
198 """<p>Quit the application.</p>""" 198 """<p>Quit the application.</p>"""
199 )) 199 ))
200 self.exitAct.triggered[()].connect(qApp.closeAllWindows) 200 self.exitAct.triggered[()].connect(qApp.closeAllWindows)
201 201
202 self.whatsThisAct = QAction( 202 self.whatsThisAct = QAction(
203 UI.PixmapCache.getIcon("whatsThis.png"), 203 UI.PixmapCache.getIcon("whatsThis.png"),
216 216
217 self.aboutAct = QAction(self.trUtf8('&About'), self) 217 self.aboutAct = QAction(self.trUtf8('&About'), self)
218 self.aboutAct.setStatusTip(self.trUtf8( 218 self.aboutAct.setStatusTip(self.trUtf8(
219 'Display information about this software')) 219 'Display information about this software'))
220 self.aboutAct.setWhatsThis(self.trUtf8( 220 self.aboutAct.setWhatsThis(self.trUtf8(
221 """<b>About</b>""" 221 """<b>About</b>"""
222 """<p>Display some information about this software.</p>""" 222 """<p>Display some information about this software.</p>"""
223 )) 223 ))
224 self.aboutAct.triggered[()].connect(self.__about) 224 self.aboutAct.triggered[()].connect(self.__about)
225 225
226 self.aboutQtAct = QAction(self.trUtf8('About &Qt'), self) 226 self.aboutQtAct = QAction(self.trUtf8('About &Qt'), self)
227 self.aboutQtAct.setStatusTip( 227 self.aboutQtAct.setStatusTip(
228 self.trUtf8('Display information about the Qt toolkit')) 228 self.trUtf8('Display information about the Qt toolkit'))
229 self.aboutQtAct.setWhatsThis(self.trUtf8( 229 self.aboutQtAct.setWhatsThis(self.trUtf8(
230 """<b>About Qt</b>""" 230 """<b>About Qt</b>"""
231 """<p>Display some information about the Qt toolkit.</p>""" 231 """<p>Display some information about the Qt toolkit.</p>"""
232 )) 232 ))
233 self.aboutQtAct.triggered[()].connect(self.__aboutQt) 233 self.aboutQtAct.triggered[()].connect(self.__aboutQt)
234 234
235 self.tileAct = QAction(self.trUtf8('&Tile'), self) 235 self.tileAct = QAction(self.trUtf8('&Tile'), self)
236 self.tileAct.setStatusTip(self.trUtf8('Tile the windows')) 236 self.tileAct.setStatusTip(self.trUtf8('Tile the windows'))
254 UI.PixmapCache.getIcon("close.png"), self.trUtf8('&Close'), self) 254 UI.PixmapCache.getIcon("close.png"), self.trUtf8('&Close'), self)
255 self.closeAct.setShortcut(QKeySequence(self.trUtf8( 255 self.closeAct.setShortcut(QKeySequence(self.trUtf8(
256 "Ctrl+W", "File|Close"))) 256 "Ctrl+W", "File|Close")))
257 self.closeAct.setStatusTip(self.trUtf8('Close the current window')) 257 self.closeAct.setStatusTip(self.trUtf8('Close the current window'))
258 self.closeAct.setWhatsThis(self.trUtf8( 258 self.closeAct.setWhatsThis(self.trUtf8(
259 """<b>Close Window</b>""" 259 """<b>Close Window</b>"""
260 """<p>Close the current window.</p>""" 260 """<p>Close the current window.</p>"""
261 )) 261 ))
262 self.closeAct.triggered[()].connect(self.preview.closeWidget) 262 self.closeAct.triggered[()].connect(self.preview.closeWidget)
263 263
264 self.closeAllAct = QAction(self.trUtf8('Clos&e All'), self) 264 self.closeAllAct = QAction(self.trUtf8('Clos&e All'), self)
265 self.closeAllAct.setStatusTip(self.trUtf8('Close all windows')) 265 self.closeAllAct.setStatusTip(self.trUtf8('Close all windows'))
266 self.closeAllAct.setWhatsThis(self.trUtf8( 266 self.closeAllAct.setWhatsThis(self.trUtf8(
267 """<b>Close All Windows</b>""" 267 """<b>Close All Windows</b>"""
268 """<p>Close all windows.</p>""" 268 """<p>Close all windows.</p>"""
269 )) 269 ))
270 self.closeAllAct.triggered[()].connect(self.preview.closeAllWidgets) 270 self.closeAllAct.triggered[()].connect(self.preview.closeAllWidgets)
271 271
272 def __initMenus(self): 272 def __initMenus(self):
273 """ 273 """
508 E5MessageBox.warning( 508 E5MessageBox.warning(
509 self.parent(), 509 self.parent(),
510 self.trUtf8("Set Translator"), 510 self.trUtf8("Set Translator"),
511 self.trUtf8( 511 self.trUtf8(
512 """<p>The translator <b>{0}</b> is not known.</p>""") 512 """<p>The translator <b>{0}</b> is not known.</p>""")
513 .format(name)) 513 .format(name))
514 return 514 return
515 515
516 nTranslator = trans.translator 516 nTranslator = trans.translator
517 517
518 if nTranslator == self.currentTranslator: 518 if nTranslator == self.currentTranslator:
725 E5MessageBox.warning( 725 E5MessageBox.warning(
726 self, 726 self,
727 self.trUtf8("Load UI File"), 727 self.trUtf8("Load UI File"),
728 self.trUtf8( 728 self.trUtf8(
729 """<p>The file <b>{0}</b> could not be loaded.</p>""") 729 """<p>The file <b>{0}</b> could not be loaded.</p>""")
730 .format(self.__uiFileName)) 730 .format(self.__uiFileName))
731 self.__valid = False 731 self.__valid = False
732 return 732 return
733 733
734 self.__widget.setParent(self) 734 self.__widget.setParent(self)
735 self.__layout.addWidget(self.__widget) 735 self.__layout.addWidget(self.__widget)
781 E5MessageBox.warning( 781 E5MessageBox.warning(
782 self, 782 self,
783 self.trUtf8("Load UI File"), 783 self.trUtf8("Load UI File"),
784 self.trUtf8( 784 self.trUtf8(
785 """<p>The file <b>{0}</b> could not be loaded.</p>""") 785 """<p>The file <b>{0}</b> could not be loaded.</p>""")
786 .format(uiFileName)) 786 .format(uiFileName))
787 return 787 return
788 788
789 uname = name 789 uname = name
790 cnt = 1 790 cnt = 1
791 while self.findChild(WidgetView, uname) is not None: 791 while self.findChild(WidgetView, uname) is not None:

eric ide

mercurial