eric6/IconEditor/IconEditorWindow.py

changeset 7533
88261c96484b
parent 7360
9190402e4505
child 7780
41420f82c0ac
equal deleted inserted replaced
7532:1358e9d67a1c 7533:88261c96484b
57 super(IconEditorWindow, self).__init__(parent) 57 super(IconEditorWindow, self).__init__(parent)
58 self.setObjectName("eric6_icon_editor") 58 self.setObjectName("eric6_icon_editor")
59 59
60 self.fromEric = fromEric 60 self.fromEric = fromEric
61 self.initShortcutsOnly = initShortcutsOnly 61 self.initShortcutsOnly = initShortcutsOnly
62 self.setWindowIcon(UI.PixmapCache.getIcon("iconEditor.png")) 62 self.setWindowIcon(UI.PixmapCache.getIcon("iconEditor"))
63 63
64 if self.initShortcutsOnly: 64 if self.initShortcutsOnly:
65 self.__initActions() 65 self.__initActions()
66 else: 66 else:
67 if not self.fromEric: 67 if not self.fromEric:
191 """ 191 """
192 Private method to define the file related user interface actions. 192 Private method to define the file related user interface actions.
193 """ 193 """
194 self.newAct = E5Action( 194 self.newAct = E5Action(
195 self.tr('New'), 195 self.tr('New'),
196 UI.PixmapCache.getIcon("new.png"), 196 UI.PixmapCache.getIcon("new"),
197 self.tr('&New'), 197 self.tr('&New'),
198 QKeySequence(self.tr("Ctrl+N", "File|New")), 198 QKeySequence(self.tr("Ctrl+N", "File|New")),
199 0, self, 'iconEditor_file_new') 199 0, self, 'iconEditor_file_new')
200 self.newAct.setStatusTip(self.tr('Create a new icon')) 200 self.newAct.setStatusTip(self.tr('Create a new icon'))
201 self.newAct.setWhatsThis(self.tr( 201 self.newAct.setWhatsThis(self.tr(
205 self.newAct.triggered.connect(self.__newIcon) 205 self.newAct.triggered.connect(self.__newIcon)
206 self.__actions.append(self.newAct) 206 self.__actions.append(self.newAct)
207 207
208 self.newWindowAct = E5Action( 208 self.newWindowAct = E5Action(
209 self.tr('New Window'), 209 self.tr('New Window'),
210 UI.PixmapCache.getIcon("newWindow.png"), 210 UI.PixmapCache.getIcon("newWindow"),
211 self.tr('New &Window'), 211 self.tr('New &Window'),
212 0, 0, self, 'iconEditor_file_new_window') 212 0, 0, self, 'iconEditor_file_new_window')
213 self.newWindowAct.setStatusTip(self.tr( 213 self.newWindowAct.setStatusTip(self.tr(
214 'Open a new icon editor window')) 214 'Open a new icon editor window'))
215 self.newWindowAct.setWhatsThis(self.tr( 215 self.newWindowAct.setWhatsThis(self.tr(
219 self.newWindowAct.triggered.connect(self.__newWindow) 219 self.newWindowAct.triggered.connect(self.__newWindow)
220 self.__actions.append(self.newWindowAct) 220 self.__actions.append(self.newWindowAct)
221 221
222 self.openAct = E5Action( 222 self.openAct = E5Action(
223 self.tr('Open'), 223 self.tr('Open'),
224 UI.PixmapCache.getIcon("open.png"), 224 UI.PixmapCache.getIcon("open"),
225 self.tr('&Open...'), 225 self.tr('&Open...'),
226 QKeySequence(self.tr("Ctrl+O", "File|Open")), 226 QKeySequence(self.tr("Ctrl+O", "File|Open")),
227 0, self, 'iconEditor_file_open') 227 0, self, 'iconEditor_file_open')
228 self.openAct.setStatusTip(self.tr('Open an icon file for editing')) 228 self.openAct.setStatusTip(self.tr('Open an icon file for editing'))
229 self.openAct.setWhatsThis(self.tr( 229 self.openAct.setWhatsThis(self.tr(
234 self.openAct.triggered.connect(self.__openIcon) 234 self.openAct.triggered.connect(self.__openIcon)
235 self.__actions.append(self.openAct) 235 self.__actions.append(self.openAct)
236 236
237 self.saveAct = E5Action( 237 self.saveAct = E5Action(
238 self.tr('Save'), 238 self.tr('Save'),
239 UI.PixmapCache.getIcon("fileSave.png"), 239 UI.PixmapCache.getIcon("fileSave"),
240 self.tr('&Save'), 240 self.tr('&Save'),
241 QKeySequence(self.tr("Ctrl+S", "File|Save")), 241 QKeySequence(self.tr("Ctrl+S", "File|Save")),
242 0, self, 'iconEditor_file_save') 242 0, self, 'iconEditor_file_save')
243 self.saveAct.setStatusTip(self.tr('Save the current icon')) 243 self.saveAct.setStatusTip(self.tr('Save the current icon'))
244 self.saveAct.setWhatsThis(self.tr( 244 self.saveAct.setWhatsThis(self.tr(
248 self.saveAct.triggered.connect(self.__saveIcon) 248 self.saveAct.triggered.connect(self.__saveIcon)
249 self.__actions.append(self.saveAct) 249 self.__actions.append(self.saveAct)
250 250
251 self.saveAsAct = E5Action( 251 self.saveAsAct = E5Action(
252 self.tr('Save As'), 252 self.tr('Save As'),
253 UI.PixmapCache.getIcon("fileSaveAs.png"), 253 UI.PixmapCache.getIcon("fileSaveAs"),
254 self.tr('Save &As...'), 254 self.tr('Save &As...'),
255 QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")), 255 QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")),
256 0, self, 'iconEditor_file_save_as') 256 0, self, 'iconEditor_file_save_as')
257 self.saveAsAct.setStatusTip( 257 self.saveAsAct.setStatusTip(
258 self.tr('Save the current icon to a new file')) 258 self.tr('Save the current icon to a new file'))
263 self.saveAsAct.triggered.connect(self.__saveIconAs) 263 self.saveAsAct.triggered.connect(self.__saveIconAs)
264 self.__actions.append(self.saveAsAct) 264 self.__actions.append(self.saveAsAct)
265 265
266 self.closeAct = E5Action( 266 self.closeAct = E5Action(
267 self.tr('Close'), 267 self.tr('Close'),
268 UI.PixmapCache.getIcon("close.png"), 268 UI.PixmapCache.getIcon("close"),
269 self.tr('&Close'), 269 self.tr('&Close'),
270 QKeySequence(self.tr("Ctrl+W", "File|Close")), 270 QKeySequence(self.tr("Ctrl+W", "File|Close")),
271 0, self, 'iconEditor_file_close') 271 0, self, 'iconEditor_file_close')
272 self.closeAct.setStatusTip(self.tr( 272 self.closeAct.setStatusTip(self.tr(
273 'Close the current icon editor window')) 273 'Close the current icon editor window'))
304 self.closeOthersAct.triggered.connect(self.__closeOthers) 304 self.closeOthersAct.triggered.connect(self.__closeOthers)
305 self.__actions.append(self.closeOthersAct) 305 self.__actions.append(self.closeOthersAct)
306 306
307 self.exitAct = E5Action( 307 self.exitAct = E5Action(
308 self.tr('Quit'), 308 self.tr('Quit'),
309 UI.PixmapCache.getIcon("exit.png"), 309 UI.PixmapCache.getIcon("exit"),
310 self.tr('&Quit'), 310 self.tr('&Quit'),
311 QKeySequence(self.tr("Ctrl+Q", "File|Quit")), 311 QKeySequence(self.tr("Ctrl+Q", "File|Quit")),
312 0, self, 'iconEditor_file_quit') 312 0, self, 'iconEditor_file_quit')
313 self.exitAct.setStatusTip(self.tr('Quit the icon editor')) 313 self.exitAct.setStatusTip(self.tr('Quit the icon editor'))
314 self.exitAct.setWhatsThis(self.tr( 314 self.exitAct.setWhatsThis(self.tr(
323 """ 323 """
324 Private method to create the Edit actions. 324 Private method to create the Edit actions.
325 """ 325 """
326 self.undoAct = E5Action( 326 self.undoAct = E5Action(
327 self.tr('Undo'), 327 self.tr('Undo'),
328 UI.PixmapCache.getIcon("editUndo.png"), 328 UI.PixmapCache.getIcon("editUndo"),
329 self.tr('&Undo'), 329 self.tr('&Undo'),
330 QKeySequence(self.tr("Ctrl+Z", "Edit|Undo")), 330 QKeySequence(self.tr("Ctrl+Z", "Edit|Undo")),
331 QKeySequence(self.tr("Alt+Backspace", "Edit|Undo")), 331 QKeySequence(self.tr("Alt+Backspace", "Edit|Undo")),
332 self, 'iconEditor_edit_undo') 332 self, 'iconEditor_edit_undo')
333 self.undoAct.setStatusTip(self.tr('Undo the last change')) 333 self.undoAct.setStatusTip(self.tr('Undo the last change'))
338 self.undoAct.triggered.connect(self.__editor.editUndo) 338 self.undoAct.triggered.connect(self.__editor.editUndo)
339 self.__actions.append(self.undoAct) 339 self.__actions.append(self.undoAct)
340 340
341 self.redoAct = E5Action( 341 self.redoAct = E5Action(
342 self.tr('Redo'), 342 self.tr('Redo'),
343 UI.PixmapCache.getIcon("editRedo.png"), 343 UI.PixmapCache.getIcon("editRedo"),
344 self.tr('&Redo'), 344 self.tr('&Redo'),
345 QKeySequence(self.tr("Ctrl+Shift+Z", "Edit|Redo")), 345 QKeySequence(self.tr("Ctrl+Shift+Z", "Edit|Redo")),
346 0, self, 'iconEditor_edit_redo') 346 0, self, 'iconEditor_edit_redo')
347 self.redoAct.setStatusTip(self.tr('Redo the last change')) 347 self.redoAct.setStatusTip(self.tr('Redo the last change'))
348 self.redoAct.setWhatsThis(self.tr( 348 self.redoAct.setWhatsThis(self.tr(
352 self.redoAct.triggered.connect(self.__editor.editRedo) 352 self.redoAct.triggered.connect(self.__editor.editRedo)
353 self.__actions.append(self.redoAct) 353 self.__actions.append(self.redoAct)
354 354
355 self.cutAct = E5Action( 355 self.cutAct = E5Action(
356 self.tr('Cut'), 356 self.tr('Cut'),
357 UI.PixmapCache.getIcon("editCut.png"), 357 UI.PixmapCache.getIcon("editCut"),
358 self.tr('Cu&t'), 358 self.tr('Cu&t'),
359 QKeySequence(self.tr("Ctrl+X", "Edit|Cut")), 359 QKeySequence(self.tr("Ctrl+X", "Edit|Cut")),
360 QKeySequence(self.tr("Shift+Del", "Edit|Cut")), 360 QKeySequence(self.tr("Shift+Del", "Edit|Cut")),
361 self, 'iconEditor_edit_cut') 361 self, 'iconEditor_edit_cut')
362 self.cutAct.setStatusTip(self.tr('Cut the selection')) 362 self.cutAct.setStatusTip(self.tr('Cut the selection'))
367 self.cutAct.triggered.connect(self.__editor.editCut) 367 self.cutAct.triggered.connect(self.__editor.editCut)
368 self.__actions.append(self.cutAct) 368 self.__actions.append(self.cutAct)
369 369
370 self.copyAct = E5Action( 370 self.copyAct = E5Action(
371 self.tr('Copy'), 371 self.tr('Copy'),
372 UI.PixmapCache.getIcon("editCopy.png"), 372 UI.PixmapCache.getIcon("editCopy"),
373 self.tr('&Copy'), 373 self.tr('&Copy'),
374 QKeySequence(self.tr("Ctrl+C", "Edit|Copy")), 374 QKeySequence(self.tr("Ctrl+C", "Edit|Copy")),
375 QKeySequence(self.tr("Ctrl+Ins", "Edit|Copy")), 375 QKeySequence(self.tr("Ctrl+Ins", "Edit|Copy")),
376 self, 'iconEditor_edit_copy') 376 self, 'iconEditor_edit_copy')
377 self.copyAct.setStatusTip(self.tr('Copy the selection')) 377 self.copyAct.setStatusTip(self.tr('Copy the selection'))
382 self.copyAct.triggered.connect(self.__editor.editCopy) 382 self.copyAct.triggered.connect(self.__editor.editCopy)
383 self.__actions.append(self.copyAct) 383 self.__actions.append(self.copyAct)
384 384
385 self.pasteAct = E5Action( 385 self.pasteAct = E5Action(
386 self.tr('Paste'), 386 self.tr('Paste'),
387 UI.PixmapCache.getIcon("editPaste.png"), 387 UI.PixmapCache.getIcon("editPaste"),
388 self.tr('&Paste'), 388 self.tr('&Paste'),
389 QKeySequence(self.tr("Ctrl+V", "Edit|Paste")), 389 QKeySequence(self.tr("Ctrl+V", "Edit|Paste")),
390 QKeySequence(self.tr("Shift+Ins", "Edit|Paste")), 390 QKeySequence(self.tr("Shift+Ins", "Edit|Paste")),
391 self, 'iconEditor_edit_paste') 391 self, 'iconEditor_edit_paste')
392 self.pasteAct.setStatusTip(self.tr('Paste the clipboard image')) 392 self.pasteAct.setStatusTip(self.tr('Paste the clipboard image'))
410 self.pasteNewAct.triggered.connect(self.__editor.editPasteAsNew) 410 self.pasteNewAct.triggered.connect(self.__editor.editPasteAsNew)
411 self.__actions.append(self.pasteNewAct) 411 self.__actions.append(self.pasteNewAct)
412 412
413 self.deleteAct = E5Action( 413 self.deleteAct = E5Action(
414 self.tr('Clear'), 414 self.tr('Clear'),
415 UI.PixmapCache.getIcon("editDelete.png"), 415 UI.PixmapCache.getIcon("editDelete"),
416 self.tr('Cl&ear'), 416 self.tr('Cl&ear'),
417 QKeySequence(self.tr("Alt+Shift+C", "Edit|Clear")), 417 QKeySequence(self.tr("Alt+Shift+C", "Edit|Clear")),
418 0, 418 0,
419 self, 'iconEditor_edit_clear') 419 self, 'iconEditor_edit_clear')
420 self.deleteAct.setStatusTip(self.tr('Clear the icon image')) 420 self.deleteAct.setStatusTip(self.tr('Clear the icon image'))
441 self.selectAllAct.triggered.connect(self.__editor.editSelectAll) 441 self.selectAllAct.triggered.connect(self.__editor.editSelectAll)
442 self.__actions.append(self.selectAllAct) 442 self.__actions.append(self.selectAllAct)
443 443
444 self.resizeAct = E5Action( 444 self.resizeAct = E5Action(
445 self.tr('Change Size'), 445 self.tr('Change Size'),
446 UI.PixmapCache.getIcon("transformResize.png"), 446 UI.PixmapCache.getIcon("transformResize"),
447 self.tr('Change Si&ze...'), 447 self.tr('Change Si&ze...'),
448 0, 0, 448 0, 0,
449 self, 'iconEditor_edit_change_size') 449 self, 'iconEditor_edit_change_size')
450 self.resizeAct.setStatusTip(self.tr('Change the icon size')) 450 self.resizeAct.setStatusTip(self.tr('Change the icon size'))
451 self.resizeAct.setWhatsThis(self.tr( 451 self.resizeAct.setWhatsThis(self.tr(
455 self.resizeAct.triggered.connect(self.__editor.editResize) 455 self.resizeAct.triggered.connect(self.__editor.editResize)
456 self.__actions.append(self.resizeAct) 456 self.__actions.append(self.resizeAct)
457 457
458 self.grayscaleAct = E5Action( 458 self.grayscaleAct = E5Action(
459 self.tr('Grayscale'), 459 self.tr('Grayscale'),
460 UI.PixmapCache.getIcon("grayscale.png"), 460 UI.PixmapCache.getIcon("grayscale"),
461 self.tr('&Grayscale'), 461 self.tr('&Grayscale'),
462 0, 0, 462 0, 0,
463 self, 'iconEditor_edit_grayscale') 463 self, 'iconEditor_edit_grayscale')
464 self.grayscaleAct.setStatusTip(self.tr( 464 self.grayscaleAct.setStatusTip(self.tr(
465 'Change the icon to grayscale')) 465 'Change the icon to grayscale'))
492 """ 492 """
493 Private method to create the View actions. 493 Private method to create the View actions.
494 """ 494 """
495 self.zoomInAct = E5Action( 495 self.zoomInAct = E5Action(
496 self.tr('Zoom in'), 496 self.tr('Zoom in'),
497 UI.PixmapCache.getIcon("zoomIn.png"), 497 UI.PixmapCache.getIcon("zoomIn"),
498 self.tr('Zoom &in'), 498 self.tr('Zoom &in'),
499 QKeySequence(self.tr("Ctrl++", "View|Zoom in")), 499 QKeySequence(self.tr("Ctrl++", "View|Zoom in")),
500 0, self, 'iconEditor_view_zoom_in') 500 0, self, 'iconEditor_view_zoom_in')
501 self.zoomInAct.setStatusTip(self.tr('Zoom in on the icon')) 501 self.zoomInAct.setStatusTip(self.tr('Zoom in on the icon'))
502 self.zoomInAct.setWhatsThis(self.tr( 502 self.zoomInAct.setWhatsThis(self.tr(
506 self.zoomInAct.triggered.connect(self.__zoomIn) 506 self.zoomInAct.triggered.connect(self.__zoomIn)
507 self.__actions.append(self.zoomInAct) 507 self.__actions.append(self.zoomInAct)
508 508
509 self.zoomOutAct = E5Action( 509 self.zoomOutAct = E5Action(
510 self.tr('Zoom out'), 510 self.tr('Zoom out'),
511 UI.PixmapCache.getIcon("zoomOut.png"), 511 UI.PixmapCache.getIcon("zoomOut"),
512 self.tr('Zoom &out'), 512 self.tr('Zoom &out'),
513 QKeySequence(self.tr("Ctrl+-", "View|Zoom out")), 513 QKeySequence(self.tr("Ctrl+-", "View|Zoom out")),
514 0, self, 'iconEditor_view_zoom_out') 514 0, self, 'iconEditor_view_zoom_out')
515 self.zoomOutAct.setStatusTip(self.tr('Zoom out on the icon')) 515 self.zoomOutAct.setStatusTip(self.tr('Zoom out on the icon'))
516 self.zoomOutAct.setWhatsThis(self.tr( 516 self.zoomOutAct.setWhatsThis(self.tr(
520 self.zoomOutAct.triggered.connect(self.__zoomOut) 520 self.zoomOutAct.triggered.connect(self.__zoomOut)
521 self.__actions.append(self.zoomOutAct) 521 self.__actions.append(self.zoomOutAct)
522 522
523 self.zoomResetAct = E5Action( 523 self.zoomResetAct = E5Action(
524 self.tr('Zoom reset'), 524 self.tr('Zoom reset'),
525 UI.PixmapCache.getIcon("zoomReset.png"), 525 UI.PixmapCache.getIcon("zoomReset"),
526 self.tr('Zoom &reset'), 526 self.tr('Zoom &reset'),
527 QKeySequence(self.tr("Ctrl+0", "View|Zoom reset")), 527 QKeySequence(self.tr("Ctrl+0", "View|Zoom reset")),
528 0, self, 'iconEditor_view_zoom_reset') 528 0, self, 'iconEditor_view_zoom_reset')
529 self.zoomResetAct.setStatusTip(self.tr( 529 self.zoomResetAct.setStatusTip(self.tr(
530 'Reset the zoom of the icon')) 530 'Reset the zoom of the icon'))
536 self.zoomResetAct.triggered.connect(self.__zoomReset) 536 self.zoomResetAct.triggered.connect(self.__zoomReset)
537 self.__actions.append(self.zoomResetAct) 537 self.__actions.append(self.zoomResetAct)
538 538
539 self.showGridAct = E5Action( 539 self.showGridAct = E5Action(
540 self.tr('Show Grid'), 540 self.tr('Show Grid'),
541 UI.PixmapCache.getIcon("grid.png"), 541 UI.PixmapCache.getIcon("grid"),
542 self.tr('Show &Grid'), 542 self.tr('Show &Grid'),
543 0, 0, 543 0, 0,
544 self, 'iconEditor_view_show_grid') 544 self, 'iconEditor_view_show_grid')
545 self.showGridAct.setStatusTip(self.tr( 545 self.showGridAct.setStatusTip(self.tr(
546 'Toggle the display of the grid')) 546 'Toggle the display of the grid'))
563 self.drawingActGrp = createActionGroup(self) 563 self.drawingActGrp = createActionGroup(self)
564 self.drawingActGrp.setExclusive(True) 564 self.drawingActGrp.setExclusive(True)
565 565
566 self.drawPencilAct = E5Action( 566 self.drawPencilAct = E5Action(
567 self.tr('Freehand'), 567 self.tr('Freehand'),
568 UI.PixmapCache.getIcon("drawBrush.png"), 568 UI.PixmapCache.getIcon("drawBrush"),
569 self.tr('&Freehand'), 569 self.tr('&Freehand'),
570 0, 0, 570 0, 0,
571 self.drawingActGrp, 'iconEditor_tools_pencil') 571 self.drawingActGrp, 'iconEditor_tools_pencil')
572 self.drawPencilAct.setWhatsThis(self.tr( 572 self.drawPencilAct.setWhatsThis(self.tr(
573 """<b>Free hand</b>""" 573 """<b>Free hand</b>"""
578 self.drawPencilAct.triggered.connect(self.esm.map) 578 self.drawPencilAct.triggered.connect(self.esm.map)
579 self.__actions.append(self.drawPencilAct) 579 self.__actions.append(self.drawPencilAct)
580 580
581 self.drawColorPickerAct = E5Action( 581 self.drawColorPickerAct = E5Action(
582 self.tr('Color Picker'), 582 self.tr('Color Picker'),
583 UI.PixmapCache.getIcon("colorPicker.png"), 583 UI.PixmapCache.getIcon("colorPicker"),
584 self.tr('&Color Picker'), 584 self.tr('&Color Picker'),
585 0, 0, 585 0, 0,
586 self.drawingActGrp, 'iconEditor_tools_color_picker') 586 self.drawingActGrp, 'iconEditor_tools_color_picker')
587 self.drawColorPickerAct.setWhatsThis(self.tr( 587 self.drawColorPickerAct.setWhatsThis(self.tr(
588 """<b>Color Picker</b>""" 588 """<b>Color Picker</b>"""
595 self.drawColorPickerAct.triggered.connect(self.esm.map) 595 self.drawColorPickerAct.triggered.connect(self.esm.map)
596 self.__actions.append(self.drawColorPickerAct) 596 self.__actions.append(self.drawColorPickerAct)
597 597
598 self.drawRectangleAct = E5Action( 598 self.drawRectangleAct = E5Action(
599 self.tr('Rectangle'), 599 self.tr('Rectangle'),
600 UI.PixmapCache.getIcon("drawRectangle.png"), 600 UI.PixmapCache.getIcon("drawRectangle"),
601 self.tr('&Rectangle'), 601 self.tr('&Rectangle'),
602 0, 0, 602 0, 0,
603 self.drawingActGrp, 'iconEditor_tools_rectangle') 603 self.drawingActGrp, 'iconEditor_tools_rectangle')
604 self.drawRectangleAct.setWhatsThis(self.tr( 604 self.drawRectangleAct.setWhatsThis(self.tr(
605 """<b>Rectangle</b>""" 605 """<b>Rectangle</b>"""
610 self.drawRectangleAct.triggered.connect(self.esm.map) 610 self.drawRectangleAct.triggered.connect(self.esm.map)
611 self.__actions.append(self.drawRectangleAct) 611 self.__actions.append(self.drawRectangleAct)
612 612
613 self.drawFilledRectangleAct = E5Action( 613 self.drawFilledRectangleAct = E5Action(
614 self.tr('Filled Rectangle'), 614 self.tr('Filled Rectangle'),
615 UI.PixmapCache.getIcon("drawRectangleFilled.png"), 615 UI.PixmapCache.getIcon("drawRectangleFilled"),
616 self.tr('F&illed Rectangle'), 616 self.tr('F&illed Rectangle'),
617 0, 0, 617 0, 0,
618 self.drawingActGrp, 'iconEditor_tools_filled_rectangle') 618 self.drawingActGrp, 'iconEditor_tools_filled_rectangle')
619 self.drawFilledRectangleAct.setWhatsThis(self.tr( 619 self.drawFilledRectangleAct.setWhatsThis(self.tr(
620 """<b>Filled Rectangle</b>""" 620 """<b>Filled Rectangle</b>"""
626 self.drawFilledRectangleAct.triggered.connect(self.esm.map) 626 self.drawFilledRectangleAct.triggered.connect(self.esm.map)
627 self.__actions.append(self.drawFilledRectangleAct) 627 self.__actions.append(self.drawFilledRectangleAct)
628 628
629 self.drawCircleAct = E5Action( 629 self.drawCircleAct = E5Action(
630 self.tr('Circle'), 630 self.tr('Circle'),
631 UI.PixmapCache.getIcon("drawCircle.png"), 631 UI.PixmapCache.getIcon("drawCircle"),
632 self.tr('Circle'), 632 self.tr('Circle'),
633 0, 0, 633 0, 0,
634 self.drawingActGrp, 'iconEditor_tools_circle') 634 self.drawingActGrp, 'iconEditor_tools_circle')
635 self.drawCircleAct.setWhatsThis(self.tr( 635 self.drawCircleAct.setWhatsThis(self.tr(
636 """<b>Circle</b>""" 636 """<b>Circle</b>"""
641 self.drawCircleAct.triggered.connect(self.esm.map) 641 self.drawCircleAct.triggered.connect(self.esm.map)
642 self.__actions.append(self.drawCircleAct) 642 self.__actions.append(self.drawCircleAct)
643 643
644 self.drawFilledCircleAct = E5Action( 644 self.drawFilledCircleAct = E5Action(
645 self.tr('Filled Circle'), 645 self.tr('Filled Circle'),
646 UI.PixmapCache.getIcon("drawCircleFilled.png"), 646 UI.PixmapCache.getIcon("drawCircleFilled"),
647 self.tr('Fille&d Circle'), 647 self.tr('Fille&d Circle'),
648 0, 0, 648 0, 0,
649 self.drawingActGrp, 'iconEditor_tools_filled_circle') 649 self.drawingActGrp, 'iconEditor_tools_filled_circle')
650 self.drawFilledCircleAct.setWhatsThis(self.tr( 650 self.drawFilledCircleAct.setWhatsThis(self.tr(
651 """<b>Filled Circle</b>""" 651 """<b>Filled Circle</b>"""
657 self.drawFilledCircleAct.triggered.connect(self.esm.map) 657 self.drawFilledCircleAct.triggered.connect(self.esm.map)
658 self.__actions.append(self.drawFilledCircleAct) 658 self.__actions.append(self.drawFilledCircleAct)
659 659
660 self.drawEllipseAct = E5Action( 660 self.drawEllipseAct = E5Action(
661 self.tr('Ellipse'), 661 self.tr('Ellipse'),
662 UI.PixmapCache.getIcon("drawEllipse.png"), 662 UI.PixmapCache.getIcon("drawEllipse"),
663 self.tr('&Ellipse'), 663 self.tr('&Ellipse'),
664 0, 0, 664 0, 0,
665 self.drawingActGrp, 'iconEditor_tools_ellipse') 665 self.drawingActGrp, 'iconEditor_tools_ellipse')
666 self.drawEllipseAct.setWhatsThis(self.tr( 666 self.drawEllipseAct.setWhatsThis(self.tr(
667 """<b>Ellipse</b>""" 667 """<b>Ellipse</b>"""
672 self.drawEllipseAct.triggered.connect(self.esm.map) 672 self.drawEllipseAct.triggered.connect(self.esm.map)
673 self.__actions.append(self.drawEllipseAct) 673 self.__actions.append(self.drawEllipseAct)
674 674
675 self.drawFilledEllipseAct = E5Action( 675 self.drawFilledEllipseAct = E5Action(
676 self.tr('Filled Ellipse'), 676 self.tr('Filled Ellipse'),
677 UI.PixmapCache.getIcon("drawEllipseFilled.png"), 677 UI.PixmapCache.getIcon("drawEllipseFilled"),
678 self.tr('Fille&d Elli&pse'), 678 self.tr('Fille&d Elli&pse'),
679 0, 0, 679 0, 0,
680 self.drawingActGrp, 'iconEditor_tools_filled_ellipse') 680 self.drawingActGrp, 'iconEditor_tools_filled_ellipse')
681 self.drawFilledEllipseAct.setWhatsThis(self.tr( 681 self.drawFilledEllipseAct.setWhatsThis(self.tr(
682 """<b>Filled Ellipse</b>""" 682 """<b>Filled Ellipse</b>"""
688 self.drawFilledEllipseAct.triggered.connect(self.esm.map) 688 self.drawFilledEllipseAct.triggered.connect(self.esm.map)
689 self.__actions.append(self.drawFilledEllipseAct) 689 self.__actions.append(self.drawFilledEllipseAct)
690 690
691 self.drawFloodFillAct = E5Action( 691 self.drawFloodFillAct = E5Action(
692 self.tr('Flood Fill'), 692 self.tr('Flood Fill'),
693 UI.PixmapCache.getIcon("drawFill.png"), 693 UI.PixmapCache.getIcon("drawFill"),
694 self.tr('Fl&ood Fill'), 694 self.tr('Fl&ood Fill'),
695 0, 0, 695 0, 0,
696 self.drawingActGrp, 'iconEditor_tools_flood_fill') 696 self.drawingActGrp, 'iconEditor_tools_flood_fill')
697 self.drawFloodFillAct.setWhatsThis(self.tr( 697 self.drawFloodFillAct.setWhatsThis(self.tr(
698 """<b>Flood Fill</b>""" 698 """<b>Flood Fill</b>"""
704 self.drawFloodFillAct.triggered.connect(self.esm.map) 704 self.drawFloodFillAct.triggered.connect(self.esm.map)
705 self.__actions.append(self.drawFloodFillAct) 705 self.__actions.append(self.drawFloodFillAct)
706 706
707 self.drawLineAct = E5Action( 707 self.drawLineAct = E5Action(
708 self.tr('Line'), 708 self.tr('Line'),
709 UI.PixmapCache.getIcon("drawLine.png"), 709 UI.PixmapCache.getIcon("drawLine"),
710 self.tr('&Line'), 710 self.tr('&Line'),
711 0, 0, 711 0, 0,
712 self.drawingActGrp, 'iconEditor_tools_line') 712 self.drawingActGrp, 'iconEditor_tools_line')
713 self.drawLineAct.setWhatsThis(self.tr( 713 self.drawLineAct.setWhatsThis(self.tr(
714 """<b>Line</b>""" 714 """<b>Line</b>"""
719 self.drawLineAct.triggered.connect(self.esm.map) 719 self.drawLineAct.triggered.connect(self.esm.map)
720 self.__actions.append(self.drawLineAct) 720 self.__actions.append(self.drawLineAct)
721 721
722 self.drawEraserAct = E5Action( 722 self.drawEraserAct = E5Action(
723 self.tr('Eraser (Transparent)'), 723 self.tr('Eraser (Transparent)'),
724 UI.PixmapCache.getIcon("drawEraser.png"), 724 UI.PixmapCache.getIcon("drawEraser"),
725 self.tr('Eraser (&Transparent)'), 725 self.tr('Eraser (&Transparent)'),
726 0, 0, 726 0, 0,
727 self.drawingActGrp, 'iconEditor_tools_eraser') 727 self.drawingActGrp, 'iconEditor_tools_eraser')
728 self.drawEraserAct.setWhatsThis(self.tr( 728 self.drawEraserAct.setWhatsThis(self.tr(
729 """<b>Eraser (Transparent)</b>""" 729 """<b>Eraser (Transparent)</b>"""
734 self.drawEraserAct.triggered.connect(self.esm.map) 734 self.drawEraserAct.triggered.connect(self.esm.map)
735 self.__actions.append(self.drawEraserAct) 735 self.__actions.append(self.drawEraserAct)
736 736
737 self.drawRectangleSelectionAct = E5Action( 737 self.drawRectangleSelectionAct = E5Action(
738 self.tr('Rectangular Selection'), 738 self.tr('Rectangular Selection'),
739 UI.PixmapCache.getIcon("selectRectangle.png"), 739 UI.PixmapCache.getIcon("selectRectangle"),
740 self.tr('Rect&angular Selection'), 740 self.tr('Rect&angular Selection'),
741 0, 0, 741 0, 0,
742 self.drawingActGrp, 'iconEditor_tools_selection_rectangle') 742 self.drawingActGrp, 'iconEditor_tools_selection_rectangle')
743 self.drawRectangleSelectionAct.setWhatsThis(self.tr( 743 self.drawRectangleSelectionAct.setWhatsThis(self.tr(
744 """<b>Rectangular Selection</b>""" 744 """<b>Rectangular Selection</b>"""
751 self.drawRectangleSelectionAct.triggered.connect(self.esm.map) 751 self.drawRectangleSelectionAct.triggered.connect(self.esm.map)
752 self.__actions.append(self.drawRectangleSelectionAct) 752 self.__actions.append(self.drawRectangleSelectionAct)
753 753
754 self.drawCircleSelectionAct = E5Action( 754 self.drawCircleSelectionAct = E5Action(
755 self.tr('Circular Selection'), 755 self.tr('Circular Selection'),
756 UI.PixmapCache.getIcon("selectCircle.png"), 756 UI.PixmapCache.getIcon("selectCircle"),
757 self.tr('Rect&angular Selection'), 757 self.tr('Rect&angular Selection'),
758 0, 0, 758 0, 0,
759 self.drawingActGrp, 'iconEditor_tools_selection_circle') 759 self.drawingActGrp, 'iconEditor_tools_selection_circle')
760 self.drawCircleSelectionAct.setWhatsThis(self.tr( 760 self.drawCircleSelectionAct.setWhatsThis(self.tr(
761 """<b>Circular Selection</b>""" 761 """<b>Circular Selection</b>"""
799 self.aboutQtAct.triggered.connect(self.__aboutQt) 799 self.aboutQtAct.triggered.connect(self.__aboutQt)
800 self.__actions.append(self.aboutQtAct) 800 self.__actions.append(self.aboutQtAct)
801 801
802 self.whatsThisAct = E5Action( 802 self.whatsThisAct = E5Action(
803 self.tr('What\'s This?'), 803 self.tr('What\'s This?'),
804 UI.PixmapCache.getIcon("whatsThis.png"), 804 UI.PixmapCache.getIcon("whatsThis"),
805 self.tr('&What\'s This?'), 805 self.tr('&What\'s This?'),
806 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")), 806 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")),
807 0, self, 'iconEditor_help_whats_this') 807 0, self, 'iconEditor_help_whats_this')
808 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help')) 808 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help'))
809 self.whatsThisAct.setWhatsThis(self.tr( 809 self.whatsThisAct.setWhatsThis(self.tr(
969 """ position.</p>""" 969 """ position.</p>"""
970 )) 970 ))
971 self.__updatePosition(0, 0) 971 self.__updatePosition(0, 0)
972 972
973 self.__zoomWidget = E5ZoomWidget( 973 self.__zoomWidget = E5ZoomWidget(
974 UI.PixmapCache.getPixmap("zoomOut.png"), 974 UI.PixmapCache.getPixmap("zoomOut"),
975 UI.PixmapCache.getPixmap("zoomIn.png"), 975 UI.PixmapCache.getPixmap("zoomIn"),
976 UI.PixmapCache.getPixmap("zoomReset.png"), self) 976 UI.PixmapCache.getPixmap("zoomReset"), self)
977 self.__zoomWidget.setMinimum(IconEditorGrid.ZoomMinimum) 977 self.__zoomWidget.setMinimum(IconEditorGrid.ZoomMinimum)
978 self.__zoomWidget.setMaximum(IconEditorGrid.ZoomMaximum) 978 self.__zoomWidget.setMaximum(IconEditorGrid.ZoomMaximum)
979 self.__zoomWidget.setDefault(IconEditorGrid.ZoomDefault) 979 self.__zoomWidget.setDefault(IconEditorGrid.ZoomDefault)
980 self.__zoomWidget.setSingleStep(IconEditorGrid.ZoomStep) 980 self.__zoomWidget.setSingleStep(IconEditorGrid.ZoomStep)
981 self.__zoomWidget.setPercent(IconEditorGrid.ZoomPercent) 981 self.__zoomWidget.setPercent(IconEditorGrid.ZoomPercent)

eric ide

mercurial