13 |
13 |
14 from PyQt6.QtCore import pyqtSlot, Qt, QCoreApplication |
14 from PyQt6.QtCore import pyqtSlot, Qt, QCoreApplication |
15 from PyQt6.QtGui import QAction |
15 from PyQt6.QtGui import QAction |
16 from PyQt6.QtWidgets import QToolBar, QGraphicsScene |
16 from PyQt6.QtWidgets import QToolBar, QGraphicsScene |
17 |
17 |
18 from EricWidgets import EricMessageBox, EricFileDialog |
18 from eric7.EricWidgets import EricMessageBox, EricFileDialog |
19 from EricWidgets.EricMainWindow import EricMainWindow |
19 from eric7.EricWidgets.EricMainWindow import EricMainWindow |
20 |
20 |
21 import UI.Config |
21 from eric7.EricGui import EricPixmapCache |
22 import UI.PixmapCache |
22 from eric7.UI import Config |
23 |
23 |
24 |
24 |
25 class UMLDialogType(enum.Enum): |
25 class UMLDialogType(enum.Enum): |
26 """ |
26 """ |
27 Class defining the UML dialog types. |
27 Class defining the UML dialog types. |
117 |
117 |
118 def __initActions(self): |
118 def __initActions(self): |
119 """ |
119 """ |
120 Private slot to initialize the actions. |
120 Private slot to initialize the actions. |
121 """ |
121 """ |
122 self.closeAct = QAction(UI.PixmapCache.getIcon("close"), self.tr("Close"), self) |
122 self.closeAct = QAction( |
|
123 EricPixmapCache.getIcon("close"), self.tr("Close"), self |
|
124 ) |
123 self.closeAct.triggered.connect(self.close) |
125 self.closeAct.triggered.connect(self.close) |
124 |
126 |
125 self.openAct = QAction(UI.PixmapCache.getIcon("open"), self.tr("Load"), self) |
127 self.openAct = QAction(EricPixmapCache.getIcon("open"), self.tr("Load"), self) |
126 self.openAct.triggered.connect(self.load) |
128 self.openAct.triggered.connect(self.load) |
127 |
129 |
128 self.saveAct = QAction( |
130 self.saveAct = QAction( |
129 UI.PixmapCache.getIcon("fileSave"), self.tr("Save"), self |
131 EricPixmapCache.getIcon("fileSave"), self.tr("Save"), self |
130 ) |
132 ) |
131 self.saveAct.triggered.connect(self.__save) |
133 self.saveAct.triggered.connect(self.__save) |
132 |
134 |
133 self.saveAsAct = QAction( |
135 self.saveAsAct = QAction( |
134 UI.PixmapCache.getIcon("fileSaveAs"), self.tr("Save As..."), self |
136 EricPixmapCache.getIcon("fileSaveAs"), self.tr("Save As..."), self |
135 ) |
137 ) |
136 self.saveAsAct.triggered.connect(self.__saveAs) |
138 self.saveAsAct.triggered.connect(self.__saveAs) |
137 |
139 |
138 self.saveImageAct = QAction( |
140 self.saveImageAct = QAction( |
139 UI.PixmapCache.getIcon("fileSavePixmap"), self.tr("Save as Image"), self |
141 EricPixmapCache.getIcon("fileSavePixmap"), self.tr("Save as Image"), self |
140 ) |
142 ) |
141 self.saveImageAct.triggered.connect(self.umlView.saveImage) |
143 self.saveImageAct.triggered.connect(self.umlView.saveImage) |
142 |
144 |
143 self.printAct = QAction(UI.PixmapCache.getIcon("print"), self.tr("Print"), self) |
145 self.printAct = QAction( |
|
146 EricPixmapCache.getIcon("print"), self.tr("Print"), self |
|
147 ) |
144 self.printAct.triggered.connect(self.umlView.printDiagram) |
148 self.printAct.triggered.connect(self.umlView.printDiagram) |
145 |
149 |
146 self.printPreviewAct = QAction( |
150 self.printPreviewAct = QAction( |
147 UI.PixmapCache.getIcon("printPreview"), self.tr("Print Preview"), self |
151 EricPixmapCache.getIcon("printPreview"), self.tr("Print Preview"), self |
148 ) |
152 ) |
149 self.printPreviewAct.triggered.connect(self.umlView.printPreviewDiagram) |
153 self.printPreviewAct.triggered.connect(self.umlView.printPreviewDiagram) |
150 |
154 |
151 def __initToolBars(self): |
155 def __initToolBars(self): |
152 """ |
156 """ |
153 Private slot to initialize the toolbars. |
157 Private slot to initialize the toolbars. |
154 """ |
158 """ |
155 self.windowToolBar = QToolBar(self.tr("Window"), self) |
159 self.windowToolBar = QToolBar(self.tr("Window"), self) |
156 self.windowToolBar.setIconSize(UI.Config.ToolBarIconSize) |
160 self.windowToolBar.setIconSize(Config.ToolBarIconSize) |
157 self.windowToolBar.addAction(self.closeAct) |
161 self.windowToolBar.addAction(self.closeAct) |
158 |
162 |
159 self.fileToolBar = QToolBar(self.tr("File"), self) |
163 self.fileToolBar = QToolBar(self.tr("File"), self) |
160 self.fileToolBar.setIconSize(UI.Config.ToolBarIconSize) |
164 self.fileToolBar.setIconSize(Config.ToolBarIconSize) |
161 self.fileToolBar.addAction(self.openAct) |
165 self.fileToolBar.addAction(self.openAct) |
162 self.fileToolBar.addSeparator() |
166 self.fileToolBar.addSeparator() |
163 self.fileToolBar.addAction(self.saveAct) |
167 self.fileToolBar.addAction(self.saveAct) |
164 self.fileToolBar.addAction(self.saveAsAct) |
168 self.fileToolBar.addAction(self.saveAsAct) |
165 self.fileToolBar.addAction(self.saveImageAct) |
169 self.fileToolBar.addAction(self.saveImageAct) |