Graphics/UMLGraphicsView.py

changeset 453
a81097a85889
parent 96
9624a110667d
child 454
d28d558f7484
child 455
9a7e0b7b801e
equal deleted inserted replaced
452:0bc58cbb64b2 453:a81097a85889
55 Private method to initialize the view actions. 55 Private method to initialize the view actions.
56 """ 56 """
57 self.deleteShapeAct = \ 57 self.deleteShapeAct = \
58 QAction(UI.PixmapCache.getIcon("deleteShape.png"), 58 QAction(UI.PixmapCache.getIcon("deleteShape.png"),
59 self.trUtf8("Delete shapes"), self) 59 self.trUtf8("Delete shapes"), self)
60 self.connect(self.deleteShapeAct, SIGNAL("triggered()"), self.__deleteShape) 60 self.deleteShapeAct.triggered.connect(self.__deleteShape)
61 61
62 self.saveAct = \ 62 self.saveAct = \
63 QAction(UI.PixmapCache.getIcon("fileSave.png"), 63 QAction(UI.PixmapCache.getIcon("fileSave.png"),
64 self.trUtf8("Save as PNG"), self) 64 self.trUtf8("Save as PNG"), self)
65 self.connect(self.saveAct, SIGNAL("triggered()"), self.__saveImage) 65 self.saveAct.triggered.connect(self.__saveImage)
66 66
67 self.printAct = \ 67 self.printAct = \
68 QAction(UI.PixmapCache.getIcon("print.png"), 68 QAction(UI.PixmapCache.getIcon("print.png"),
69 self.trUtf8("Print"), self) 69 self.trUtf8("Print"), self)
70 self.connect(self.printAct, SIGNAL("triggered()"), self.__printDiagram) 70 self.printAct.triggered.connect(self.__printDiagram)
71 71
72 self.printPreviewAct = \ 72 self.printPreviewAct = \
73 QAction(UI.PixmapCache.getIcon("printPreview.png"), 73 QAction(UI.PixmapCache.getIcon("printPreview.png"),
74 self.trUtf8("Print Preview"), self) 74 self.trUtf8("Print Preview"), self)
75 self.connect(self.printPreviewAct, SIGNAL("triggered()"), 75 self.printPreviewAct.triggered.connect(self.__printPreviewDiagram)
76 self.__printPreviewDiagram)
77 76
78 self.zoomInAct = \ 77 self.zoomInAct = \
79 QAction(UI.PixmapCache.getIcon("zoomIn.png"), 78 QAction(UI.PixmapCache.getIcon("zoomIn.png"),
80 self.trUtf8("Zoom in"), self) 79 self.trUtf8("Zoom in"), self)
81 self.connect(self.zoomInAct, SIGNAL("triggered()"), self.zoomIn) 80 self.zoomInAct.triggered.connect(self.zoomIn)
82 81
83 self.zoomOutAct = \ 82 self.zoomOutAct = \
84 QAction(UI.PixmapCache.getIcon("zoomOut.png"), 83 QAction(UI.PixmapCache.getIcon("zoomOut.png"),
85 self.trUtf8("Zoom out"), self) 84 self.trUtf8("Zoom out"), self)
86 self.connect(self.zoomOutAct, SIGNAL("triggered()"), self.zoomOut) 85 self.zoomOutAct.triggered.connect(self.zoomOut)
87 86
88 self.zoomAct = \ 87 self.zoomAct = \
89 QAction(UI.PixmapCache.getIcon("zoomTo.png"), 88 QAction(UI.PixmapCache.getIcon("zoomTo.png"),
90 self.trUtf8("Zoom..."), self) 89 self.trUtf8("Zoom..."), self)
91 self.connect(self.zoomAct, SIGNAL("triggered()"), self.__zoom) 90 self.zoomAct.triggered.connect(self.__zoom)
92 91
93 self.zoomResetAct = \ 92 self.zoomResetAct = \
94 QAction(UI.PixmapCache.getIcon("zoomReset.png"), 93 QAction(UI.PixmapCache.getIcon("zoomReset.png"),
95 self.trUtf8("Zoom reset"), self) 94 self.trUtf8("Zoom reset"), self)
96 self.connect(self.zoomResetAct, SIGNAL("triggered()"), self.zoomReset) 95 self.zoomResetAct.triggered.connect(self.zoomReset)
97 96
98 self.incWidthAct = \ 97 self.incWidthAct = \
99 QAction(UI.PixmapCache.getIcon("sceneWidthInc.png"), 98 QAction(UI.PixmapCache.getIcon("sceneWidthInc.png"),
100 self.trUtf8("Increase width by {0} points").format(self.deltaSize), 99 self.trUtf8("Increase width by {0} points").format(self.deltaSize),
101 self) 100 self)
102 self.connect(self.incWidthAct, SIGNAL("triggered()"), self.__incWidth) 101 self.incWidthAct.triggered.connect(self.__incWidth)
103 102
104 self.incHeightAct = \ 103 self.incHeightAct = \
105 QAction(UI.PixmapCache.getIcon("sceneHeightInc.png"), 104 QAction(UI.PixmapCache.getIcon("sceneHeightInc.png"),
106 self.trUtf8("Increase height by {0} points").format(self.deltaSize), 105 self.trUtf8("Increase height by {0} points").format(self.deltaSize),
107 self) 106 self)
108 self.connect(self.incHeightAct, SIGNAL("triggered()"), self.__incHeight) 107 self.incHeightAct.triggered.connect(self.__incHeight)
109 108
110 self.decWidthAct = \ 109 self.decWidthAct = \
111 QAction(UI.PixmapCache.getIcon("sceneWidthDec.png"), 110 QAction(UI.PixmapCache.getIcon("sceneWidthDec.png"),
112 self.trUtf8("Decrease width by {0} points").format(self.deltaSize), 111 self.trUtf8("Decrease width by {0} points").format(self.deltaSize),
113 self) 112 self)
114 self.connect(self.decWidthAct, SIGNAL("triggered()"), self.__decWidth) 113 self.decWidthAct.triggered.connect(self.__decWidth)
115 114
116 self.decHeightAct = \ 115 self.decHeightAct = \
117 QAction(UI.PixmapCache.getIcon("sceneHeightDec.png"), 116 QAction(UI.PixmapCache.getIcon("sceneHeightDec.png"),
118 self.trUtf8("Decrease height by {0} points").format(self.deltaSize), 117 self.trUtf8("Decrease height by {0} points").format(self.deltaSize),
119 self) 118 self)
120 self.connect(self.decHeightAct, SIGNAL("triggered()"), self.__decHeight) 119 self.decHeightAct.triggered.connect(self.__decHeight)
121 120
122 self.setSizeAct = \ 121 self.setSizeAct = \
123 QAction(UI.PixmapCache.getIcon("sceneSize.png"), 122 QAction(UI.PixmapCache.getIcon("sceneSize.png"),
124 self.trUtf8("Set size"), self) 123 self.trUtf8("Set size"), self)
125 self.connect(self.setSizeAct, SIGNAL("triggered()"), self.__setSize) 124 self.setSizeAct.triggered.connect(self.__setSize)
126 125
127 self.relayoutAct = \ 126 self.relayoutAct = \
128 QAction(UI.PixmapCache.getIcon("reload.png"), 127 QAction(UI.PixmapCache.getIcon("reload.png"),
129 self.trUtf8("Re-Layout"), self) 128 self.trUtf8("Re-Layout"), self)
130 self.connect(self.relayoutAct, SIGNAL("triggered()"), self.__relayout) 129 self.relayoutAct.triggered.connect(self.__relayout)
131 130
132 self.alignLeftAct = \ 131 self.alignLeftAct = \
133 QAction(UI.PixmapCache.getIcon("shapesAlignLeft"), 132 QAction(UI.PixmapCache.getIcon("shapesAlignLeft"),
134 self.trUtf8("Align Left"), self) 133 self.trUtf8("Align Left"), self)
135 self.connect(self.alignLeftAct, SIGNAL("triggered()"), 134 self.connect(self.alignLeftAct, SIGNAL("triggered()"),

eric ide

mercurial