Graphics/UMLDialog.py

changeset 3345
071afe8be2a1
parent 3190
a9a94491c4fd
child 3484
645c12de6b0c
equal deleted inserted replaced
3343:f7a6d271bb40 3345:071afe8be2a1
5 5
6 """ 6 """
7 Module implementing a dialog showing UML like diagrams. 7 Module implementing a dialog showing UML like diagrams.
8 """ 8 """
9 9
10 from PyQt4.QtCore import Qt, QFileInfo 10 from PyQt4.QtCore import pyqtSlot, Qt, QFileInfo
11 from PyQt4.QtGui import QAction, QToolBar, QGraphicsScene 11 from PyQt4.QtGui import QAction, QToolBar, QGraphicsScene
12 12
13 from E5Gui import E5MessageBox, E5FileDialog 13 from E5Gui import E5MessageBox, E5FileDialog
14 from E5Gui.E5MainWindow import E5MainWindow 14 from E5Gui.E5MainWindow import E5MainWindow
15 15
73 Private slot to initialize the actions. 73 Private slot to initialize the actions.
74 """ 74 """
75 self.closeAct = \ 75 self.closeAct = \
76 QAction(UI.PixmapCache.getIcon("close.png"), 76 QAction(UI.PixmapCache.getIcon("close.png"),
77 self.tr("Close"), self) 77 self.tr("Close"), self)
78 self.closeAct.triggered[()].connect(self.close) 78 self.closeAct.triggered.connect(self.close)
79 79
80 self.openAct = \ 80 self.openAct = \
81 QAction(UI.PixmapCache.getIcon("open.png"), 81 QAction(UI.PixmapCache.getIcon("open.png"),
82 self.tr("Load"), self) 82 self.tr("Load"), self)
83 self.openAct.triggered[()].connect(self.load) 83 self.openAct.triggered.connect(self.load)
84 84
85 self.saveAct = \ 85 self.saveAct = \
86 QAction(UI.PixmapCache.getIcon("fileSave.png"), 86 QAction(UI.PixmapCache.getIcon("fileSave.png"),
87 self.tr("Save"), self) 87 self.tr("Save"), self)
88 self.saveAct.triggered[()].connect(self.__save) 88 self.saveAct.triggered.connect(self.__save)
89 89
90 self.saveAsAct = \ 90 self.saveAsAct = \
91 QAction(UI.PixmapCache.getIcon("fileSaveAs.png"), 91 QAction(UI.PixmapCache.getIcon("fileSaveAs.png"),
92 self.tr("Save As..."), self) 92 self.tr("Save As..."), self)
93 self.saveAsAct.triggered[()].connect(self.__saveAs) 93 self.saveAsAct.triggered.connect(self.__saveAs)
94 94
95 self.saveImageAct = \ 95 self.saveImageAct = \
96 QAction(UI.PixmapCache.getIcon("fileSavePixmap.png"), 96 QAction(UI.PixmapCache.getIcon("fileSavePixmap.png"),
97 self.tr("Save as Image"), self) 97 self.tr("Save as Image"), self)
98 self.saveImageAct.triggered[()].connect(self.umlView.saveImage) 98 self.saveImageAct.triggered.connect(self.umlView.saveImage)
99 99
100 self.printAct = \ 100 self.printAct = \
101 QAction(UI.PixmapCache.getIcon("print.png"), 101 QAction(UI.PixmapCache.getIcon("print.png"),
102 self.tr("Print"), self) 102 self.tr("Print"), self)
103 self.printAct.triggered[()].connect(self.umlView.printDiagram) 103 self.printAct.triggered.connect(self.umlView.printDiagram)
104 104
105 self.printPreviewAct = \ 105 self.printPreviewAct = \
106 QAction(UI.PixmapCache.getIcon("printPreview.png"), 106 QAction(UI.PixmapCache.getIcon("printPreview.png"),
107 self.tr("Print Preview"), self) 107 self.tr("Print Preview"), self)
108 self.printPreviewAct.triggered[()].connect( 108 self.printPreviewAct.triggered.connect(
109 self.umlView.printPreviewDiagram) 109 self.umlView.printPreviewDiagram)
110 110
111 def __initToolBars(self): 111 def __initToolBars(self):
112 """ 112 """
113 Private slot to initialize the toolbars. 113 Private slot to initialize the toolbars.
206 """ 206 """
207 Private slot to save the diagram with the current name. 207 Private slot to save the diagram with the current name.
208 """ 208 """
209 self.__saveAs(self.__fileName) 209 self.__saveAs(self.__fileName)
210 210
211 @pyqtSlot()
211 def __saveAs(self, filename=""): 212 def __saveAs(self, filename=""):
212 """ 213 """
213 Private slot to save the diagram. 214 Private slot to save the diagram.
214 215
215 @param filename name of the file to write to (string) 216 @param filename name of the file to write to (string)

eric ide

mercurial