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. |