184 def __initFileActions(self): |
183 def __initFileActions(self): |
185 """ |
184 """ |
186 Private method to define the file related user interface actions. |
185 Private method to define the file related user interface actions. |
187 """ |
186 """ |
188 self.newAct = E5Action( |
187 self.newAct = E5Action( |
189 self.trUtf8('New'), |
188 self.tr('New'), |
190 UI.PixmapCache.getIcon("new.png"), |
189 UI.PixmapCache.getIcon("new.png"), |
191 self.trUtf8('&New'), |
190 self.tr('&New'), |
192 QKeySequence(self.trUtf8("Ctrl+N", "File|New")), |
191 QKeySequence(self.tr("Ctrl+N", "File|New")), |
193 0, self, 'iconEditor_file_new') |
192 0, self, 'iconEditor_file_new') |
194 self.newAct.setStatusTip(self.trUtf8('Create a new icon')) |
193 self.newAct.setStatusTip(self.tr('Create a new icon')) |
195 self.newAct.setWhatsThis(self.trUtf8( |
194 self.newAct.setWhatsThis(self.tr( |
196 """<b>New</b>""" |
195 """<b>New</b>""" |
197 """<p>This creates a new icon.</p>""" |
196 """<p>This creates a new icon.</p>""" |
198 )) |
197 )) |
199 self.newAct.triggered[()].connect(self.__newIcon) |
198 self.newAct.triggered.connect(self.__newIcon) |
200 self.__actions.append(self.newAct) |
199 self.__actions.append(self.newAct) |
201 |
200 |
202 self.newWindowAct = E5Action( |
201 self.newWindowAct = E5Action( |
203 self.trUtf8('New Window'), |
202 self.tr('New Window'), |
204 UI.PixmapCache.getIcon("newWindow.png"), |
203 UI.PixmapCache.getIcon("newWindow.png"), |
205 self.trUtf8('New &Window'), |
204 self.tr('New &Window'), |
206 0, 0, self, 'iconEditor_file_new_window') |
205 0, 0, self, 'iconEditor_file_new_window') |
207 self.newWindowAct.setStatusTip(self.trUtf8( |
206 self.newWindowAct.setStatusTip(self.tr( |
208 'Open a new icon editor window')) |
207 'Open a new icon editor window')) |
209 self.newWindowAct.setWhatsThis(self.trUtf8( |
208 self.newWindowAct.setWhatsThis(self.tr( |
210 """<b>New Window</b>""" |
209 """<b>New Window</b>""" |
211 """<p>This opens a new icon editor window.</p>""" |
210 """<p>This opens a new icon editor window.</p>""" |
212 )) |
211 )) |
213 self.newWindowAct.triggered[()].connect(self.__newWindow) |
212 self.newWindowAct.triggered.connect(self.__newWindow) |
214 self.__actions.append(self.newWindowAct) |
213 self.__actions.append(self.newWindowAct) |
215 |
214 |
216 self.openAct = E5Action( |
215 self.openAct = E5Action( |
217 self.trUtf8('Open'), |
216 self.tr('Open'), |
218 UI.PixmapCache.getIcon("open.png"), |
217 UI.PixmapCache.getIcon("open.png"), |
219 self.trUtf8('&Open...'), |
218 self.tr('&Open...'), |
220 QKeySequence(self.trUtf8("Ctrl+O", "File|Open")), |
219 QKeySequence(self.tr("Ctrl+O", "File|Open")), |
221 0, self, 'iconEditor_file_open') |
220 0, self, 'iconEditor_file_open') |
222 self.openAct.setStatusTip(self.trUtf8('Open an icon file for editing')) |
221 self.openAct.setStatusTip(self.tr('Open an icon file for editing')) |
223 self.openAct.setWhatsThis(self.trUtf8( |
222 self.openAct.setWhatsThis(self.tr( |
224 """<b>Open File</b>""" |
223 """<b>Open File</b>""" |
225 """<p>This opens a new icon file for editing.""" |
224 """<p>This opens a new icon file for editing.""" |
226 """ It pops up a file selection dialog.</p>""" |
225 """ It pops up a file selection dialog.</p>""" |
227 )) |
226 )) |
228 self.openAct.triggered[()].connect(self.__openIcon) |
227 self.openAct.triggered.connect(self.__openIcon) |
229 self.__actions.append(self.openAct) |
228 self.__actions.append(self.openAct) |
230 |
229 |
231 self.saveAct = E5Action( |
230 self.saveAct = E5Action( |
232 self.trUtf8('Save'), |
231 self.tr('Save'), |
233 UI.PixmapCache.getIcon("fileSave.png"), |
232 UI.PixmapCache.getIcon("fileSave.png"), |
234 self.trUtf8('&Save'), |
233 self.tr('&Save'), |
235 QKeySequence(self.trUtf8("Ctrl+S", "File|Save")), |
234 QKeySequence(self.tr("Ctrl+S", "File|Save")), |
236 0, self, 'iconEditor_file_save') |
235 0, self, 'iconEditor_file_save') |
237 self.saveAct.setStatusTip(self.trUtf8('Save the current icon')) |
236 self.saveAct.setStatusTip(self.tr('Save the current icon')) |
238 self.saveAct.setWhatsThis(self.trUtf8( |
237 self.saveAct.setWhatsThis(self.tr( |
239 """<b>Save File</b>""" |
238 """<b>Save File</b>""" |
240 """<p>Save the contents of the icon editor window.</p>""" |
239 """<p>Save the contents of the icon editor window.</p>""" |
241 )) |
240 )) |
242 self.saveAct.triggered[()].connect(self.__saveIcon) |
241 self.saveAct.triggered.connect(self.__saveIcon) |
243 self.__actions.append(self.saveAct) |
242 self.__actions.append(self.saveAct) |
244 |
243 |
245 self.saveAsAct = E5Action( |
244 self.saveAsAct = E5Action( |
246 self.trUtf8('Save As'), |
245 self.tr('Save As'), |
247 UI.PixmapCache.getIcon("fileSaveAs.png"), |
246 UI.PixmapCache.getIcon("fileSaveAs.png"), |
248 self.trUtf8('Save &As...'), |
247 self.tr('Save &As...'), |
249 QKeySequence(self.trUtf8("Shift+Ctrl+S", "File|Save As")), |
248 QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")), |
250 0, self, 'iconEditor_file_save_as') |
249 0, self, 'iconEditor_file_save_as') |
251 self.saveAsAct.setStatusTip( |
250 self.saveAsAct.setStatusTip( |
252 self.trUtf8('Save the current icon to a new file')) |
251 self.tr('Save the current icon to a new file')) |
253 self.saveAsAct.setWhatsThis(self.trUtf8( |
252 self.saveAsAct.setWhatsThis(self.tr( |
254 """<b>Save As...</b>""" |
253 """<b>Save As...</b>""" |
255 """<p>Saves the current icon to a new file.</p>""" |
254 """<p>Saves the current icon to a new file.</p>""" |
256 )) |
255 )) |
257 self.saveAsAct.triggered[()].connect(self.__saveIconAs) |
256 self.saveAsAct.triggered.connect(self.__saveIconAs) |
258 self.__actions.append(self.saveAsAct) |
257 self.__actions.append(self.saveAsAct) |
259 |
258 |
260 self.closeAct = E5Action( |
259 self.closeAct = E5Action( |
261 self.trUtf8('Close'), |
260 self.tr('Close'), |
262 UI.PixmapCache.getIcon("close.png"), |
261 UI.PixmapCache.getIcon("close.png"), |
263 self.trUtf8('&Close'), |
262 self.tr('&Close'), |
264 QKeySequence(self.trUtf8("Ctrl+W", "File|Close")), |
263 QKeySequence(self.tr("Ctrl+W", "File|Close")), |
265 0, self, 'iconEditor_file_close') |
264 0, self, 'iconEditor_file_close') |
266 self.closeAct.setStatusTip(self.trUtf8( |
265 self.closeAct.setStatusTip(self.tr( |
267 'Close the current icon editor window')) |
266 'Close the current icon editor window')) |
268 self.closeAct.setWhatsThis(self.trUtf8( |
267 self.closeAct.setWhatsThis(self.tr( |
269 """<b>Close</b>""" |
268 """<b>Close</b>""" |
270 """<p>Closes the current icon editor window.</p>""" |
269 """<p>Closes the current icon editor window.</p>""" |
271 )) |
270 )) |
272 self.closeAct.triggered[()].connect(self.close) |
271 self.closeAct.triggered.connect(self.close) |
273 self.__actions.append(self.closeAct) |
272 self.__actions.append(self.closeAct) |
274 |
273 |
275 self.closeAllAct = E5Action( |
274 self.closeAllAct = E5Action( |
276 self.trUtf8('Close All'), |
275 self.tr('Close All'), |
277 self.trUtf8('Close &All'), |
276 self.tr('Close &All'), |
278 0, 0, self, 'iconEditor_file_close_all') |
277 0, 0, self, 'iconEditor_file_close_all') |
279 self.closeAllAct.setStatusTip(self.trUtf8( |
278 self.closeAllAct.setStatusTip(self.tr( |
280 'Close all icon editor windows')) |
279 'Close all icon editor windows')) |
281 self.closeAllAct.setWhatsThis(self.trUtf8( |
280 self.closeAllAct.setWhatsThis(self.tr( |
282 """<b>Close All</b>""" |
281 """<b>Close All</b>""" |
283 """<p>Closes all icon editor windows except the first one.</p>""" |
282 """<p>Closes all icon editor windows except the first one.</p>""" |
284 )) |
283 )) |
285 self.closeAllAct.triggered[()].connect(self.__closeAll) |
284 self.closeAllAct.triggered.connect(self.__closeAll) |
286 self.__actions.append(self.closeAllAct) |
285 self.__actions.append(self.closeAllAct) |
287 |
286 |
288 self.exitAct = E5Action( |
287 self.exitAct = E5Action( |
289 self.trUtf8('Quit'), |
288 self.tr('Quit'), |
290 UI.PixmapCache.getIcon("exit.png"), |
289 UI.PixmapCache.getIcon("exit.png"), |
291 self.trUtf8('&Quit'), |
290 self.tr('&Quit'), |
292 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), |
291 QKeySequence(self.tr("Ctrl+Q", "File|Quit")), |
293 0, self, 'iconEditor_file_quit') |
292 0, self, 'iconEditor_file_quit') |
294 self.exitAct.setStatusTip(self.trUtf8('Quit the icon editor')) |
293 self.exitAct.setStatusTip(self.tr('Quit the icon editor')) |
295 self.exitAct.setWhatsThis(self.trUtf8( |
294 self.exitAct.setWhatsThis(self.tr( |
296 """<b>Quit</b>""" |
295 """<b>Quit</b>""" |
297 """<p>Quit the icon editor.</p>""" |
296 """<p>Quit the icon editor.</p>""" |
298 )) |
297 )) |
299 if not self.fromEric: |
298 if not self.fromEric: |
300 self.exitAct.triggered[()].connect(self.__closeAll) |
299 self.exitAct.triggered.connect(self.__closeAll) |
301 self.__actions.append(self.exitAct) |
300 self.__actions.append(self.exitAct) |
302 |
301 |
303 def __initEditActions(self): |
302 def __initEditActions(self): |
304 """ |
303 """ |
305 Private method to create the Edit actions. |
304 Private method to create the Edit actions. |
306 """ |
305 """ |
307 self.undoAct = E5Action( |
306 self.undoAct = E5Action( |
308 self.trUtf8('Undo'), |
307 self.tr('Undo'), |
309 UI.PixmapCache.getIcon("editUndo.png"), |
308 UI.PixmapCache.getIcon("editUndo.png"), |
310 self.trUtf8('&Undo'), |
309 self.tr('&Undo'), |
311 QKeySequence(self.trUtf8("Ctrl+Z", "Edit|Undo")), |
310 QKeySequence(self.tr("Ctrl+Z", "Edit|Undo")), |
312 QKeySequence(self.trUtf8("Alt+Backspace", "Edit|Undo")), |
311 QKeySequence(self.tr("Alt+Backspace", "Edit|Undo")), |
313 self, 'iconEditor_edit_undo') |
312 self, 'iconEditor_edit_undo') |
314 self.undoAct.setStatusTip(self.trUtf8('Undo the last change')) |
313 self.undoAct.setStatusTip(self.tr('Undo the last change')) |
315 self.undoAct.setWhatsThis(self.trUtf8( |
314 self.undoAct.setWhatsThis(self.tr( |
316 """<b>Undo</b>""" |
315 """<b>Undo</b>""" |
317 """<p>Undo the last change done.</p>""" |
316 """<p>Undo the last change done.</p>""" |
318 )) |
317 )) |
319 self.undoAct.triggered[()].connect(self.__editor.editUndo) |
318 self.undoAct.triggered.connect(self.__editor.editUndo) |
320 self.__actions.append(self.undoAct) |
319 self.__actions.append(self.undoAct) |
321 |
320 |
322 self.redoAct = E5Action( |
321 self.redoAct = E5Action( |
323 self.trUtf8('Redo'), |
322 self.tr('Redo'), |
324 UI.PixmapCache.getIcon("editRedo.png"), |
323 UI.PixmapCache.getIcon("editRedo.png"), |
325 self.trUtf8('&Redo'), |
324 self.tr('&Redo'), |
326 QKeySequence(self.trUtf8("Ctrl+Shift+Z", "Edit|Redo")), |
325 QKeySequence(self.tr("Ctrl+Shift+Z", "Edit|Redo")), |
327 0, self, 'iconEditor_edit_redo') |
326 0, self, 'iconEditor_edit_redo') |
328 self.redoAct.setStatusTip(self.trUtf8('Redo the last change')) |
327 self.redoAct.setStatusTip(self.tr('Redo the last change')) |
329 self.redoAct.setWhatsThis(self.trUtf8( |
328 self.redoAct.setWhatsThis(self.tr( |
330 """<b>Redo</b>""" |
329 """<b>Redo</b>""" |
331 """<p>Redo the last change done.</p>""" |
330 """<p>Redo the last change done.</p>""" |
332 )) |
331 )) |
333 self.redoAct.triggered[()].connect(self.__editor.editRedo) |
332 self.redoAct.triggered.connect(self.__editor.editRedo) |
334 self.__actions.append(self.redoAct) |
333 self.__actions.append(self.redoAct) |
335 |
334 |
336 self.cutAct = E5Action( |
335 self.cutAct = E5Action( |
337 self.trUtf8('Cut'), |
336 self.tr('Cut'), |
338 UI.PixmapCache.getIcon("editCut.png"), |
337 UI.PixmapCache.getIcon("editCut.png"), |
339 self.trUtf8('Cu&t'), |
338 self.tr('Cu&t'), |
340 QKeySequence(self.trUtf8("Ctrl+X", "Edit|Cut")), |
339 QKeySequence(self.tr("Ctrl+X", "Edit|Cut")), |
341 QKeySequence(self.trUtf8("Shift+Del", "Edit|Cut")), |
340 QKeySequence(self.tr("Shift+Del", "Edit|Cut")), |
342 self, 'iconEditor_edit_cut') |
341 self, 'iconEditor_edit_cut') |
343 self.cutAct.setStatusTip(self.trUtf8('Cut the selection')) |
342 self.cutAct.setStatusTip(self.tr('Cut the selection')) |
344 self.cutAct.setWhatsThis(self.trUtf8( |
343 self.cutAct.setWhatsThis(self.tr( |
345 """<b>Cut</b>""" |
344 """<b>Cut</b>""" |
346 """<p>Cut the selected image area to the clipboard.</p>""" |
345 """<p>Cut the selected image area to the clipboard.</p>""" |
347 )) |
346 )) |
348 self.cutAct.triggered[()].connect(self.__editor.editCut) |
347 self.cutAct.triggered.connect(self.__editor.editCut) |
349 self.__actions.append(self.cutAct) |
348 self.__actions.append(self.cutAct) |
350 |
349 |
351 self.copyAct = E5Action( |
350 self.copyAct = E5Action( |
352 self.trUtf8('Copy'), |
351 self.tr('Copy'), |
353 UI.PixmapCache.getIcon("editCopy.png"), |
352 UI.PixmapCache.getIcon("editCopy.png"), |
354 self.trUtf8('&Copy'), |
353 self.tr('&Copy'), |
355 QKeySequence(self.trUtf8("Ctrl+C", "Edit|Copy")), |
354 QKeySequence(self.tr("Ctrl+C", "Edit|Copy")), |
356 QKeySequence(self.trUtf8("Ctrl+Ins", "Edit|Copy")), |
355 QKeySequence(self.tr("Ctrl+Ins", "Edit|Copy")), |
357 self, 'iconEditor_edit_copy') |
356 self, 'iconEditor_edit_copy') |
358 self.copyAct.setStatusTip(self.trUtf8('Copy the selection')) |
357 self.copyAct.setStatusTip(self.tr('Copy the selection')) |
359 self.copyAct.setWhatsThis(self.trUtf8( |
358 self.copyAct.setWhatsThis(self.tr( |
360 """<b>Copy</b>""" |
359 """<b>Copy</b>""" |
361 """<p>Copy the selected image area to the clipboard.</p>""" |
360 """<p>Copy the selected image area to the clipboard.</p>""" |
362 )) |
361 )) |
363 self.copyAct.triggered[()].connect(self.__editor.editCopy) |
362 self.copyAct.triggered.connect(self.__editor.editCopy) |
364 self.__actions.append(self.copyAct) |
363 self.__actions.append(self.copyAct) |
365 |
364 |
366 self.pasteAct = E5Action( |
365 self.pasteAct = E5Action( |
367 self.trUtf8('Paste'), |
366 self.tr('Paste'), |
368 UI.PixmapCache.getIcon("editPaste.png"), |
367 UI.PixmapCache.getIcon("editPaste.png"), |
369 self.trUtf8('&Paste'), |
368 self.tr('&Paste'), |
370 QKeySequence(self.trUtf8("Ctrl+V", "Edit|Paste")), |
369 QKeySequence(self.tr("Ctrl+V", "Edit|Paste")), |
371 QKeySequence(self.trUtf8("Shift+Ins", "Edit|Paste")), |
370 QKeySequence(self.tr("Shift+Ins", "Edit|Paste")), |
372 self, 'iconEditor_edit_paste') |
371 self, 'iconEditor_edit_paste') |
373 self.pasteAct.setStatusTip(self.trUtf8('Paste the clipboard image')) |
372 self.pasteAct.setStatusTip(self.tr('Paste the clipboard image')) |
374 self.pasteAct.setWhatsThis(self.trUtf8( |
373 self.pasteAct.setWhatsThis(self.tr( |
375 """<b>Paste</b>""" |
374 """<b>Paste</b>""" |
376 """<p>Paste the clipboard image.</p>""" |
375 """<p>Paste the clipboard image.</p>""" |
377 )) |
376 )) |
378 self.pasteAct.triggered[()].connect(self.__editor.editPaste) |
377 self.pasteAct.triggered.connect(self.__editor.editPaste) |
379 self.__actions.append(self.pasteAct) |
378 self.__actions.append(self.pasteAct) |
380 |
379 |
381 self.pasteNewAct = E5Action( |
380 self.pasteNewAct = E5Action( |
382 self.trUtf8('Paste as New'), |
381 self.tr('Paste as New'), |
383 self.trUtf8('Paste as &New'), |
382 self.tr('Paste as &New'), |
384 0, 0, self, 'iconEditor_edit_paste_as_new') |
383 0, 0, self, 'iconEditor_edit_paste_as_new') |
385 self.pasteNewAct.setStatusTip(self.trUtf8( |
384 self.pasteNewAct.setStatusTip(self.tr( |
386 'Paste the clipboard image replacing the current one')) |
385 'Paste the clipboard image replacing the current one')) |
387 self.pasteNewAct.setWhatsThis(self.trUtf8( |
386 self.pasteNewAct.setWhatsThis(self.tr( |
388 """<b>Paste as New</b>""" |
387 """<b>Paste as New</b>""" |
389 """<p>Paste the clipboard image replacing the current one.</p>""" |
388 """<p>Paste the clipboard image replacing the current one.</p>""" |
390 )) |
389 )) |
391 self.pasteNewAct.triggered[()].connect(self.__editor.editPasteAsNew) |
390 self.pasteNewAct.triggered.connect(self.__editor.editPasteAsNew) |
392 self.__actions.append(self.pasteNewAct) |
391 self.__actions.append(self.pasteNewAct) |
393 |
392 |
394 self.deleteAct = E5Action( |
393 self.deleteAct = E5Action( |
395 self.trUtf8('Clear'), |
394 self.tr('Clear'), |
396 UI.PixmapCache.getIcon("editDelete.png"), |
395 UI.PixmapCache.getIcon("editDelete.png"), |
397 self.trUtf8('Cl&ear'), |
396 self.tr('Cl&ear'), |
398 QKeySequence(self.trUtf8("Alt+Shift+C", "Edit|Clear")), |
397 QKeySequence(self.tr("Alt+Shift+C", "Edit|Clear")), |
399 0, |
398 0, |
400 self, 'iconEditor_edit_clear') |
399 self, 'iconEditor_edit_clear') |
401 self.deleteAct.setStatusTip(self.trUtf8('Clear the icon image')) |
400 self.deleteAct.setStatusTip(self.tr('Clear the icon image')) |
402 self.deleteAct.setWhatsThis(self.trUtf8( |
401 self.deleteAct.setWhatsThis(self.tr( |
403 """<b>Clear</b>""" |
402 """<b>Clear</b>""" |
404 """<p>Clear the icon image and set it to be completely""" |
403 """<p>Clear the icon image and set it to be completely""" |
405 """ transparent.</p>""" |
404 """ transparent.</p>""" |
406 )) |
405 )) |
407 self.deleteAct.triggered[()].connect(self.__editor.editClear) |
406 self.deleteAct.triggered.connect(self.__editor.editClear) |
408 self.__actions.append(self.deleteAct) |
407 self.__actions.append(self.deleteAct) |
409 |
408 |
410 self.selectAllAct = E5Action( |
409 self.selectAllAct = E5Action( |
411 self.trUtf8('Select All'), |
410 self.tr('Select All'), |
412 self.trUtf8('&Select All'), |
411 self.tr('&Select All'), |
413 QKeySequence(self.trUtf8("Ctrl+A", "Edit|Select All")), |
412 QKeySequence(self.tr("Ctrl+A", "Edit|Select All")), |
414 0, |
413 0, |
415 self, 'iconEditor_edit_select_all') |
414 self, 'iconEditor_edit_select_all') |
416 self.selectAllAct.setStatusTip(self.trUtf8( |
415 self.selectAllAct.setStatusTip(self.tr( |
417 'Select the complete icon image')) |
416 'Select the complete icon image')) |
418 self.selectAllAct.setWhatsThis(self.trUtf8( |
417 self.selectAllAct.setWhatsThis(self.tr( |
419 """<b>Select All</b>""" |
418 """<b>Select All</b>""" |
420 """<p>Selects the complete icon image.</p>""" |
419 """<p>Selects the complete icon image.</p>""" |
421 )) |
420 )) |
422 self.selectAllAct.triggered[()].connect(self.__editor.editSelectAll) |
421 self.selectAllAct.triggered.connect(self.__editor.editSelectAll) |
423 self.__actions.append(self.selectAllAct) |
422 self.__actions.append(self.selectAllAct) |
424 |
423 |
425 self.resizeAct = E5Action( |
424 self.resizeAct = E5Action( |
426 self.trUtf8('Change Size'), |
425 self.tr('Change Size'), |
427 UI.PixmapCache.getIcon("transformResize.png"), |
426 UI.PixmapCache.getIcon("transformResize.png"), |
428 self.trUtf8('Change Si&ze...'), |
427 self.tr('Change Si&ze...'), |
429 0, 0, |
428 0, 0, |
430 self, 'iconEditor_edit_change_size') |
429 self, 'iconEditor_edit_change_size') |
431 self.resizeAct.setStatusTip(self.trUtf8('Change the icon size')) |
430 self.resizeAct.setStatusTip(self.tr('Change the icon size')) |
432 self.resizeAct.setWhatsThis(self.trUtf8( |
431 self.resizeAct.setWhatsThis(self.tr( |
433 """<b>Change Size...</b>""" |
432 """<b>Change Size...</b>""" |
434 """<p>Changes the icon size.</p>""" |
433 """<p>Changes the icon size.</p>""" |
435 )) |
434 )) |
436 self.resizeAct.triggered[()].connect(self.__editor.editResize) |
435 self.resizeAct.triggered.connect(self.__editor.editResize) |
437 self.__actions.append(self.resizeAct) |
436 self.__actions.append(self.resizeAct) |
438 |
437 |
439 self.grayscaleAct = E5Action( |
438 self.grayscaleAct = E5Action( |
440 self.trUtf8('Grayscale'), |
439 self.tr('Grayscale'), |
441 UI.PixmapCache.getIcon("grayscale.png"), |
440 UI.PixmapCache.getIcon("grayscale.png"), |
442 self.trUtf8('&Grayscale'), |
441 self.tr('&Grayscale'), |
443 0, 0, |
442 0, 0, |
444 self, 'iconEditor_edit_grayscale') |
443 self, 'iconEditor_edit_grayscale') |
445 self.grayscaleAct.setStatusTip(self.trUtf8( |
444 self.grayscaleAct.setStatusTip(self.tr( |
446 'Change the icon to grayscale')) |
445 'Change the icon to grayscale')) |
447 self.grayscaleAct.setWhatsThis(self.trUtf8( |
446 self.grayscaleAct.setWhatsThis(self.tr( |
448 """<b>Grayscale</b>""" |
447 """<b>Grayscale</b>""" |
449 """<p>Changes the icon to grayscale.</p>""" |
448 """<p>Changes the icon to grayscale.</p>""" |
450 )) |
449 )) |
451 self.grayscaleAct.triggered[()].connect(self.__editor.grayScale) |
450 self.grayscaleAct.triggered.connect(self.__editor.grayScale) |
452 self.__actions.append(self.grayscaleAct) |
451 self.__actions.append(self.grayscaleAct) |
453 |
452 |
454 self.redoAct.setEnabled(False) |
453 self.redoAct.setEnabled(False) |
455 self.__editor.canRedoChanged.connect(self.redoAct.setEnabled) |
454 self.__editor.canRedoChanged.connect(self.redoAct.setEnabled) |
456 |
455 |
472 def __initViewActions(self): |
471 def __initViewActions(self): |
473 """ |
472 """ |
474 Private method to create the View actions. |
473 Private method to create the View actions. |
475 """ |
474 """ |
476 self.zoomInAct = E5Action( |
475 self.zoomInAct = E5Action( |
477 self.trUtf8('Zoom in'), |
476 self.tr('Zoom in'), |
478 UI.PixmapCache.getIcon("zoomIn.png"), |
477 UI.PixmapCache.getIcon("zoomIn.png"), |
479 self.trUtf8('Zoom &in'), |
478 self.tr('Zoom &in'), |
480 QKeySequence(self.trUtf8("Ctrl++", "View|Zoom in")), |
479 QKeySequence(self.tr("Ctrl++", "View|Zoom in")), |
481 0, self, 'iconEditor_view_zoom_in') |
480 0, self, 'iconEditor_view_zoom_in') |
482 self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the icon')) |
481 self.zoomInAct.setStatusTip(self.tr('Zoom in on the icon')) |
483 self.zoomInAct.setWhatsThis(self.trUtf8( |
482 self.zoomInAct.setWhatsThis(self.tr( |
484 """<b>Zoom in</b>""" |
483 """<b>Zoom in</b>""" |
485 """<p>Zoom in on the icon. This makes the grid bigger.</p>""" |
484 """<p>Zoom in on the icon. This makes the grid bigger.</p>""" |
486 )) |
485 )) |
487 self.zoomInAct.triggered[()].connect(self.__zoomIn) |
486 self.zoomInAct.triggered.connect(self.__zoomIn) |
488 self.__actions.append(self.zoomInAct) |
487 self.__actions.append(self.zoomInAct) |
489 |
488 |
490 self.zoomOutAct = E5Action( |
489 self.zoomOutAct = E5Action( |
491 self.trUtf8('Zoom out'), |
490 self.tr('Zoom out'), |
492 UI.PixmapCache.getIcon("zoomOut.png"), |
491 UI.PixmapCache.getIcon("zoomOut.png"), |
493 self.trUtf8('Zoom &out'), |
492 self.tr('Zoom &out'), |
494 QKeySequence(self.trUtf8("Ctrl+-", "View|Zoom out")), |
493 QKeySequence(self.tr("Ctrl+-", "View|Zoom out")), |
495 0, self, 'iconEditor_view_zoom_out') |
494 0, self, 'iconEditor_view_zoom_out') |
496 self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the icon')) |
495 self.zoomOutAct.setStatusTip(self.tr('Zoom out on the icon')) |
497 self.zoomOutAct.setWhatsThis(self.trUtf8( |
496 self.zoomOutAct.setWhatsThis(self.tr( |
498 """<b>Zoom out</b>""" |
497 """<b>Zoom out</b>""" |
499 """<p>Zoom out on the icon. This makes the grid smaller.</p>""" |
498 """<p>Zoom out on the icon. This makes the grid smaller.</p>""" |
500 )) |
499 )) |
501 self.zoomOutAct.triggered[()].connect(self.__zoomOut) |
500 self.zoomOutAct.triggered.connect(self.__zoomOut) |
502 self.__actions.append(self.zoomOutAct) |
501 self.__actions.append(self.zoomOutAct) |
503 |
502 |
504 self.zoomResetAct = E5Action( |
503 self.zoomResetAct = E5Action( |
505 self.trUtf8('Zoom reset'), |
504 self.tr('Zoom reset'), |
506 UI.PixmapCache.getIcon("zoomReset.png"), |
505 UI.PixmapCache.getIcon("zoomReset.png"), |
507 self.trUtf8('Zoom &reset'), |
506 self.tr('Zoom &reset'), |
508 QKeySequence(self.trUtf8("Ctrl+0", "View|Zoom reset")), |
507 QKeySequence(self.tr("Ctrl+0", "View|Zoom reset")), |
509 0, self, 'iconEditor_view_zoom_reset') |
508 0, self, 'iconEditor_view_zoom_reset') |
510 self.zoomResetAct.setStatusTip(self.trUtf8( |
509 self.zoomResetAct.setStatusTip(self.tr( |
511 'Reset the zoom of the icon')) |
510 'Reset the zoom of the icon')) |
512 self.zoomResetAct.setWhatsThis(self.trUtf8( |
511 self.zoomResetAct.setWhatsThis(self.tr( |
513 """<b>Zoom reset</b>""" |
512 """<b>Zoom reset</b>""" |
514 """<p>Reset the zoom of the icon. """ |
513 """<p>Reset the zoom of the icon. """ |
515 """This sets the zoom factor to 100%.</p>""" |
514 """This sets the zoom factor to 100%.</p>""" |
516 )) |
515 )) |
517 self.zoomResetAct.triggered[()].connect(self.__zoomReset) |
516 self.zoomResetAct.triggered.connect(self.__zoomReset) |
518 self.__actions.append(self.zoomResetAct) |
517 self.__actions.append(self.zoomResetAct) |
519 |
518 |
520 self.showGridAct = E5Action( |
519 self.showGridAct = E5Action( |
521 self.trUtf8('Show Grid'), |
520 self.tr('Show Grid'), |
522 UI.PixmapCache.getIcon("grid.png"), |
521 UI.PixmapCache.getIcon("grid.png"), |
523 self.trUtf8('Show &Grid'), |
522 self.tr('Show &Grid'), |
524 0, 0, |
523 0, 0, |
525 self, 'iconEditor_view_show_grid') |
524 self, 'iconEditor_view_show_grid') |
526 self.showGridAct.setStatusTip(self.trUtf8( |
525 self.showGridAct.setStatusTip(self.tr( |
527 'Toggle the display of the grid')) |
526 'Toggle the display of the grid')) |
528 self.showGridAct.setWhatsThis(self.trUtf8( |
527 self.showGridAct.setWhatsThis(self.tr( |
529 """<b>Show Grid</b>""" |
528 """<b>Show Grid</b>""" |
530 """<p>Toggle the display of the grid.</p>""" |
529 """<p>Toggle the display of the grid.</p>""" |
531 )) |
530 )) |
532 self.showGridAct.triggered[bool].connect(self.__editor.setGridEnabled) |
531 self.showGridAct.triggered[bool].connect(self.__editor.setGridEnabled) |
533 self.__actions.append(self.showGridAct) |
532 self.__actions.append(self.showGridAct) |
543 |
542 |
544 self.drawingActGrp = createActionGroup(self) |
543 self.drawingActGrp = createActionGroup(self) |
545 self.drawingActGrp.setExclusive(True) |
544 self.drawingActGrp.setExclusive(True) |
546 |
545 |
547 self.drawPencilAct = E5Action( |
546 self.drawPencilAct = E5Action( |
548 self.trUtf8('Freehand'), |
547 self.tr('Freehand'), |
549 UI.PixmapCache.getIcon("drawBrush.png"), |
548 UI.PixmapCache.getIcon("drawBrush.png"), |
550 self.trUtf8('&Freehand'), |
549 self.tr('&Freehand'), |
551 0, 0, |
550 0, 0, |
552 self.drawingActGrp, 'iconEditor_tools_pencil') |
551 self.drawingActGrp, 'iconEditor_tools_pencil') |
553 self.drawPencilAct.setWhatsThis(self.trUtf8( |
552 self.drawPencilAct.setWhatsThis(self.tr( |
554 """<b>Free hand</b>""" |
553 """<b>Free hand</b>""" |
555 """<p>Draws non linear lines.</p>""" |
554 """<p>Draws non linear lines.</p>""" |
556 )) |
555 )) |
557 self.drawPencilAct.setCheckable(True) |
556 self.drawPencilAct.setCheckable(True) |
558 self.esm.setMapping(self.drawPencilAct, IconEditorGrid.Pencil) |
557 self.esm.setMapping(self.drawPencilAct, IconEditorGrid.Pencil) |
559 self.drawPencilAct.triggered[()].connect(self.esm.map) |
558 self.drawPencilAct.triggered.connect(self.esm.map) |
560 self.__actions.append(self.drawPencilAct) |
559 self.__actions.append(self.drawPencilAct) |
561 |
560 |
562 self.drawColorPickerAct = E5Action( |
561 self.drawColorPickerAct = E5Action( |
563 self.trUtf8('Color Picker'), |
562 self.tr('Color Picker'), |
564 UI.PixmapCache.getIcon("colorPicker.png"), |
563 UI.PixmapCache.getIcon("colorPicker.png"), |
565 self.trUtf8('&Color Picker'), |
564 self.tr('&Color Picker'), |
566 0, 0, |
565 0, 0, |
567 self.drawingActGrp, 'iconEditor_tools_color_picker') |
566 self.drawingActGrp, 'iconEditor_tools_color_picker') |
568 self.drawColorPickerAct.setWhatsThis(self.trUtf8( |
567 self.drawColorPickerAct.setWhatsThis(self.tr( |
569 """<b>Color Picker</b>""" |
568 """<b>Color Picker</b>""" |
570 """<p>The color of the pixel clicked on will become """ |
569 """<p>The color of the pixel clicked on will become """ |
571 """the current draw color.</p>""" |
570 """the current draw color.</p>""" |
572 )) |
571 )) |
573 self.drawColorPickerAct.setCheckable(True) |
572 self.drawColorPickerAct.setCheckable(True) |
574 self.esm.setMapping(self.drawColorPickerAct, |
573 self.esm.setMapping(self.drawColorPickerAct, |
575 IconEditorGrid.ColorPicker) |
574 IconEditorGrid.ColorPicker) |
576 self.drawColorPickerAct.triggered[()].connect(self.esm.map) |
575 self.drawColorPickerAct.triggered.connect(self.esm.map) |
577 self.__actions.append(self.drawColorPickerAct) |
576 self.__actions.append(self.drawColorPickerAct) |
578 |
577 |
579 self.drawRectangleAct = E5Action( |
578 self.drawRectangleAct = E5Action( |
580 self.trUtf8('Rectangle'), |
579 self.tr('Rectangle'), |
581 UI.PixmapCache.getIcon("drawRectangle.png"), |
580 UI.PixmapCache.getIcon("drawRectangle.png"), |
582 self.trUtf8('&Rectangle'), |
581 self.tr('&Rectangle'), |
583 0, 0, |
582 0, 0, |
584 self.drawingActGrp, 'iconEditor_tools_rectangle') |
583 self.drawingActGrp, 'iconEditor_tools_rectangle') |
585 self.drawRectangleAct.setWhatsThis(self.trUtf8( |
584 self.drawRectangleAct.setWhatsThis(self.tr( |
586 """<b>Rectangle</b>""" |
585 """<b>Rectangle</b>""" |
587 """<p>Draw a rectangle.</p>""" |
586 """<p>Draw a rectangle.</p>""" |
588 )) |
587 )) |
589 self.drawRectangleAct.setCheckable(True) |
588 self.drawRectangleAct.setCheckable(True) |
590 self.esm.setMapping(self.drawRectangleAct, IconEditorGrid.Rectangle) |
589 self.esm.setMapping(self.drawRectangleAct, IconEditorGrid.Rectangle) |
591 self.drawRectangleAct.triggered[()].connect(self.esm.map) |
590 self.drawRectangleAct.triggered.connect(self.esm.map) |
592 self.__actions.append(self.drawRectangleAct) |
591 self.__actions.append(self.drawRectangleAct) |
593 |
592 |
594 self.drawFilledRectangleAct = E5Action( |
593 self.drawFilledRectangleAct = E5Action( |
595 self.trUtf8('Filled Rectangle'), |
594 self.tr('Filled Rectangle'), |
596 UI.PixmapCache.getIcon("drawRectangleFilled.png"), |
595 UI.PixmapCache.getIcon("drawRectangleFilled.png"), |
597 self.trUtf8('F&illed Rectangle'), |
596 self.tr('F&illed Rectangle'), |
598 0, 0, |
597 0, 0, |
599 self.drawingActGrp, 'iconEditor_tools_filled_rectangle') |
598 self.drawingActGrp, 'iconEditor_tools_filled_rectangle') |
600 self.drawFilledRectangleAct.setWhatsThis(self.trUtf8( |
599 self.drawFilledRectangleAct.setWhatsThis(self.tr( |
601 """<b>Filled Rectangle</b>""" |
600 """<b>Filled Rectangle</b>""" |
602 """<p>Draw a filled rectangle.</p>""" |
601 """<p>Draw a filled rectangle.</p>""" |
603 )) |
602 )) |
604 self.drawFilledRectangleAct.setCheckable(True) |
603 self.drawFilledRectangleAct.setCheckable(True) |
605 self.esm.setMapping(self.drawFilledRectangleAct, |
604 self.esm.setMapping(self.drawFilledRectangleAct, |
606 IconEditorGrid.FilledRectangle) |
605 IconEditorGrid.FilledRectangle) |
607 self.drawFilledRectangleAct.triggered[()].connect(self.esm.map) |
606 self.drawFilledRectangleAct.triggered.connect(self.esm.map) |
608 self.__actions.append(self.drawFilledRectangleAct) |
607 self.__actions.append(self.drawFilledRectangleAct) |
609 |
608 |
610 self.drawCircleAct = E5Action( |
609 self.drawCircleAct = E5Action( |
611 self.trUtf8('Circle'), |
610 self.tr('Circle'), |
612 UI.PixmapCache.getIcon("drawCircle.png"), |
611 UI.PixmapCache.getIcon("drawCircle.png"), |
613 self.trUtf8('Circle'), |
612 self.tr('Circle'), |
614 0, 0, |
613 0, 0, |
615 self.drawingActGrp, 'iconEditor_tools_circle') |
614 self.drawingActGrp, 'iconEditor_tools_circle') |
616 self.drawCircleAct.setWhatsThis(self.trUtf8( |
615 self.drawCircleAct.setWhatsThis(self.tr( |
617 """<b>Circle</b>""" |
616 """<b>Circle</b>""" |
618 """<p>Draw a circle.</p>""" |
617 """<p>Draw a circle.</p>""" |
619 )) |
618 )) |
620 self.drawCircleAct.setCheckable(True) |
619 self.drawCircleAct.setCheckable(True) |
621 self.esm.setMapping(self.drawCircleAct, IconEditorGrid.Circle) |
620 self.esm.setMapping(self.drawCircleAct, IconEditorGrid.Circle) |
622 self.drawCircleAct.triggered[()].connect(self.esm.map) |
621 self.drawCircleAct.triggered.connect(self.esm.map) |
623 self.__actions.append(self.drawCircleAct) |
622 self.__actions.append(self.drawCircleAct) |
624 |
623 |
625 self.drawFilledCircleAct = E5Action( |
624 self.drawFilledCircleAct = E5Action( |
626 self.trUtf8('Filled Circle'), |
625 self.tr('Filled Circle'), |
627 UI.PixmapCache.getIcon("drawCircleFilled.png"), |
626 UI.PixmapCache.getIcon("drawCircleFilled.png"), |
628 self.trUtf8('Fille&d Circle'), |
627 self.tr('Fille&d Circle'), |
629 0, 0, |
628 0, 0, |
630 self.drawingActGrp, 'iconEditor_tools_filled_circle') |
629 self.drawingActGrp, 'iconEditor_tools_filled_circle') |
631 self.drawFilledCircleAct.setWhatsThis(self.trUtf8( |
630 self.drawFilledCircleAct.setWhatsThis(self.tr( |
632 """<b>Filled Circle</b>""" |
631 """<b>Filled Circle</b>""" |
633 """<p>Draw a filled circle.</p>""" |
632 """<p>Draw a filled circle.</p>""" |
634 )) |
633 )) |
635 self.drawFilledCircleAct.setCheckable(True) |
634 self.drawFilledCircleAct.setCheckable(True) |
636 self.esm.setMapping(self.drawFilledCircleAct, |
635 self.esm.setMapping(self.drawFilledCircleAct, |
637 IconEditorGrid.FilledCircle) |
636 IconEditorGrid.FilledCircle) |
638 self.drawFilledCircleAct.triggered[()].connect(self.esm.map) |
637 self.drawFilledCircleAct.triggered.connect(self.esm.map) |
639 self.__actions.append(self.drawFilledCircleAct) |
638 self.__actions.append(self.drawFilledCircleAct) |
640 |
639 |
641 self.drawEllipseAct = E5Action( |
640 self.drawEllipseAct = E5Action( |
642 self.trUtf8('Ellipse'), |
641 self.tr('Ellipse'), |
643 UI.PixmapCache.getIcon("drawEllipse.png"), |
642 UI.PixmapCache.getIcon("drawEllipse.png"), |
644 self.trUtf8('&Ellipse'), |
643 self.tr('&Ellipse'), |
645 0, 0, |
644 0, 0, |
646 self.drawingActGrp, 'iconEditor_tools_ellipse') |
645 self.drawingActGrp, 'iconEditor_tools_ellipse') |
647 self.drawEllipseAct.setWhatsThis(self.trUtf8( |
646 self.drawEllipseAct.setWhatsThis(self.tr( |
648 """<b>Ellipse</b>""" |
647 """<b>Ellipse</b>""" |
649 """<p>Draw an ellipse.</p>""" |
648 """<p>Draw an ellipse.</p>""" |
650 )) |
649 )) |
651 self.drawEllipseAct.setCheckable(True) |
650 self.drawEllipseAct.setCheckable(True) |
652 self.esm.setMapping(self.drawEllipseAct, IconEditorGrid.Ellipse) |
651 self.esm.setMapping(self.drawEllipseAct, IconEditorGrid.Ellipse) |
653 self.drawEllipseAct.triggered[()].connect(self.esm.map) |
652 self.drawEllipseAct.triggered.connect(self.esm.map) |
654 self.__actions.append(self.drawEllipseAct) |
653 self.__actions.append(self.drawEllipseAct) |
655 |
654 |
656 self.drawFilledEllipseAct = E5Action( |
655 self.drawFilledEllipseAct = E5Action( |
657 self.trUtf8('Filled Ellipse'), |
656 self.tr('Filled Ellipse'), |
658 UI.PixmapCache.getIcon("drawEllipseFilled.png"), |
657 UI.PixmapCache.getIcon("drawEllipseFilled.png"), |
659 self.trUtf8('Fille&d Elli&pse'), |
658 self.tr('Fille&d Elli&pse'), |
660 0, 0, |
659 0, 0, |
661 self.drawingActGrp, 'iconEditor_tools_filled_ellipse') |
660 self.drawingActGrp, 'iconEditor_tools_filled_ellipse') |
662 self.drawFilledEllipseAct.setWhatsThis(self.trUtf8( |
661 self.drawFilledEllipseAct.setWhatsThis(self.tr( |
663 """<b>Filled Ellipse</b>""" |
662 """<b>Filled Ellipse</b>""" |
664 """<p>Draw a filled ellipse.</p>""" |
663 """<p>Draw a filled ellipse.</p>""" |
665 )) |
664 )) |
666 self.drawFilledEllipseAct.setCheckable(True) |
665 self.drawFilledEllipseAct.setCheckable(True) |
667 self.esm.setMapping(self.drawFilledEllipseAct, |
666 self.esm.setMapping(self.drawFilledEllipseAct, |
668 IconEditorGrid.FilledEllipse) |
667 IconEditorGrid.FilledEllipse) |
669 self.drawFilledEllipseAct.triggered[()].connect(self.esm.map) |
668 self.drawFilledEllipseAct.triggered.connect(self.esm.map) |
670 self.__actions.append(self.drawFilledEllipseAct) |
669 self.__actions.append(self.drawFilledEllipseAct) |
671 |
670 |
672 self.drawFloodFillAct = E5Action( |
671 self.drawFloodFillAct = E5Action( |
673 self.trUtf8('Flood Fill'), |
672 self.tr('Flood Fill'), |
674 UI.PixmapCache.getIcon("drawFill.png"), |
673 UI.PixmapCache.getIcon("drawFill.png"), |
675 self.trUtf8('Fl&ood Fill'), |
674 self.tr('Fl&ood Fill'), |
676 0, 0, |
675 0, 0, |
677 self.drawingActGrp, 'iconEditor_tools_flood_fill') |
676 self.drawingActGrp, 'iconEditor_tools_flood_fill') |
678 self.drawFloodFillAct.setWhatsThis(self.trUtf8( |
677 self.drawFloodFillAct.setWhatsThis(self.tr( |
679 """<b>Flood Fill</b>""" |
678 """<b>Flood Fill</b>""" |
680 """<p>Fill adjoining pixels with the same color with """ |
679 """<p>Fill adjoining pixels with the same color with """ |
681 """the current color.</p>""" |
680 """the current color.</p>""" |
682 )) |
681 )) |
683 self.drawFloodFillAct.setCheckable(True) |
682 self.drawFloodFillAct.setCheckable(True) |
684 self.esm.setMapping(self.drawFloodFillAct, IconEditorGrid.Fill) |
683 self.esm.setMapping(self.drawFloodFillAct, IconEditorGrid.Fill) |
685 self.drawFloodFillAct.triggered[()].connect(self.esm.map) |
684 self.drawFloodFillAct.triggered.connect(self.esm.map) |
686 self.__actions.append(self.drawFloodFillAct) |
685 self.__actions.append(self.drawFloodFillAct) |
687 |
686 |
688 self.drawLineAct = E5Action( |
687 self.drawLineAct = E5Action( |
689 self.trUtf8('Line'), |
688 self.tr('Line'), |
690 UI.PixmapCache.getIcon("drawLine.png"), |
689 UI.PixmapCache.getIcon("drawLine.png"), |
691 self.trUtf8('&Line'), |
690 self.tr('&Line'), |
692 0, 0, |
691 0, 0, |
693 self.drawingActGrp, 'iconEditor_tools_line') |
692 self.drawingActGrp, 'iconEditor_tools_line') |
694 self.drawLineAct.setWhatsThis(self.trUtf8( |
693 self.drawLineAct.setWhatsThis(self.tr( |
695 """<b>Line</b>""" |
694 """<b>Line</b>""" |
696 """<p>Draw a line.</p>""" |
695 """<p>Draw a line.</p>""" |
697 )) |
696 )) |
698 self.drawLineAct.setCheckable(True) |
697 self.drawLineAct.setCheckable(True) |
699 self.esm.setMapping(self.drawLineAct, IconEditorGrid.Line) |
698 self.esm.setMapping(self.drawLineAct, IconEditorGrid.Line) |
700 self.drawLineAct.triggered[()].connect(self.esm.map) |
699 self.drawLineAct.triggered.connect(self.esm.map) |
701 self.__actions.append(self.drawLineAct) |
700 self.__actions.append(self.drawLineAct) |
702 |
701 |
703 self.drawEraserAct = E5Action( |
702 self.drawEraserAct = E5Action( |
704 self.trUtf8('Eraser (Transparent)'), |
703 self.tr('Eraser (Transparent)'), |
705 UI.PixmapCache.getIcon("drawEraser.png"), |
704 UI.PixmapCache.getIcon("drawEraser.png"), |
706 self.trUtf8('Eraser (&Transparent)'), |
705 self.tr('Eraser (&Transparent)'), |
707 0, 0, |
706 0, 0, |
708 self.drawingActGrp, 'iconEditor_tools_eraser') |
707 self.drawingActGrp, 'iconEditor_tools_eraser') |
709 self.drawEraserAct.setWhatsThis(self.trUtf8( |
708 self.drawEraserAct.setWhatsThis(self.tr( |
710 """<b>Eraser (Transparent)</b>""" |
709 """<b>Eraser (Transparent)</b>""" |
711 """<p>Erase pixels by setting them to transparent.</p>""" |
710 """<p>Erase pixels by setting them to transparent.</p>""" |
712 )) |
711 )) |
713 self.drawEraserAct.setCheckable(True) |
712 self.drawEraserAct.setCheckable(True) |
714 self.esm.setMapping(self.drawEraserAct, IconEditorGrid.Rubber) |
713 self.esm.setMapping(self.drawEraserAct, IconEditorGrid.Rubber) |
715 self.drawEraserAct.triggered[()].connect(self.esm.map) |
714 self.drawEraserAct.triggered.connect(self.esm.map) |
716 self.__actions.append(self.drawEraserAct) |
715 self.__actions.append(self.drawEraserAct) |
717 |
716 |
718 self.drawRectangleSelectionAct = E5Action( |
717 self.drawRectangleSelectionAct = E5Action( |
719 self.trUtf8('Rectangular Selection'), |
718 self.tr('Rectangular Selection'), |
720 UI.PixmapCache.getIcon("selectRectangle.png"), |
719 UI.PixmapCache.getIcon("selectRectangle.png"), |
721 self.trUtf8('Rect&angular Selection'), |
720 self.tr('Rect&angular Selection'), |
722 0, 0, |
721 0, 0, |
723 self.drawingActGrp, 'iconEditor_tools_selection_rectangle') |
722 self.drawingActGrp, 'iconEditor_tools_selection_rectangle') |
724 self.drawRectangleSelectionAct.setWhatsThis(self.trUtf8( |
723 self.drawRectangleSelectionAct.setWhatsThis(self.tr( |
725 """<b>Rectangular Selection</b>""" |
724 """<b>Rectangular Selection</b>""" |
726 """<p>Select a rectangular section of the icon using""" |
725 """<p>Select a rectangular section of the icon using""" |
727 """ the mouse.</p>""" |
726 """ the mouse.</p>""" |
728 )) |
727 )) |
729 self.drawRectangleSelectionAct.setCheckable(True) |
728 self.drawRectangleSelectionAct.setCheckable(True) |
730 self.esm.setMapping(self.drawRectangleSelectionAct, |
729 self.esm.setMapping(self.drawRectangleSelectionAct, |
731 IconEditorGrid.RectangleSelection) |
730 IconEditorGrid.RectangleSelection) |
732 self.drawRectangleSelectionAct.triggered[()].connect(self.esm.map) |
731 self.drawRectangleSelectionAct.triggered.connect(self.esm.map) |
733 self.__actions.append(self.drawRectangleSelectionAct) |
732 self.__actions.append(self.drawRectangleSelectionAct) |
734 |
733 |
735 self.drawCircleSelectionAct = E5Action( |
734 self.drawCircleSelectionAct = E5Action( |
736 self.trUtf8('Circular Selection'), |
735 self.tr('Circular Selection'), |
737 UI.PixmapCache.getIcon("selectCircle.png"), |
736 UI.PixmapCache.getIcon("selectCircle.png"), |
738 self.trUtf8('Rect&angular Selection'), |
737 self.tr('Rect&angular Selection'), |
739 0, 0, |
738 0, 0, |
740 self.drawingActGrp, 'iconEditor_tools_selection_circle') |
739 self.drawingActGrp, 'iconEditor_tools_selection_circle') |
741 self.drawCircleSelectionAct.setWhatsThis(self.trUtf8( |
740 self.drawCircleSelectionAct.setWhatsThis(self.tr( |
742 """<b>Circular Selection</b>""" |
741 """<b>Circular Selection</b>""" |
743 """<p>Select a circular section of the icon using""" |
742 """<p>Select a circular section of the icon using""" |
744 """ the mouse.</p>""" |
743 """ the mouse.</p>""" |
745 )) |
744 )) |
746 self.drawCircleSelectionAct.setCheckable(True) |
745 self.drawCircleSelectionAct.setCheckable(True) |
747 self.esm.setMapping(self.drawCircleSelectionAct, |
746 self.esm.setMapping(self.drawCircleSelectionAct, |
748 IconEditorGrid.CircleSelection) |
747 IconEditorGrid.CircleSelection) |
749 self.drawCircleSelectionAct.triggered[()].connect(self.esm.map) |
748 self.drawCircleSelectionAct.triggered.connect(self.esm.map) |
750 self.__actions.append(self.drawCircleSelectionAct) |
749 self.__actions.append(self.drawCircleSelectionAct) |
751 |
750 |
752 self.drawPencilAct.setChecked(True) |
751 self.drawPencilAct.setChecked(True) |
753 |
752 |
754 def __initHelpActions(self): |
753 def __initHelpActions(self): |
755 """ |
754 """ |
756 Private method to create the Help actions. |
755 Private method to create the Help actions. |
757 """ |
756 """ |
758 self.aboutAct = E5Action( |
757 self.aboutAct = E5Action( |
759 self.trUtf8('About'), |
758 self.tr('About'), |
760 self.trUtf8('&About'), |
759 self.tr('&About'), |
761 0, 0, self, 'iconEditor_help_about') |
760 0, 0, self, 'iconEditor_help_about') |
762 self.aboutAct.setStatusTip(self.trUtf8( |
761 self.aboutAct.setStatusTip(self.tr( |
763 'Display information about this software')) |
762 'Display information about this software')) |
764 self.aboutAct.setWhatsThis(self.trUtf8( |
763 self.aboutAct.setWhatsThis(self.tr( |
765 """<b>About</b>""" |
764 """<b>About</b>""" |
766 """<p>Display some information about this software.</p>""")) |
765 """<p>Display some information about this software.</p>""")) |
767 self.aboutAct.triggered[()].connect(self.__about) |
766 self.aboutAct.triggered.connect(self.__about) |
768 self.__actions.append(self.aboutAct) |
767 self.__actions.append(self.aboutAct) |
769 |
768 |
770 self.aboutQtAct = E5Action( |
769 self.aboutQtAct = E5Action( |
771 self.trUtf8('About Qt'), |
770 self.tr('About Qt'), |
772 self.trUtf8('About &Qt'), |
771 self.tr('About &Qt'), |
773 0, 0, self, 'iconEditor_help_about_qt') |
772 0, 0, self, 'iconEditor_help_about_qt') |
774 self.aboutQtAct.setStatusTip( |
773 self.aboutQtAct.setStatusTip( |
775 self.trUtf8('Display information about the Qt toolkit')) |
774 self.tr('Display information about the Qt toolkit')) |
776 self.aboutQtAct.setWhatsThis(self.trUtf8( |
775 self.aboutQtAct.setWhatsThis(self.tr( |
777 """<b>About Qt</b>""" |
776 """<b>About Qt</b>""" |
778 """<p>Display some information about the Qt toolkit.</p>""" |
777 """<p>Display some information about the Qt toolkit.</p>""" |
779 )) |
778 )) |
780 self.aboutQtAct.triggered[()].connect(self.__aboutQt) |
779 self.aboutQtAct.triggered.connect(self.__aboutQt) |
781 self.__actions.append(self.aboutQtAct) |
780 self.__actions.append(self.aboutQtAct) |
782 |
781 |
783 self.whatsThisAct = E5Action( |
782 self.whatsThisAct = E5Action( |
784 self.trUtf8('What\'s This?'), |
783 self.tr('What\'s This?'), |
785 UI.PixmapCache.getIcon("whatsThis.png"), |
784 UI.PixmapCache.getIcon("whatsThis.png"), |
786 self.trUtf8('&What\'s This?'), |
785 self.tr('&What\'s This?'), |
787 QKeySequence(self.trUtf8("Shift+F1", "Help|What's This?'")), |
786 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")), |
788 0, self, 'iconEditor_help_whats_this') |
787 0, self, 'iconEditor_help_whats_this') |
789 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) |
788 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help')) |
790 self.whatsThisAct.setWhatsThis(self.trUtf8( |
789 self.whatsThisAct.setWhatsThis(self.tr( |
791 """<b>Display context sensitive help</b>""" |
790 """<b>Display context sensitive help</b>""" |
792 """<p>In What's This? mode, the mouse cursor shows an arrow""" |
791 """<p>In What's This? mode, the mouse cursor shows an arrow""" |
793 """ with a question mark, and you can click on the interface""" |
792 """ with a question mark, and you can click on the interface""" |
794 """ elements to get a short description of what they do and""" |
793 """ elements to get a short description of what they do and""" |
795 """ how to use them. In dialogs, this feature can be accessed""" |
794 """ how to use them. In dialogs, this feature can be accessed""" |
796 """ using the context help button in the titlebar.</p>""" |
795 """ using the context help button in the titlebar.</p>""" |
797 )) |
796 )) |
798 self.whatsThisAct.triggered[()].connect(self.__whatsThis) |
797 self.whatsThisAct.triggered.connect(self.__whatsThis) |
799 self.__actions.append(self.whatsThisAct) |
798 self.__actions.append(self.whatsThisAct) |
800 |
799 |
801 def __initMenus(self): |
800 def __initMenus(self): |
802 """ |
801 """ |
803 Private method to create the menus. |
802 Private method to create the menus. |
804 """ |
803 """ |
805 mb = self.menuBar() |
804 mb = self.menuBar() |
806 |
805 |
807 menu = mb.addMenu(self.trUtf8('&File')) |
806 menu = mb.addMenu(self.tr('&File')) |
808 menu.setTearOffEnabled(True) |
807 menu.setTearOffEnabled(True) |
809 menu.addAction(self.newAct) |
808 menu.addAction(self.newAct) |
810 menu.addAction(self.newWindowAct) |
809 menu.addAction(self.newWindowAct) |
811 menu.addAction(self.openAct) |
810 menu.addAction(self.openAct) |
812 menu.addSeparator() |
811 menu.addSeparator() |
813 menu.addAction(self.saveAct) |
812 menu.addAction(self.saveAct) |
814 menu.addAction(self.saveAsAct) |
813 menu.addAction(self.saveAsAct) |
815 menu.addSeparator() |
814 menu.addSeparator() |
816 menu.addAction(self.closeAct) |
815 menu.addAction(self.closeAct) |
817 menu.addAction(self.closeAllAct) |
816 if self.fromEric: |
818 if not self.fromEric: |
817 menu.addAction(self.closeAllAct) |
|
818 else: |
819 menu.addSeparator() |
819 menu.addSeparator() |
820 menu.addAction(self.exitAct) |
820 menu.addAction(self.exitAct) |
821 |
821 |
822 menu = mb.addMenu(self.trUtf8("&Edit")) |
822 menu = mb.addMenu(self.tr("&Edit")) |
823 menu.setTearOffEnabled(True) |
823 menu.setTearOffEnabled(True) |
824 menu.addAction(self.undoAct) |
824 menu.addAction(self.undoAct) |
825 menu.addAction(self.redoAct) |
825 menu.addAction(self.redoAct) |
826 menu.addSeparator() |
826 menu.addSeparator() |
827 menu.addAction(self.cutAct) |
827 menu.addAction(self.cutAct) |