118 def __initFileFilters(self): |
118 def __initFileFilters(self): |
119 """ |
119 """ |
120 Private method to define the supported image file filters. |
120 Private method to define the supported image file filters. |
121 """ |
121 """ |
122 filters = { |
122 filters = { |
123 'bmp': self.trUtf8("Windows Bitmap File (*.bmp)"), |
123 'bmp': self.tr("Windows Bitmap File (*.bmp)"), |
124 'gif': self.trUtf8("Graphic Interchange Format File (*.gif)"), |
124 'gif': self.tr("Graphic Interchange Format File (*.gif)"), |
125 'ico': self.trUtf8("Windows Icon File (*.ico)"), |
125 'ico': self.tr("Windows Icon File (*.ico)"), |
126 'jpg': self.trUtf8("JPEG File (*.jpg)"), |
126 'jpg': self.tr("JPEG File (*.jpg)"), |
127 'jpeg': self.trUtf8("JPEG File (*.jpeg)"), |
127 'jpeg': self.tr("JPEG File (*.jpeg)"), |
128 'mng': self.trUtf8("Multiple-Image Network Graphics File (*.mng)"), |
128 'mng': self.tr("Multiple-Image Network Graphics File (*.mng)"), |
129 'pbm': self.trUtf8("Portable Bitmap File (*.pbm)"), |
129 'pbm': self.tr("Portable Bitmap File (*.pbm)"), |
130 'pcx': self.trUtf8("Paintbrush Bitmap File (*.pcx)"), |
130 'pcx': self.tr("Paintbrush Bitmap File (*.pcx)"), |
131 'pgm': self.trUtf8("Portable Graymap File (*.pgm)"), |
131 'pgm': self.tr("Portable Graymap File (*.pgm)"), |
132 'png': self.trUtf8("Portable Network Graphics File (*.png)"), |
132 'png': self.tr("Portable Network Graphics File (*.png)"), |
133 'ppm': self.trUtf8("Portable Pixmap File (*.ppm)"), |
133 'ppm': self.tr("Portable Pixmap File (*.ppm)"), |
134 'sgi': self.trUtf8("Silicon Graphics Image File (*.sgi)"), |
134 'sgi': self.tr("Silicon Graphics Image File (*.sgi)"), |
135 'svg': self.trUtf8("Scalable Vector Graphics File (*.svg)"), |
135 'svg': self.tr("Scalable Vector Graphics File (*.svg)"), |
136 'svgz': self.trUtf8("Compressed Scalable Vector Graphics File" |
136 'svgz': self.tr("Compressed Scalable Vector Graphics File" |
137 " (*.svgz)"), |
137 " (*.svgz)"), |
138 'tga': self.trUtf8("Targa Graphic File (*.tga)"), |
138 'tga': self.tr("Targa Graphic File (*.tga)"), |
139 'tif': self.trUtf8("TIFF File (*.tif)"), |
139 'tif': self.tr("TIFF File (*.tif)"), |
140 'tiff': self.trUtf8("TIFF File (*.tiff)"), |
140 'tiff': self.tr("TIFF File (*.tiff)"), |
141 'wbmp': self.trUtf8("WAP Bitmap File (*.wbmp)"), |
141 'wbmp': self.tr("WAP Bitmap File (*.wbmp)"), |
142 'xbm': self.trUtf8("X11 Bitmap File (*.xbm)"), |
142 'xbm': self.tr("X11 Bitmap File (*.xbm)"), |
143 'xpm': self.trUtf8("X11 Pixmap File (*.xpm)"), |
143 'xpm': self.tr("X11 Pixmap File (*.xpm)"), |
144 } |
144 } |
145 |
145 |
146 inputFormats = [] |
146 inputFormats = [] |
147 readFormats = QImageReader.supportedImageFormats() |
147 readFormats = QImageReader.supportedImageFormats() |
148 for readFormat in readFormats: |
148 for readFormat in readFormats: |
149 try: |
149 try: |
150 inputFormats.append(filters[bytes(readFormat).decode()]) |
150 inputFormats.append(filters[bytes(readFormat).decode()]) |
151 except KeyError: |
151 except KeyError: |
152 pass |
152 pass |
153 inputFormats.sort() |
153 inputFormats.sort() |
154 inputFormats.append(self.trUtf8("All Files (*)")) |
154 inputFormats.append(self.tr("All Files (*)")) |
155 self.__inputFilter = ';;'.join(inputFormats) |
155 self.__inputFilter = ';;'.join(inputFormats) |
156 |
156 |
157 outputFormats = [] |
157 outputFormats = [] |
158 writeFormats = QImageWriter.supportedImageFormats() |
158 writeFormats = QImageWriter.supportedImageFormats() |
159 for writeFormat in writeFormats: |
159 for writeFormat in writeFormats: |
182 def __initFileActions(self): |
182 def __initFileActions(self): |
183 """ |
183 """ |
184 Private method to define the file related user interface actions. |
184 Private method to define the file related user interface actions. |
185 """ |
185 """ |
186 self.newAct = E5Action( |
186 self.newAct = E5Action( |
187 self.trUtf8('New'), |
187 self.tr('New'), |
188 UI.PixmapCache.getIcon("new.png"), |
188 UI.PixmapCache.getIcon("new.png"), |
189 self.trUtf8('&New'), |
189 self.tr('&New'), |
190 QKeySequence(self.trUtf8("Ctrl+N", "File|New")), |
190 QKeySequence(self.tr("Ctrl+N", "File|New")), |
191 0, self, 'iconEditor_file_new') |
191 0, self, 'iconEditor_file_new') |
192 self.newAct.setStatusTip(self.trUtf8('Create a new icon')) |
192 self.newAct.setStatusTip(self.tr('Create a new icon')) |
193 self.newAct.setWhatsThis(self.trUtf8( |
193 self.newAct.setWhatsThis(self.tr( |
194 """<b>New</b>""" |
194 """<b>New</b>""" |
195 """<p>This creates a new icon.</p>""" |
195 """<p>This creates a new icon.</p>""" |
196 )) |
196 )) |
197 self.newAct.triggered[()].connect(self.__newIcon) |
197 self.newAct.triggered[()].connect(self.__newIcon) |
198 self.__actions.append(self.newAct) |
198 self.__actions.append(self.newAct) |
199 |
199 |
200 self.newWindowAct = E5Action( |
200 self.newWindowAct = E5Action( |
201 self.trUtf8('New Window'), |
201 self.tr('New Window'), |
202 UI.PixmapCache.getIcon("newWindow.png"), |
202 UI.PixmapCache.getIcon("newWindow.png"), |
203 self.trUtf8('New &Window'), |
203 self.tr('New &Window'), |
204 0, 0, self, 'iconEditor_file_new_window') |
204 0, 0, self, 'iconEditor_file_new_window') |
205 self.newWindowAct.setStatusTip(self.trUtf8( |
205 self.newWindowAct.setStatusTip(self.tr( |
206 'Open a new icon editor window')) |
206 'Open a new icon editor window')) |
207 self.newWindowAct.setWhatsThis(self.trUtf8( |
207 self.newWindowAct.setWhatsThis(self.tr( |
208 """<b>New Window</b>""" |
208 """<b>New Window</b>""" |
209 """<p>This opens a new icon editor window.</p>""" |
209 """<p>This opens a new icon editor window.</p>""" |
210 )) |
210 )) |
211 self.newWindowAct.triggered[()].connect(self.__newWindow) |
211 self.newWindowAct.triggered[()].connect(self.__newWindow) |
212 self.__actions.append(self.newWindowAct) |
212 self.__actions.append(self.newWindowAct) |
213 |
213 |
214 self.openAct = E5Action( |
214 self.openAct = E5Action( |
215 self.trUtf8('Open'), |
215 self.tr('Open'), |
216 UI.PixmapCache.getIcon("open.png"), |
216 UI.PixmapCache.getIcon("open.png"), |
217 self.trUtf8('&Open...'), |
217 self.tr('&Open...'), |
218 QKeySequence(self.trUtf8("Ctrl+O", "File|Open")), |
218 QKeySequence(self.tr("Ctrl+O", "File|Open")), |
219 0, self, 'iconEditor_file_open') |
219 0, self, 'iconEditor_file_open') |
220 self.openAct.setStatusTip(self.trUtf8('Open an icon file for editing')) |
220 self.openAct.setStatusTip(self.tr('Open an icon file for editing')) |
221 self.openAct.setWhatsThis(self.trUtf8( |
221 self.openAct.setWhatsThis(self.tr( |
222 """<b>Open File</b>""" |
222 """<b>Open File</b>""" |
223 """<p>This opens a new icon file for editing.""" |
223 """<p>This opens a new icon file for editing.""" |
224 """ It pops up a file selection dialog.</p>""" |
224 """ It pops up a file selection dialog.</p>""" |
225 )) |
225 )) |
226 self.openAct.triggered[()].connect(self.__openIcon) |
226 self.openAct.triggered[()].connect(self.__openIcon) |
227 self.__actions.append(self.openAct) |
227 self.__actions.append(self.openAct) |
228 |
228 |
229 self.saveAct = E5Action( |
229 self.saveAct = E5Action( |
230 self.trUtf8('Save'), |
230 self.tr('Save'), |
231 UI.PixmapCache.getIcon("fileSave.png"), |
231 UI.PixmapCache.getIcon("fileSave.png"), |
232 self.trUtf8('&Save'), |
232 self.tr('&Save'), |
233 QKeySequence(self.trUtf8("Ctrl+S", "File|Save")), |
233 QKeySequence(self.tr("Ctrl+S", "File|Save")), |
234 0, self, 'iconEditor_file_save') |
234 0, self, 'iconEditor_file_save') |
235 self.saveAct.setStatusTip(self.trUtf8('Save the current icon')) |
235 self.saveAct.setStatusTip(self.tr('Save the current icon')) |
236 self.saveAct.setWhatsThis(self.trUtf8( |
236 self.saveAct.setWhatsThis(self.tr( |
237 """<b>Save File</b>""" |
237 """<b>Save File</b>""" |
238 """<p>Save the contents of the icon editor window.</p>""" |
238 """<p>Save the contents of the icon editor window.</p>""" |
239 )) |
239 )) |
240 self.saveAct.triggered[()].connect(self.__saveIcon) |
240 self.saveAct.triggered[()].connect(self.__saveIcon) |
241 self.__actions.append(self.saveAct) |
241 self.__actions.append(self.saveAct) |
242 |
242 |
243 self.saveAsAct = E5Action( |
243 self.saveAsAct = E5Action( |
244 self.trUtf8('Save As'), |
244 self.tr('Save As'), |
245 UI.PixmapCache.getIcon("fileSaveAs.png"), |
245 UI.PixmapCache.getIcon("fileSaveAs.png"), |
246 self.trUtf8('Save &As...'), |
246 self.tr('Save &As...'), |
247 QKeySequence(self.trUtf8("Shift+Ctrl+S", "File|Save As")), |
247 QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")), |
248 0, self, 'iconEditor_file_save_as') |
248 0, self, 'iconEditor_file_save_as') |
249 self.saveAsAct.setStatusTip( |
249 self.saveAsAct.setStatusTip( |
250 self.trUtf8('Save the current icon to a new file')) |
250 self.tr('Save the current icon to a new file')) |
251 self.saveAsAct.setWhatsThis(self.trUtf8( |
251 self.saveAsAct.setWhatsThis(self.tr( |
252 """<b>Save As...</b>""" |
252 """<b>Save As...</b>""" |
253 """<p>Saves the current icon to a new file.</p>""" |
253 """<p>Saves the current icon to a new file.</p>""" |
254 )) |
254 )) |
255 self.saveAsAct.triggered[()].connect(self.__saveIconAs) |
255 self.saveAsAct.triggered[()].connect(self.__saveIconAs) |
256 self.__actions.append(self.saveAsAct) |
256 self.__actions.append(self.saveAsAct) |
257 |
257 |
258 self.closeAct = E5Action( |
258 self.closeAct = E5Action( |
259 self.trUtf8('Close'), |
259 self.tr('Close'), |
260 UI.PixmapCache.getIcon("close.png"), |
260 UI.PixmapCache.getIcon("close.png"), |
261 self.trUtf8('&Close'), |
261 self.tr('&Close'), |
262 QKeySequence(self.trUtf8("Ctrl+W", "File|Close")), |
262 QKeySequence(self.tr("Ctrl+W", "File|Close")), |
263 0, self, 'iconEditor_file_close') |
263 0, self, 'iconEditor_file_close') |
264 self.closeAct.setStatusTip(self.trUtf8( |
264 self.closeAct.setStatusTip(self.tr( |
265 'Close the current icon editor window')) |
265 'Close the current icon editor window')) |
266 self.closeAct.setWhatsThis(self.trUtf8( |
266 self.closeAct.setWhatsThis(self.tr( |
267 """<b>Close</b>""" |
267 """<b>Close</b>""" |
268 """<p>Closes the current icon editor window.</p>""" |
268 """<p>Closes the current icon editor window.</p>""" |
269 )) |
269 )) |
270 self.closeAct.triggered[()].connect(self.close) |
270 self.closeAct.triggered[()].connect(self.close) |
271 self.__actions.append(self.closeAct) |
271 self.__actions.append(self.closeAct) |
272 |
272 |
273 self.closeAllAct = E5Action( |
273 self.closeAllAct = E5Action( |
274 self.trUtf8('Close All'), |
274 self.tr('Close All'), |
275 self.trUtf8('Close &All'), |
275 self.tr('Close &All'), |
276 0, 0, self, 'iconEditor_file_close_all') |
276 0, 0, self, 'iconEditor_file_close_all') |
277 self.closeAllAct.setStatusTip(self.trUtf8( |
277 self.closeAllAct.setStatusTip(self.tr( |
278 'Close all icon editor windows')) |
278 'Close all icon editor windows')) |
279 self.closeAllAct.setWhatsThis(self.trUtf8( |
279 self.closeAllAct.setWhatsThis(self.tr( |
280 """<b>Close All</b>""" |
280 """<b>Close All</b>""" |
281 """<p>Closes all icon editor windows except the first one.</p>""" |
281 """<p>Closes all icon editor windows except the first one.</p>""" |
282 )) |
282 )) |
283 self.closeAllAct.triggered[()].connect(self.__closeAll) |
283 self.closeAllAct.triggered[()].connect(self.__closeAll) |
284 self.__actions.append(self.closeAllAct) |
284 self.__actions.append(self.closeAllAct) |
285 |
285 |
286 self.exitAct = E5Action( |
286 self.exitAct = E5Action( |
287 self.trUtf8('Quit'), |
287 self.tr('Quit'), |
288 UI.PixmapCache.getIcon("exit.png"), |
288 UI.PixmapCache.getIcon("exit.png"), |
289 self.trUtf8('&Quit'), |
289 self.tr('&Quit'), |
290 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), |
290 QKeySequence(self.tr("Ctrl+Q", "File|Quit")), |
291 0, self, 'iconEditor_file_quit') |
291 0, self, 'iconEditor_file_quit') |
292 self.exitAct.setStatusTip(self.trUtf8('Quit the icon editor')) |
292 self.exitAct.setStatusTip(self.tr('Quit the icon editor')) |
293 self.exitAct.setWhatsThis(self.trUtf8( |
293 self.exitAct.setWhatsThis(self.tr( |
294 """<b>Quit</b>""" |
294 """<b>Quit</b>""" |
295 """<p>Quit the icon editor.</p>""" |
295 """<p>Quit the icon editor.</p>""" |
296 )) |
296 )) |
297 if not self.fromEric: |
297 if not self.fromEric: |
298 self.exitAct.triggered[()].connect(self.__closeAll) |
298 self.exitAct.triggered[()].connect(self.__closeAll) |
301 def __initEditActions(self): |
301 def __initEditActions(self): |
302 """ |
302 """ |
303 Private method to create the Edit actions. |
303 Private method to create the Edit actions. |
304 """ |
304 """ |
305 self.undoAct = E5Action( |
305 self.undoAct = E5Action( |
306 self.trUtf8('Undo'), |
306 self.tr('Undo'), |
307 UI.PixmapCache.getIcon("editUndo.png"), |
307 UI.PixmapCache.getIcon("editUndo.png"), |
308 self.trUtf8('&Undo'), |
308 self.tr('&Undo'), |
309 QKeySequence(self.trUtf8("Ctrl+Z", "Edit|Undo")), |
309 QKeySequence(self.tr("Ctrl+Z", "Edit|Undo")), |
310 QKeySequence(self.trUtf8("Alt+Backspace", "Edit|Undo")), |
310 QKeySequence(self.tr("Alt+Backspace", "Edit|Undo")), |
311 self, 'iconEditor_edit_undo') |
311 self, 'iconEditor_edit_undo') |
312 self.undoAct.setStatusTip(self.trUtf8('Undo the last change')) |
312 self.undoAct.setStatusTip(self.tr('Undo the last change')) |
313 self.undoAct.setWhatsThis(self.trUtf8( |
313 self.undoAct.setWhatsThis(self.tr( |
314 """<b>Undo</b>""" |
314 """<b>Undo</b>""" |
315 """<p>Undo the last change done.</p>""" |
315 """<p>Undo the last change done.</p>""" |
316 )) |
316 )) |
317 self.undoAct.triggered[()].connect(self.__editor.editUndo) |
317 self.undoAct.triggered[()].connect(self.__editor.editUndo) |
318 self.__actions.append(self.undoAct) |
318 self.__actions.append(self.undoAct) |
319 |
319 |
320 self.redoAct = E5Action( |
320 self.redoAct = E5Action( |
321 self.trUtf8('Redo'), |
321 self.tr('Redo'), |
322 UI.PixmapCache.getIcon("editRedo.png"), |
322 UI.PixmapCache.getIcon("editRedo.png"), |
323 self.trUtf8('&Redo'), |
323 self.tr('&Redo'), |
324 QKeySequence(self.trUtf8("Ctrl+Shift+Z", "Edit|Redo")), |
324 QKeySequence(self.tr("Ctrl+Shift+Z", "Edit|Redo")), |
325 0, self, 'iconEditor_edit_redo') |
325 0, self, 'iconEditor_edit_redo') |
326 self.redoAct.setStatusTip(self.trUtf8('Redo the last change')) |
326 self.redoAct.setStatusTip(self.tr('Redo the last change')) |
327 self.redoAct.setWhatsThis(self.trUtf8( |
327 self.redoAct.setWhatsThis(self.tr( |
328 """<b>Redo</b>""" |
328 """<b>Redo</b>""" |
329 """<p>Redo the last change done.</p>""" |
329 """<p>Redo the last change done.</p>""" |
330 )) |
330 )) |
331 self.redoAct.triggered[()].connect(self.__editor.editRedo) |
331 self.redoAct.triggered[()].connect(self.__editor.editRedo) |
332 self.__actions.append(self.redoAct) |
332 self.__actions.append(self.redoAct) |
333 |
333 |
334 self.cutAct = E5Action( |
334 self.cutAct = E5Action( |
335 self.trUtf8('Cut'), |
335 self.tr('Cut'), |
336 UI.PixmapCache.getIcon("editCut.png"), |
336 UI.PixmapCache.getIcon("editCut.png"), |
337 self.trUtf8('Cu&t'), |
337 self.tr('Cu&t'), |
338 QKeySequence(self.trUtf8("Ctrl+X", "Edit|Cut")), |
338 QKeySequence(self.tr("Ctrl+X", "Edit|Cut")), |
339 QKeySequence(self.trUtf8("Shift+Del", "Edit|Cut")), |
339 QKeySequence(self.tr("Shift+Del", "Edit|Cut")), |
340 self, 'iconEditor_edit_cut') |
340 self, 'iconEditor_edit_cut') |
341 self.cutAct.setStatusTip(self.trUtf8('Cut the selection')) |
341 self.cutAct.setStatusTip(self.tr('Cut the selection')) |
342 self.cutAct.setWhatsThis(self.trUtf8( |
342 self.cutAct.setWhatsThis(self.tr( |
343 """<b>Cut</b>""" |
343 """<b>Cut</b>""" |
344 """<p>Cut the selected image area to the clipboard.</p>""" |
344 """<p>Cut the selected image area to the clipboard.</p>""" |
345 )) |
345 )) |
346 self.cutAct.triggered[()].connect(self.__editor.editCut) |
346 self.cutAct.triggered[()].connect(self.__editor.editCut) |
347 self.__actions.append(self.cutAct) |
347 self.__actions.append(self.cutAct) |
348 |
348 |
349 self.copyAct = E5Action( |
349 self.copyAct = E5Action( |
350 self.trUtf8('Copy'), |
350 self.tr('Copy'), |
351 UI.PixmapCache.getIcon("editCopy.png"), |
351 UI.PixmapCache.getIcon("editCopy.png"), |
352 self.trUtf8('&Copy'), |
352 self.tr('&Copy'), |
353 QKeySequence(self.trUtf8("Ctrl+C", "Edit|Copy")), |
353 QKeySequence(self.tr("Ctrl+C", "Edit|Copy")), |
354 QKeySequence(self.trUtf8("Ctrl+Ins", "Edit|Copy")), |
354 QKeySequence(self.tr("Ctrl+Ins", "Edit|Copy")), |
355 self, 'iconEditor_edit_copy') |
355 self, 'iconEditor_edit_copy') |
356 self.copyAct.setStatusTip(self.trUtf8('Copy the selection')) |
356 self.copyAct.setStatusTip(self.tr('Copy the selection')) |
357 self.copyAct.setWhatsThis(self.trUtf8( |
357 self.copyAct.setWhatsThis(self.tr( |
358 """<b>Copy</b>""" |
358 """<b>Copy</b>""" |
359 """<p>Copy the selected image area to the clipboard.</p>""" |
359 """<p>Copy the selected image area to the clipboard.</p>""" |
360 )) |
360 )) |
361 self.copyAct.triggered[()].connect(self.__editor.editCopy) |
361 self.copyAct.triggered[()].connect(self.__editor.editCopy) |
362 self.__actions.append(self.copyAct) |
362 self.__actions.append(self.copyAct) |
363 |
363 |
364 self.pasteAct = E5Action( |
364 self.pasteAct = E5Action( |
365 self.trUtf8('Paste'), |
365 self.tr('Paste'), |
366 UI.PixmapCache.getIcon("editPaste.png"), |
366 UI.PixmapCache.getIcon("editPaste.png"), |
367 self.trUtf8('&Paste'), |
367 self.tr('&Paste'), |
368 QKeySequence(self.trUtf8("Ctrl+V", "Edit|Paste")), |
368 QKeySequence(self.tr("Ctrl+V", "Edit|Paste")), |
369 QKeySequence(self.trUtf8("Shift+Ins", "Edit|Paste")), |
369 QKeySequence(self.tr("Shift+Ins", "Edit|Paste")), |
370 self, 'iconEditor_edit_paste') |
370 self, 'iconEditor_edit_paste') |
371 self.pasteAct.setStatusTip(self.trUtf8('Paste the clipboard image')) |
371 self.pasteAct.setStatusTip(self.tr('Paste the clipboard image')) |
372 self.pasteAct.setWhatsThis(self.trUtf8( |
372 self.pasteAct.setWhatsThis(self.tr( |
373 """<b>Paste</b>""" |
373 """<b>Paste</b>""" |
374 """<p>Paste the clipboard image.</p>""" |
374 """<p>Paste the clipboard image.</p>""" |
375 )) |
375 )) |
376 self.pasteAct.triggered[()].connect(self.__editor.editPaste) |
376 self.pasteAct.triggered[()].connect(self.__editor.editPaste) |
377 self.__actions.append(self.pasteAct) |
377 self.__actions.append(self.pasteAct) |
378 |
378 |
379 self.pasteNewAct = E5Action( |
379 self.pasteNewAct = E5Action( |
380 self.trUtf8('Paste as New'), |
380 self.tr('Paste as New'), |
381 self.trUtf8('Paste as &New'), |
381 self.tr('Paste as &New'), |
382 0, 0, self, 'iconEditor_edit_paste_as_new') |
382 0, 0, self, 'iconEditor_edit_paste_as_new') |
383 self.pasteNewAct.setStatusTip(self.trUtf8( |
383 self.pasteNewAct.setStatusTip(self.tr( |
384 'Paste the clipboard image replacing the current one')) |
384 'Paste the clipboard image replacing the current one')) |
385 self.pasteNewAct.setWhatsThis(self.trUtf8( |
385 self.pasteNewAct.setWhatsThis(self.tr( |
386 """<b>Paste as New</b>""" |
386 """<b>Paste as New</b>""" |
387 """<p>Paste the clipboard image replacing the current one.</p>""" |
387 """<p>Paste the clipboard image replacing the current one.</p>""" |
388 )) |
388 )) |
389 self.pasteNewAct.triggered[()].connect(self.__editor.editPasteAsNew) |
389 self.pasteNewAct.triggered[()].connect(self.__editor.editPasteAsNew) |
390 self.__actions.append(self.pasteNewAct) |
390 self.__actions.append(self.pasteNewAct) |
391 |
391 |
392 self.deleteAct = E5Action( |
392 self.deleteAct = E5Action( |
393 self.trUtf8('Clear'), |
393 self.tr('Clear'), |
394 UI.PixmapCache.getIcon("editDelete.png"), |
394 UI.PixmapCache.getIcon("editDelete.png"), |
395 self.trUtf8('Cl&ear'), |
395 self.tr('Cl&ear'), |
396 QKeySequence(self.trUtf8("Alt+Shift+C", "Edit|Clear")), |
396 QKeySequence(self.tr("Alt+Shift+C", "Edit|Clear")), |
397 0, |
397 0, |
398 self, 'iconEditor_edit_clear') |
398 self, 'iconEditor_edit_clear') |
399 self.deleteAct.setStatusTip(self.trUtf8('Clear the icon image')) |
399 self.deleteAct.setStatusTip(self.tr('Clear the icon image')) |
400 self.deleteAct.setWhatsThis(self.trUtf8( |
400 self.deleteAct.setWhatsThis(self.tr( |
401 """<b>Clear</b>""" |
401 """<b>Clear</b>""" |
402 """<p>Clear the icon image and set it to be completely""" |
402 """<p>Clear the icon image and set it to be completely""" |
403 """ transparent.</p>""" |
403 """ transparent.</p>""" |
404 )) |
404 )) |
405 self.deleteAct.triggered[()].connect(self.__editor.editClear) |
405 self.deleteAct.triggered[()].connect(self.__editor.editClear) |
406 self.__actions.append(self.deleteAct) |
406 self.__actions.append(self.deleteAct) |
407 |
407 |
408 self.selectAllAct = E5Action( |
408 self.selectAllAct = E5Action( |
409 self.trUtf8('Select All'), |
409 self.tr('Select All'), |
410 self.trUtf8('&Select All'), |
410 self.tr('&Select All'), |
411 QKeySequence(self.trUtf8("Ctrl+A", "Edit|Select All")), |
411 QKeySequence(self.tr("Ctrl+A", "Edit|Select All")), |
412 0, |
412 0, |
413 self, 'iconEditor_edit_select_all') |
413 self, 'iconEditor_edit_select_all') |
414 self.selectAllAct.setStatusTip(self.trUtf8( |
414 self.selectAllAct.setStatusTip(self.tr( |
415 'Select the complete icon image')) |
415 'Select the complete icon image')) |
416 self.selectAllAct.setWhatsThis(self.trUtf8( |
416 self.selectAllAct.setWhatsThis(self.tr( |
417 """<b>Select All</b>""" |
417 """<b>Select All</b>""" |
418 """<p>Selects the complete icon image.</p>""" |
418 """<p>Selects the complete icon image.</p>""" |
419 )) |
419 )) |
420 self.selectAllAct.triggered[()].connect(self.__editor.editSelectAll) |
420 self.selectAllAct.triggered[()].connect(self.__editor.editSelectAll) |
421 self.__actions.append(self.selectAllAct) |
421 self.__actions.append(self.selectAllAct) |
422 |
422 |
423 self.resizeAct = E5Action( |
423 self.resizeAct = E5Action( |
424 self.trUtf8('Change Size'), |
424 self.tr('Change Size'), |
425 UI.PixmapCache.getIcon("transformResize.png"), |
425 UI.PixmapCache.getIcon("transformResize.png"), |
426 self.trUtf8('Change Si&ze...'), |
426 self.tr('Change Si&ze...'), |
427 0, 0, |
427 0, 0, |
428 self, 'iconEditor_edit_change_size') |
428 self, 'iconEditor_edit_change_size') |
429 self.resizeAct.setStatusTip(self.trUtf8('Change the icon size')) |
429 self.resizeAct.setStatusTip(self.tr('Change the icon size')) |
430 self.resizeAct.setWhatsThis(self.trUtf8( |
430 self.resizeAct.setWhatsThis(self.tr( |
431 """<b>Change Size...</b>""" |
431 """<b>Change Size...</b>""" |
432 """<p>Changes the icon size.</p>""" |
432 """<p>Changes the icon size.</p>""" |
433 )) |
433 )) |
434 self.resizeAct.triggered[()].connect(self.__editor.editResize) |
434 self.resizeAct.triggered[()].connect(self.__editor.editResize) |
435 self.__actions.append(self.resizeAct) |
435 self.__actions.append(self.resizeAct) |
436 |
436 |
437 self.grayscaleAct = E5Action( |
437 self.grayscaleAct = E5Action( |
438 self.trUtf8('Grayscale'), |
438 self.tr('Grayscale'), |
439 UI.PixmapCache.getIcon("grayscale.png"), |
439 UI.PixmapCache.getIcon("grayscale.png"), |
440 self.trUtf8('&Grayscale'), |
440 self.tr('&Grayscale'), |
441 0, 0, |
441 0, 0, |
442 self, 'iconEditor_edit_grayscale') |
442 self, 'iconEditor_edit_grayscale') |
443 self.grayscaleAct.setStatusTip(self.trUtf8( |
443 self.grayscaleAct.setStatusTip(self.tr( |
444 'Change the icon to grayscale')) |
444 'Change the icon to grayscale')) |
445 self.grayscaleAct.setWhatsThis(self.trUtf8( |
445 self.grayscaleAct.setWhatsThis(self.tr( |
446 """<b>Grayscale</b>""" |
446 """<b>Grayscale</b>""" |
447 """<p>Changes the icon to grayscale.</p>""" |
447 """<p>Changes the icon to grayscale.</p>""" |
448 )) |
448 )) |
449 self.grayscaleAct.triggered[()].connect(self.__editor.grayScale) |
449 self.grayscaleAct.triggered[()].connect(self.__editor.grayScale) |
450 self.__actions.append(self.grayscaleAct) |
450 self.__actions.append(self.grayscaleAct) |
470 def __initViewActions(self): |
470 def __initViewActions(self): |
471 """ |
471 """ |
472 Private method to create the View actions. |
472 Private method to create the View actions. |
473 """ |
473 """ |
474 self.zoomInAct = E5Action( |
474 self.zoomInAct = E5Action( |
475 self.trUtf8('Zoom in'), |
475 self.tr('Zoom in'), |
476 UI.PixmapCache.getIcon("zoomIn.png"), |
476 UI.PixmapCache.getIcon("zoomIn.png"), |
477 self.trUtf8('Zoom &in'), |
477 self.tr('Zoom &in'), |
478 QKeySequence(self.trUtf8("Ctrl++", "View|Zoom in")), |
478 QKeySequence(self.tr("Ctrl++", "View|Zoom in")), |
479 0, self, 'iconEditor_view_zoom_in') |
479 0, self, 'iconEditor_view_zoom_in') |
480 self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the icon')) |
480 self.zoomInAct.setStatusTip(self.tr('Zoom in on the icon')) |
481 self.zoomInAct.setWhatsThis(self.trUtf8( |
481 self.zoomInAct.setWhatsThis(self.tr( |
482 """<b>Zoom in</b>""" |
482 """<b>Zoom in</b>""" |
483 """<p>Zoom in on the icon. This makes the grid bigger.</p>""" |
483 """<p>Zoom in on the icon. This makes the grid bigger.</p>""" |
484 )) |
484 )) |
485 self.zoomInAct.triggered[()].connect(self.__zoomIn) |
485 self.zoomInAct.triggered[()].connect(self.__zoomIn) |
486 self.__actions.append(self.zoomInAct) |
486 self.__actions.append(self.zoomInAct) |
487 |
487 |
488 self.zoomOutAct = E5Action( |
488 self.zoomOutAct = E5Action( |
489 self.trUtf8('Zoom out'), |
489 self.tr('Zoom out'), |
490 UI.PixmapCache.getIcon("zoomOut.png"), |
490 UI.PixmapCache.getIcon("zoomOut.png"), |
491 self.trUtf8('Zoom &out'), |
491 self.tr('Zoom &out'), |
492 QKeySequence(self.trUtf8("Ctrl+-", "View|Zoom out")), |
492 QKeySequence(self.tr("Ctrl+-", "View|Zoom out")), |
493 0, self, 'iconEditor_view_zoom_out') |
493 0, self, 'iconEditor_view_zoom_out') |
494 self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the icon')) |
494 self.zoomOutAct.setStatusTip(self.tr('Zoom out on the icon')) |
495 self.zoomOutAct.setWhatsThis(self.trUtf8( |
495 self.zoomOutAct.setWhatsThis(self.tr( |
496 """<b>Zoom out</b>""" |
496 """<b>Zoom out</b>""" |
497 """<p>Zoom out on the icon. This makes the grid smaller.</p>""" |
497 """<p>Zoom out on the icon. This makes the grid smaller.</p>""" |
498 )) |
498 )) |
499 self.zoomOutAct.triggered[()].connect(self.__zoomOut) |
499 self.zoomOutAct.triggered[()].connect(self.__zoomOut) |
500 self.__actions.append(self.zoomOutAct) |
500 self.__actions.append(self.zoomOutAct) |
501 |
501 |
502 self.zoomResetAct = E5Action( |
502 self.zoomResetAct = E5Action( |
503 self.trUtf8('Zoom reset'), |
503 self.tr('Zoom reset'), |
504 UI.PixmapCache.getIcon("zoomReset.png"), |
504 UI.PixmapCache.getIcon("zoomReset.png"), |
505 self.trUtf8('Zoom &reset'), |
505 self.tr('Zoom &reset'), |
506 QKeySequence(self.trUtf8("Ctrl+0", "View|Zoom reset")), |
506 QKeySequence(self.tr("Ctrl+0", "View|Zoom reset")), |
507 0, self, 'iconEditor_view_zoom_reset') |
507 0, self, 'iconEditor_view_zoom_reset') |
508 self.zoomResetAct.setStatusTip(self.trUtf8( |
508 self.zoomResetAct.setStatusTip(self.tr( |
509 'Reset the zoom of the icon')) |
509 'Reset the zoom of the icon')) |
510 self.zoomResetAct.setWhatsThis(self.trUtf8( |
510 self.zoomResetAct.setWhatsThis(self.tr( |
511 """<b>Zoom reset</b>""" |
511 """<b>Zoom reset</b>""" |
512 """<p>Reset the zoom of the icon. """ |
512 """<p>Reset the zoom of the icon. """ |
513 """This sets the zoom factor to 100%.</p>""" |
513 """This sets the zoom factor to 100%.</p>""" |
514 )) |
514 )) |
515 self.zoomResetAct.triggered[()].connect(self.__zoomReset) |
515 self.zoomResetAct.triggered[()].connect(self.__zoomReset) |
516 self.__actions.append(self.zoomResetAct) |
516 self.__actions.append(self.zoomResetAct) |
517 |
517 |
518 self.showGridAct = E5Action( |
518 self.showGridAct = E5Action( |
519 self.trUtf8('Show Grid'), |
519 self.tr('Show Grid'), |
520 UI.PixmapCache.getIcon("grid.png"), |
520 UI.PixmapCache.getIcon("grid.png"), |
521 self.trUtf8('Show &Grid'), |
521 self.tr('Show &Grid'), |
522 0, 0, |
522 0, 0, |
523 self, 'iconEditor_view_show_grid') |
523 self, 'iconEditor_view_show_grid') |
524 self.showGridAct.setStatusTip(self.trUtf8( |
524 self.showGridAct.setStatusTip(self.tr( |
525 'Toggle the display of the grid')) |
525 'Toggle the display of the grid')) |
526 self.showGridAct.setWhatsThis(self.trUtf8( |
526 self.showGridAct.setWhatsThis(self.tr( |
527 """<b>Show Grid</b>""" |
527 """<b>Show Grid</b>""" |
528 """<p>Toggle the display of the grid.</p>""" |
528 """<p>Toggle the display of the grid.</p>""" |
529 )) |
529 )) |
530 self.showGridAct.triggered[bool].connect(self.__editor.setGridEnabled) |
530 self.showGridAct.triggered[bool].connect(self.__editor.setGridEnabled) |
531 self.__actions.append(self.showGridAct) |
531 self.__actions.append(self.showGridAct) |
573 IconEditorGrid.ColorPicker) |
573 IconEditorGrid.ColorPicker) |
574 self.drawColorPickerAct.triggered[()].connect(self.esm.map) |
574 self.drawColorPickerAct.triggered[()].connect(self.esm.map) |
575 self.__actions.append(self.drawColorPickerAct) |
575 self.__actions.append(self.drawColorPickerAct) |
576 |
576 |
577 self.drawRectangleAct = E5Action( |
577 self.drawRectangleAct = E5Action( |
578 self.trUtf8('Rectangle'), |
578 self.tr('Rectangle'), |
579 UI.PixmapCache.getIcon("drawRectangle.png"), |
579 UI.PixmapCache.getIcon("drawRectangle.png"), |
580 self.trUtf8('&Rectangle'), |
580 self.tr('&Rectangle'), |
581 0, 0, |
581 0, 0, |
582 self.drawingActGrp, 'iconEditor_tools_rectangle') |
582 self.drawingActGrp, 'iconEditor_tools_rectangle') |
583 self.drawRectangleAct.setWhatsThis(self.trUtf8( |
583 self.drawRectangleAct.setWhatsThis(self.tr( |
584 """<b>Rectangle</b>""" |
584 """<b>Rectangle</b>""" |
585 """<p>Draw a rectangle.</p>""" |
585 """<p>Draw a rectangle.</p>""" |
586 )) |
586 )) |
587 self.drawRectangleAct.setCheckable(True) |
587 self.drawRectangleAct.setCheckable(True) |
588 self.esm.setMapping(self.drawRectangleAct, IconEditorGrid.Rectangle) |
588 self.esm.setMapping(self.drawRectangleAct, IconEditorGrid.Rectangle) |
589 self.drawRectangleAct.triggered[()].connect(self.esm.map) |
589 self.drawRectangleAct.triggered[()].connect(self.esm.map) |
590 self.__actions.append(self.drawRectangleAct) |
590 self.__actions.append(self.drawRectangleAct) |
591 |
591 |
592 self.drawFilledRectangleAct = E5Action( |
592 self.drawFilledRectangleAct = E5Action( |
593 self.trUtf8('Filled Rectangle'), |
593 self.tr('Filled Rectangle'), |
594 UI.PixmapCache.getIcon("drawRectangleFilled.png"), |
594 UI.PixmapCache.getIcon("drawRectangleFilled.png"), |
595 self.trUtf8('F&illed Rectangle'), |
595 self.tr('F&illed Rectangle'), |
596 0, 0, |
596 0, 0, |
597 self.drawingActGrp, 'iconEditor_tools_filled_rectangle') |
597 self.drawingActGrp, 'iconEditor_tools_filled_rectangle') |
598 self.drawFilledRectangleAct.setWhatsThis(self.trUtf8( |
598 self.drawFilledRectangleAct.setWhatsThis(self.tr( |
599 """<b>Filled Rectangle</b>""" |
599 """<b>Filled Rectangle</b>""" |
600 """<p>Draw a filled rectangle.</p>""" |
600 """<p>Draw a filled rectangle.</p>""" |
601 )) |
601 )) |
602 self.drawFilledRectangleAct.setCheckable(True) |
602 self.drawFilledRectangleAct.setCheckable(True) |
603 self.esm.setMapping(self.drawFilledRectangleAct, |
603 self.esm.setMapping(self.drawFilledRectangleAct, |
604 IconEditorGrid.FilledRectangle) |
604 IconEditorGrid.FilledRectangle) |
605 self.drawFilledRectangleAct.triggered[()].connect(self.esm.map) |
605 self.drawFilledRectangleAct.triggered[()].connect(self.esm.map) |
606 self.__actions.append(self.drawFilledRectangleAct) |
606 self.__actions.append(self.drawFilledRectangleAct) |
607 |
607 |
608 self.drawCircleAct = E5Action( |
608 self.drawCircleAct = E5Action( |
609 self.trUtf8('Circle'), |
609 self.tr('Circle'), |
610 UI.PixmapCache.getIcon("drawCircle.png"), |
610 UI.PixmapCache.getIcon("drawCircle.png"), |
611 self.trUtf8('Circle'), |
611 self.tr('Circle'), |
612 0, 0, |
612 0, 0, |
613 self.drawingActGrp, 'iconEditor_tools_circle') |
613 self.drawingActGrp, 'iconEditor_tools_circle') |
614 self.drawCircleAct.setWhatsThis(self.trUtf8( |
614 self.drawCircleAct.setWhatsThis(self.tr( |
615 """<b>Circle</b>""" |
615 """<b>Circle</b>""" |
616 """<p>Draw a circle.</p>""" |
616 """<p>Draw a circle.</p>""" |
617 )) |
617 )) |
618 self.drawCircleAct.setCheckable(True) |
618 self.drawCircleAct.setCheckable(True) |
619 self.esm.setMapping(self.drawCircleAct, IconEditorGrid.Circle) |
619 self.esm.setMapping(self.drawCircleAct, IconEditorGrid.Circle) |
620 self.drawCircleAct.triggered[()].connect(self.esm.map) |
620 self.drawCircleAct.triggered[()].connect(self.esm.map) |
621 self.__actions.append(self.drawCircleAct) |
621 self.__actions.append(self.drawCircleAct) |
622 |
622 |
623 self.drawFilledCircleAct = E5Action( |
623 self.drawFilledCircleAct = E5Action( |
624 self.trUtf8('Filled Circle'), |
624 self.tr('Filled Circle'), |
625 UI.PixmapCache.getIcon("drawCircleFilled.png"), |
625 UI.PixmapCache.getIcon("drawCircleFilled.png"), |
626 self.trUtf8('Fille&d Circle'), |
626 self.tr('Fille&d Circle'), |
627 0, 0, |
627 0, 0, |
628 self.drawingActGrp, 'iconEditor_tools_filled_circle') |
628 self.drawingActGrp, 'iconEditor_tools_filled_circle') |
629 self.drawFilledCircleAct.setWhatsThis(self.trUtf8( |
629 self.drawFilledCircleAct.setWhatsThis(self.tr( |
630 """<b>Filled Circle</b>""" |
630 """<b>Filled Circle</b>""" |
631 """<p>Draw a filled circle.</p>""" |
631 """<p>Draw a filled circle.</p>""" |
632 )) |
632 )) |
633 self.drawFilledCircleAct.setCheckable(True) |
633 self.drawFilledCircleAct.setCheckable(True) |
634 self.esm.setMapping(self.drawFilledCircleAct, |
634 self.esm.setMapping(self.drawFilledCircleAct, |
635 IconEditorGrid.FilledCircle) |
635 IconEditorGrid.FilledCircle) |
636 self.drawFilledCircleAct.triggered[()].connect(self.esm.map) |
636 self.drawFilledCircleAct.triggered[()].connect(self.esm.map) |
637 self.__actions.append(self.drawFilledCircleAct) |
637 self.__actions.append(self.drawFilledCircleAct) |
638 |
638 |
639 self.drawEllipseAct = E5Action( |
639 self.drawEllipseAct = E5Action( |
640 self.trUtf8('Ellipse'), |
640 self.tr('Ellipse'), |
641 UI.PixmapCache.getIcon("drawEllipse.png"), |
641 UI.PixmapCache.getIcon("drawEllipse.png"), |
642 self.trUtf8('&Ellipse'), |
642 self.tr('&Ellipse'), |
643 0, 0, |
643 0, 0, |
644 self.drawingActGrp, 'iconEditor_tools_ellipse') |
644 self.drawingActGrp, 'iconEditor_tools_ellipse') |
645 self.drawEllipseAct.setWhatsThis(self.trUtf8( |
645 self.drawEllipseAct.setWhatsThis(self.tr( |
646 """<b>Ellipse</b>""" |
646 """<b>Ellipse</b>""" |
647 """<p>Draw an ellipse.</p>""" |
647 """<p>Draw an ellipse.</p>""" |
648 )) |
648 )) |
649 self.drawEllipseAct.setCheckable(True) |
649 self.drawEllipseAct.setCheckable(True) |
650 self.esm.setMapping(self.drawEllipseAct, IconEditorGrid.Ellipse) |
650 self.esm.setMapping(self.drawEllipseAct, IconEditorGrid.Ellipse) |
651 self.drawEllipseAct.triggered[()].connect(self.esm.map) |
651 self.drawEllipseAct.triggered[()].connect(self.esm.map) |
652 self.__actions.append(self.drawEllipseAct) |
652 self.__actions.append(self.drawEllipseAct) |
653 |
653 |
654 self.drawFilledEllipseAct = E5Action( |
654 self.drawFilledEllipseAct = E5Action( |
655 self.trUtf8('Filled Ellipse'), |
655 self.tr('Filled Ellipse'), |
656 UI.PixmapCache.getIcon("drawEllipseFilled.png"), |
656 UI.PixmapCache.getIcon("drawEllipseFilled.png"), |
657 self.trUtf8('Fille&d Elli&pse'), |
657 self.tr('Fille&d Elli&pse'), |
658 0, 0, |
658 0, 0, |
659 self.drawingActGrp, 'iconEditor_tools_filled_ellipse') |
659 self.drawingActGrp, 'iconEditor_tools_filled_ellipse') |
660 self.drawFilledEllipseAct.setWhatsThis(self.trUtf8( |
660 self.drawFilledEllipseAct.setWhatsThis(self.tr( |
661 """<b>Filled Ellipse</b>""" |
661 """<b>Filled Ellipse</b>""" |
662 """<p>Draw a filled ellipse.</p>""" |
662 """<p>Draw a filled ellipse.</p>""" |
663 )) |
663 )) |
664 self.drawFilledEllipseAct.setCheckable(True) |
664 self.drawFilledEllipseAct.setCheckable(True) |
665 self.esm.setMapping(self.drawFilledEllipseAct, |
665 self.esm.setMapping(self.drawFilledEllipseAct, |
666 IconEditorGrid.FilledEllipse) |
666 IconEditorGrid.FilledEllipse) |
667 self.drawFilledEllipseAct.triggered[()].connect(self.esm.map) |
667 self.drawFilledEllipseAct.triggered[()].connect(self.esm.map) |
668 self.__actions.append(self.drawFilledEllipseAct) |
668 self.__actions.append(self.drawFilledEllipseAct) |
669 |
669 |
670 self.drawFloodFillAct = E5Action( |
670 self.drawFloodFillAct = E5Action( |
671 self.trUtf8('Flood Fill'), |
671 self.tr('Flood Fill'), |
672 UI.PixmapCache.getIcon("drawFill.png"), |
672 UI.PixmapCache.getIcon("drawFill.png"), |
673 self.trUtf8('Fl&ood Fill'), |
673 self.tr('Fl&ood Fill'), |
674 0, 0, |
674 0, 0, |
675 self.drawingActGrp, 'iconEditor_tools_flood_fill') |
675 self.drawingActGrp, 'iconEditor_tools_flood_fill') |
676 self.drawFloodFillAct.setWhatsThis(self.trUtf8( |
676 self.drawFloodFillAct.setWhatsThis(self.tr( |
677 """<b>Flood Fill</b>""" |
677 """<b>Flood Fill</b>""" |
678 """<p>Fill adjoining pixels with the same color with """ |
678 """<p>Fill adjoining pixels with the same color with """ |
679 """the current color.</p>""" |
679 """the current color.</p>""" |
680 )) |
680 )) |
681 self.drawFloodFillAct.setCheckable(True) |
681 self.drawFloodFillAct.setCheckable(True) |
682 self.esm.setMapping(self.drawFloodFillAct, IconEditorGrid.Fill) |
682 self.esm.setMapping(self.drawFloodFillAct, IconEditorGrid.Fill) |
683 self.drawFloodFillAct.triggered[()].connect(self.esm.map) |
683 self.drawFloodFillAct.triggered[()].connect(self.esm.map) |
684 self.__actions.append(self.drawFloodFillAct) |
684 self.__actions.append(self.drawFloodFillAct) |
685 |
685 |
686 self.drawLineAct = E5Action( |
686 self.drawLineAct = E5Action( |
687 self.trUtf8('Line'), |
687 self.tr('Line'), |
688 UI.PixmapCache.getIcon("drawLine.png"), |
688 UI.PixmapCache.getIcon("drawLine.png"), |
689 self.trUtf8('&Line'), |
689 self.tr('&Line'), |
690 0, 0, |
690 0, 0, |
691 self.drawingActGrp, 'iconEditor_tools_line') |
691 self.drawingActGrp, 'iconEditor_tools_line') |
692 self.drawLineAct.setWhatsThis(self.trUtf8( |
692 self.drawLineAct.setWhatsThis(self.tr( |
693 """<b>Line</b>""" |
693 """<b>Line</b>""" |
694 """<p>Draw a line.</p>""" |
694 """<p>Draw a line.</p>""" |
695 )) |
695 )) |
696 self.drawLineAct.setCheckable(True) |
696 self.drawLineAct.setCheckable(True) |
697 self.esm.setMapping(self.drawLineAct, IconEditorGrid.Line) |
697 self.esm.setMapping(self.drawLineAct, IconEditorGrid.Line) |
698 self.drawLineAct.triggered[()].connect(self.esm.map) |
698 self.drawLineAct.triggered[()].connect(self.esm.map) |
699 self.__actions.append(self.drawLineAct) |
699 self.__actions.append(self.drawLineAct) |
700 |
700 |
701 self.drawEraserAct = E5Action( |
701 self.drawEraserAct = E5Action( |
702 self.trUtf8('Eraser (Transparent)'), |
702 self.tr('Eraser (Transparent)'), |
703 UI.PixmapCache.getIcon("drawEraser.png"), |
703 UI.PixmapCache.getIcon("drawEraser.png"), |
704 self.trUtf8('Eraser (&Transparent)'), |
704 self.tr('Eraser (&Transparent)'), |
705 0, 0, |
705 0, 0, |
706 self.drawingActGrp, 'iconEditor_tools_eraser') |
706 self.drawingActGrp, 'iconEditor_tools_eraser') |
707 self.drawEraserAct.setWhatsThis(self.trUtf8( |
707 self.drawEraserAct.setWhatsThis(self.tr( |
708 """<b>Eraser (Transparent)</b>""" |
708 """<b>Eraser (Transparent)</b>""" |
709 """<p>Erase pixels by setting them to transparent.</p>""" |
709 """<p>Erase pixels by setting them to transparent.</p>""" |
710 )) |
710 )) |
711 self.drawEraserAct.setCheckable(True) |
711 self.drawEraserAct.setCheckable(True) |
712 self.esm.setMapping(self.drawEraserAct, IconEditorGrid.Rubber) |
712 self.esm.setMapping(self.drawEraserAct, IconEditorGrid.Rubber) |
713 self.drawEraserAct.triggered[()].connect(self.esm.map) |
713 self.drawEraserAct.triggered[()].connect(self.esm.map) |
714 self.__actions.append(self.drawEraserAct) |
714 self.__actions.append(self.drawEraserAct) |
715 |
715 |
716 self.drawRectangleSelectionAct = E5Action( |
716 self.drawRectangleSelectionAct = E5Action( |
717 self.trUtf8('Rectangular Selection'), |
717 self.tr('Rectangular Selection'), |
718 UI.PixmapCache.getIcon("selectRectangle.png"), |
718 UI.PixmapCache.getIcon("selectRectangle.png"), |
719 self.trUtf8('Rect&angular Selection'), |
719 self.tr('Rect&angular Selection'), |
720 0, 0, |
720 0, 0, |
721 self.drawingActGrp, 'iconEditor_tools_selection_rectangle') |
721 self.drawingActGrp, 'iconEditor_tools_selection_rectangle') |
722 self.drawRectangleSelectionAct.setWhatsThis(self.trUtf8( |
722 self.drawRectangleSelectionAct.setWhatsThis(self.tr( |
723 """<b>Rectangular Selection</b>""" |
723 """<b>Rectangular Selection</b>""" |
724 """<p>Select a rectangular section of the icon using""" |
724 """<p>Select a rectangular section of the icon using""" |
725 """ the mouse.</p>""" |
725 """ the mouse.</p>""" |
726 )) |
726 )) |
727 self.drawRectangleSelectionAct.setCheckable(True) |
727 self.drawRectangleSelectionAct.setCheckable(True) |
752 def __initHelpActions(self): |
752 def __initHelpActions(self): |
753 """ |
753 """ |
754 Private method to create the Help actions. |
754 Private method to create the Help actions. |
755 """ |
755 """ |
756 self.aboutAct = E5Action( |
756 self.aboutAct = E5Action( |
757 self.trUtf8('About'), |
757 self.tr('About'), |
758 self.trUtf8('&About'), |
758 self.tr('&About'), |
759 0, 0, self, 'iconEditor_help_about') |
759 0, 0, self, 'iconEditor_help_about') |
760 self.aboutAct.setStatusTip(self.trUtf8( |
760 self.aboutAct.setStatusTip(self.tr( |
761 'Display information about this software')) |
761 'Display information about this software')) |
762 self.aboutAct.setWhatsThis(self.trUtf8( |
762 self.aboutAct.setWhatsThis(self.tr( |
763 """<b>About</b>""" |
763 """<b>About</b>""" |
764 """<p>Display some information about this software.</p>""")) |
764 """<p>Display some information about this software.</p>""")) |
765 self.aboutAct.triggered[()].connect(self.__about) |
765 self.aboutAct.triggered[()].connect(self.__about) |
766 self.__actions.append(self.aboutAct) |
766 self.__actions.append(self.aboutAct) |
767 |
767 |
768 self.aboutQtAct = E5Action( |
768 self.aboutQtAct = E5Action( |
769 self.trUtf8('About Qt'), |
769 self.tr('About Qt'), |
770 self.trUtf8('About &Qt'), |
770 self.tr('About &Qt'), |
771 0, 0, self, 'iconEditor_help_about_qt') |
771 0, 0, self, 'iconEditor_help_about_qt') |
772 self.aboutQtAct.setStatusTip( |
772 self.aboutQtAct.setStatusTip( |
773 self.trUtf8('Display information about the Qt toolkit')) |
773 self.tr('Display information about the Qt toolkit')) |
774 self.aboutQtAct.setWhatsThis(self.trUtf8( |
774 self.aboutQtAct.setWhatsThis(self.tr( |
775 """<b>About Qt</b>""" |
775 """<b>About Qt</b>""" |
776 """<p>Display some information about the Qt toolkit.</p>""" |
776 """<p>Display some information about the Qt toolkit.</p>""" |
777 )) |
777 )) |
778 self.aboutQtAct.triggered[()].connect(self.__aboutQt) |
778 self.aboutQtAct.triggered[()].connect(self.__aboutQt) |
779 self.__actions.append(self.aboutQtAct) |
779 self.__actions.append(self.aboutQtAct) |
780 |
780 |
781 self.whatsThisAct = E5Action( |
781 self.whatsThisAct = E5Action( |
782 self.trUtf8('What\'s This?'), |
782 self.tr('What\'s This?'), |
783 UI.PixmapCache.getIcon("whatsThis.png"), |
783 UI.PixmapCache.getIcon("whatsThis.png"), |
784 self.trUtf8('&What\'s This?'), |
784 self.tr('&What\'s This?'), |
785 QKeySequence(self.trUtf8("Shift+F1", "Help|What's This?'")), |
785 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")), |
786 0, self, 'iconEditor_help_whats_this') |
786 0, self, 'iconEditor_help_whats_this') |
787 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) |
787 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help')) |
788 self.whatsThisAct.setWhatsThis(self.trUtf8( |
788 self.whatsThisAct.setWhatsThis(self.tr( |
789 """<b>Display context sensitive help</b>""" |
789 """<b>Display context sensitive help</b>""" |
790 """<p>In What's This? mode, the mouse cursor shows an arrow""" |
790 """<p>In What's This? mode, the mouse cursor shows an arrow""" |
791 """ with a question mark, and you can click on the interface""" |
791 """ with a question mark, and you can click on the interface""" |
792 """ elements to get a short description of what they do and""" |
792 """ elements to get a short description of what they do and""" |
793 """ how to use them. In dialogs, this feature can be accessed""" |
793 """ how to use them. In dialogs, this feature can be accessed""" |