src/eric7/IconEditor/IconEditorWindow.py

branch
eric7
changeset 9573
9960d19d66b5
parent 9473
3f23dbf37dbe
child 9576
be9f8e7e42e0
equal deleted inserted replaced
9572:3b46c662a004 9573:9960d19d66b5
197 self, 197 self,
198 "iconEditor_file_new", 198 "iconEditor_file_new",
199 ) 199 )
200 self.newAct.setStatusTip(self.tr("Create a new icon")) 200 self.newAct.setStatusTip(self.tr("Create a new icon"))
201 self.newAct.setWhatsThis( 201 self.newAct.setWhatsThis(
202 self.tr("""<b>New</b>""" """<p>This creates a new icon.</p>""") 202 self.tr("""<b>New</b><p>This creates a new icon.</p>""")
203 ) 203 )
204 self.newAct.triggered.connect(self.__newIcon) 204 self.newAct.triggered.connect(self.__newIcon)
205 self.__actions.append(self.newAct) 205 self.__actions.append(self.newAct)
206 206
207 self.newWindowAct = EricAction( 207 self.newWindowAct = EricAction(
291 "iconEditor_file_close", 291 "iconEditor_file_close",
292 ) 292 )
293 self.closeAct.setStatusTip(self.tr("Close the current icon editor window")) 293 self.closeAct.setStatusTip(self.tr("Close the current icon editor window"))
294 self.closeAct.setWhatsThis( 294 self.closeAct.setWhatsThis(
295 self.tr( 295 self.tr(
296 """<b>Close</b>""" """<p>Closes the current icon editor window.</p>""" 296 """<b>Close</b><p>Closes the current icon editor window.</p>"""
297 ) 297 )
298 ) 298 )
299 self.closeAct.triggered.connect(self.close) 299 self.closeAct.triggered.connect(self.close)
300 self.__actions.append(self.closeAct) 300 self.__actions.append(self.closeAct)
301 301
344 self, 344 self,
345 "iconEditor_file_quit", 345 "iconEditor_file_quit",
346 ) 346 )
347 self.exitAct.setStatusTip(self.tr("Quit the icon editor")) 347 self.exitAct.setStatusTip(self.tr("Quit the icon editor"))
348 self.exitAct.setWhatsThis( 348 self.exitAct.setWhatsThis(
349 self.tr("""<b>Quit</b>""" """<p>Quit the icon editor.</p>""") 349 self.tr("""<b>Quit</b><p>Quit the icon editor.</p>""")
350 ) 350 )
351 if not self.fromEric: 351 if not self.fromEric:
352 self.exitAct.triggered.connect(self.__closeAll) 352 self.exitAct.triggered.connect(self.__closeAll)
353 self.__actions.append(self.exitAct) 353 self.__actions.append(self.exitAct)
354 354
365 self, 365 self,
366 "iconEditor_edit_undo", 366 "iconEditor_edit_undo",
367 ) 367 )
368 self.undoAct.setStatusTip(self.tr("Undo the last change")) 368 self.undoAct.setStatusTip(self.tr("Undo the last change"))
369 self.undoAct.setWhatsThis( 369 self.undoAct.setWhatsThis(
370 self.tr("""<b>Undo</b>""" """<p>Undo the last change done.</p>""") 370 self.tr("""<b>Undo</b><p>Undo the last change done.</p>""")
371 ) 371 )
372 self.undoAct.triggered.connect(self.__editor.editUndo) 372 self.undoAct.triggered.connect(self.__editor.editUndo)
373 self.__actions.append(self.undoAct) 373 self.__actions.append(self.undoAct)
374 374
375 self.redoAct = EricAction( 375 self.redoAct = EricAction(
381 self, 381 self,
382 "iconEditor_edit_redo", 382 "iconEditor_edit_redo",
383 ) 383 )
384 self.redoAct.setStatusTip(self.tr("Redo the last change")) 384 self.redoAct.setStatusTip(self.tr("Redo the last change"))
385 self.redoAct.setWhatsThis( 385 self.redoAct.setWhatsThis(
386 self.tr("""<b>Redo</b>""" """<p>Redo the last change done.</p>""") 386 self.tr("""<b>Redo</b><p>Redo the last change done.</p>""")
387 ) 387 )
388 self.redoAct.triggered.connect(self.__editor.editRedo) 388 self.redoAct.triggered.connect(self.__editor.editRedo)
389 self.__actions.append(self.redoAct) 389 self.__actions.append(self.redoAct)
390 390
391 self.cutAct = EricAction( 391 self.cutAct = EricAction(
435 self, 435 self,
436 "iconEditor_edit_paste", 436 "iconEditor_edit_paste",
437 ) 437 )
438 self.pasteAct.setStatusTip(self.tr("Paste the clipboard image")) 438 self.pasteAct.setStatusTip(self.tr("Paste the clipboard image"))
439 self.pasteAct.setWhatsThis( 439 self.pasteAct.setWhatsThis(
440 self.tr("""<b>Paste</b>""" """<p>Paste the clipboard image.</p>""") 440 self.tr("""<b>Paste</b><p>Paste the clipboard image.</p>""")
441 ) 441 )
442 self.pasteAct.triggered.connect(self.__editor.editPaste) 442 self.pasteAct.triggered.connect(self.__editor.editPaste)
443 self.__actions.append(self.pasteAct) 443 self.__actions.append(self.pasteAct)
444 444
445 self.pasteNewAct = EricAction( 445 self.pasteNewAct = EricAction(
491 "iconEditor_edit_select_all", 491 "iconEditor_edit_select_all",
492 ) 492 )
493 self.selectAllAct.setStatusTip(self.tr("Select the complete icon image")) 493 self.selectAllAct.setStatusTip(self.tr("Select the complete icon image"))
494 self.selectAllAct.setWhatsThis( 494 self.selectAllAct.setWhatsThis(
495 self.tr( 495 self.tr(
496 """<b>Select All</b>""" """<p>Selects the complete icon image.</p>""" 496 """<b>Select All</b><p>Selects the complete icon image.</p>"""
497 ) 497 )
498 ) 498 )
499 self.selectAllAct.triggered.connect(self.__editor.editSelectAll) 499 self.selectAllAct.triggered.connect(self.__editor.editSelectAll)
500 self.__actions.append(self.selectAllAct) 500 self.__actions.append(self.selectAllAct)
501 501
508 self, 508 self,
509 "iconEditor_edit_change_size", 509 "iconEditor_edit_change_size",
510 ) 510 )
511 self.resizeAct.setStatusTip(self.tr("Change the icon size")) 511 self.resizeAct.setStatusTip(self.tr("Change the icon size"))
512 self.resizeAct.setWhatsThis( 512 self.resizeAct.setWhatsThis(
513 self.tr("""<b>Change Size...</b>""" """<p>Changes the icon size.</p>""") 513 self.tr("""<b>Change Size...</b><p>Changes the icon size.</p>""")
514 ) 514 )
515 self.resizeAct.triggered.connect(self.__editor.editResize) 515 self.resizeAct.triggered.connect(self.__editor.editResize)
516 self.__actions.append(self.resizeAct) 516 self.__actions.append(self.resizeAct)
517 517
518 self.grayscaleAct = EricAction( 518 self.grayscaleAct = EricAction(
524 self, 524 self,
525 "iconEditor_edit_grayscale", 525 "iconEditor_edit_grayscale",
526 ) 526 )
527 self.grayscaleAct.setStatusTip(self.tr("Change the icon to grayscale")) 527 self.grayscaleAct.setStatusTip(self.tr("Change the icon to grayscale"))
528 self.grayscaleAct.setWhatsThis( 528 self.grayscaleAct.setWhatsThis(
529 self.tr("""<b>Grayscale</b>""" """<p>Changes the icon to grayscale.</p>""") 529 self.tr("""<b>Grayscale</b><p>Changes the icon to grayscale.</p>""")
530 ) 530 )
531 self.grayscaleAct.triggered.connect(self.__editor.grayScale) 531 self.grayscaleAct.triggered.connect(self.__editor.grayScale)
532 self.__actions.append(self.grayscaleAct) 532 self.__actions.append(self.grayscaleAct)
533 533
534 self.redoAct.setEnabled(False) 534 self.redoAct.setEnabled(False)
618 self, 618 self,
619 "iconEditor_view_show_grid", 619 "iconEditor_view_show_grid",
620 ) 620 )
621 self.showGridAct.setStatusTip(self.tr("Toggle the display of the grid")) 621 self.showGridAct.setStatusTip(self.tr("Toggle the display of the grid"))
622 self.showGridAct.setWhatsThis( 622 self.showGridAct.setWhatsThis(
623 self.tr("""<b>Show Grid</b>""" """<p>Toggle the display of the grid.</p>""") 623 self.tr("""<b>Show Grid</b><p>Toggle the display of the grid.</p>""")
624 ) 624 )
625 self.showGridAct.triggered[bool].connect(self.__editor.setGridEnabled) 625 self.showGridAct.triggered[bool].connect(self.__editor.setGridEnabled)
626 self.__actions.append(self.showGridAct) 626 self.__actions.append(self.showGridAct)
627 self.showGridAct.setCheckable(True) 627 self.showGridAct.setCheckable(True)
628 self.showGridAct.setChecked(self.__editor.isGridEnabled()) 628 self.showGridAct.setChecked(self.__editor.isGridEnabled())
645 0, 645 0,
646 self.drawingActGrp, 646 self.drawingActGrp,
647 "iconEditor_tools_pencil", 647 "iconEditor_tools_pencil",
648 ) 648 )
649 self.drawPencilAct.setWhatsThis( 649 self.drawPencilAct.setWhatsThis(
650 self.tr("""<b>Free hand</b>""" """<p>Draws non linear lines.</p>""") 650 self.tr("""<b>Free hand</b><p>Draws non linear lines.</p>""")
651 ) 651 )
652 self.drawPencilAct.setCheckable(True) 652 self.drawPencilAct.setCheckable(True)
653 self.esm.setMapping(self.drawPencilAct, IconEditorTool.PENCIL) 653 self.esm.setMapping(self.drawPencilAct, IconEditorTool.PENCIL)
654 self.drawPencilAct.triggered.connect(self.esm.map) 654 self.drawPencilAct.triggered.connect(self.esm.map)
655 self.__actions.append(self.drawPencilAct) 655 self.__actions.append(self.drawPencilAct)
683 0, 683 0,
684 self.drawingActGrp, 684 self.drawingActGrp,
685 "iconEditor_tools_rectangle", 685 "iconEditor_tools_rectangle",
686 ) 686 )
687 self.drawRectangleAct.setWhatsThis( 687 self.drawRectangleAct.setWhatsThis(
688 self.tr("""<b>Rectangle</b>""" """<p>Draw a rectangle.</p>""") 688 self.tr("""<b>Rectangle</b><p>Draw a rectangle.</p>""")
689 ) 689 )
690 self.drawRectangleAct.setCheckable(True) 690 self.drawRectangleAct.setCheckable(True)
691 self.esm.setMapping(self.drawRectangleAct, IconEditorTool.RECTANGLE) 691 self.esm.setMapping(self.drawRectangleAct, IconEditorTool.RECTANGLE)
692 self.drawRectangleAct.triggered.connect(self.esm.map) 692 self.drawRectangleAct.triggered.connect(self.esm.map)
693 self.__actions.append(self.drawRectangleAct) 693 self.__actions.append(self.drawRectangleAct)
700 0, 700 0,
701 self.drawingActGrp, 701 self.drawingActGrp,
702 "iconEditor_tools_filled_rectangle", 702 "iconEditor_tools_filled_rectangle",
703 ) 703 )
704 self.drawFilledRectangleAct.setWhatsThis( 704 self.drawFilledRectangleAct.setWhatsThis(
705 self.tr("""<b>Filled Rectangle</b>""" """<p>Draw a filled rectangle.</p>""") 705 self.tr("""<b>Filled Rectangle</b><p>Draw a filled rectangle.</p>""")
706 ) 706 )
707 self.drawFilledRectangleAct.setCheckable(True) 707 self.drawFilledRectangleAct.setCheckable(True)
708 self.esm.setMapping( 708 self.esm.setMapping(
709 self.drawFilledRectangleAct, IconEditorTool.FILLED_RECTANGLE 709 self.drawFilledRectangleAct, IconEditorTool.FILLED_RECTANGLE
710 ) 710 )
719 0, 719 0,
720 self.drawingActGrp, 720 self.drawingActGrp,
721 "iconEditor_tools_circle", 721 "iconEditor_tools_circle",
722 ) 722 )
723 self.drawCircleAct.setWhatsThis( 723 self.drawCircleAct.setWhatsThis(
724 self.tr("""<b>Circle</b>""" """<p>Draw a circle.</p>""") 724 self.tr("""<b>Circle</b><p>Draw a circle.</p>""")
725 ) 725 )
726 self.drawCircleAct.setCheckable(True) 726 self.drawCircleAct.setCheckable(True)
727 self.esm.setMapping(self.drawCircleAct, IconEditorTool.CIRCLE) 727 self.esm.setMapping(self.drawCircleAct, IconEditorTool.CIRCLE)
728 self.drawCircleAct.triggered.connect(self.esm.map) 728 self.drawCircleAct.triggered.connect(self.esm.map)
729 self.__actions.append(self.drawCircleAct) 729 self.__actions.append(self.drawCircleAct)
736 0, 736 0,
737 self.drawingActGrp, 737 self.drawingActGrp,
738 "iconEditor_tools_filled_circle", 738 "iconEditor_tools_filled_circle",
739 ) 739 )
740 self.drawFilledCircleAct.setWhatsThis( 740 self.drawFilledCircleAct.setWhatsThis(
741 self.tr("""<b>Filled Circle</b>""" """<p>Draw a filled circle.</p>""") 741 self.tr("""<b>Filled Circle</b><p>Draw a filled circle.</p>""")
742 ) 742 )
743 self.drawFilledCircleAct.setCheckable(True) 743 self.drawFilledCircleAct.setCheckable(True)
744 self.esm.setMapping(self.drawFilledCircleAct, IconEditorTool.FILLED_CIRCLE) 744 self.esm.setMapping(self.drawFilledCircleAct, IconEditorTool.FILLED_CIRCLE)
745 self.drawFilledCircleAct.triggered.connect(self.esm.map) 745 self.drawFilledCircleAct.triggered.connect(self.esm.map)
746 self.__actions.append(self.drawFilledCircleAct) 746 self.__actions.append(self.drawFilledCircleAct)
753 0, 753 0,
754 self.drawingActGrp, 754 self.drawingActGrp,
755 "iconEditor_tools_ellipse", 755 "iconEditor_tools_ellipse",
756 ) 756 )
757 self.drawEllipseAct.setWhatsThis( 757 self.drawEllipseAct.setWhatsThis(
758 self.tr("""<b>Ellipse</b>""" """<p>Draw an ellipse.</p>""") 758 self.tr("""<b>Ellipse</b><p>Draw an ellipse.</p>""")
759 ) 759 )
760 self.drawEllipseAct.setCheckable(True) 760 self.drawEllipseAct.setCheckable(True)
761 self.esm.setMapping(self.drawEllipseAct, IconEditorTool.ELLIPSE) 761 self.esm.setMapping(self.drawEllipseAct, IconEditorTool.ELLIPSE)
762 self.drawEllipseAct.triggered.connect(self.esm.map) 762 self.drawEllipseAct.triggered.connect(self.esm.map)
763 self.__actions.append(self.drawEllipseAct) 763 self.__actions.append(self.drawEllipseAct)
770 0, 770 0,
771 self.drawingActGrp, 771 self.drawingActGrp,
772 "iconEditor_tools_filled_ellipse", 772 "iconEditor_tools_filled_ellipse",
773 ) 773 )
774 self.drawFilledEllipseAct.setWhatsThis( 774 self.drawFilledEllipseAct.setWhatsThis(
775 self.tr("""<b>Filled Ellipse</b>""" """<p>Draw a filled ellipse.</p>""") 775 self.tr("""<b>Filled Ellipse</b><p>Draw a filled ellipse.</p>""")
776 ) 776 )
777 self.drawFilledEllipseAct.setCheckable(True) 777 self.drawFilledEllipseAct.setCheckable(True)
778 self.esm.setMapping(self.drawFilledEllipseAct, IconEditorTool.FILLED_ELLIPSE) 778 self.esm.setMapping(self.drawFilledEllipseAct, IconEditorTool.FILLED_ELLIPSE)
779 self.drawFilledEllipseAct.triggered.connect(self.esm.map) 779 self.drawFilledEllipseAct.triggered.connect(self.esm.map)
780 self.__actions.append(self.drawFilledEllipseAct) 780 self.__actions.append(self.drawFilledEllipseAct)
808 0, 808 0,
809 self.drawingActGrp, 809 self.drawingActGrp,
810 "iconEditor_tools_line", 810 "iconEditor_tools_line",
811 ) 811 )
812 self.drawLineAct.setWhatsThis( 812 self.drawLineAct.setWhatsThis(
813 self.tr("""<b>Line</b>""" """<p>Draw a line.</p>""") 813 self.tr("""<b>Line</b><p>Draw a line.</p>""")
814 ) 814 )
815 self.drawLineAct.setCheckable(True) 815 self.drawLineAct.setCheckable(True)
816 self.esm.setMapping(self.drawLineAct, IconEditorTool.LINE) 816 self.esm.setMapping(self.drawLineAct, IconEditorTool.LINE)
817 self.drawLineAct.triggered.connect(self.esm.map) 817 self.drawLineAct.triggered.connect(self.esm.map)
818 self.__actions.append(self.drawLineAct) 818 self.__actions.append(self.drawLineAct)

eric ide

mercurial