72 """ |
72 """ |
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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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. |
114 """ |
114 """ |
115 self.windowToolBar = QToolBar(self.trUtf8("Window"), self) |
115 self.windowToolBar = QToolBar(self.tr("Window"), self) |
116 self.windowToolBar.setIconSize(UI.Config.ToolBarIconSize) |
116 self.windowToolBar.setIconSize(UI.Config.ToolBarIconSize) |
117 self.windowToolBar.addAction(self.closeAct) |
117 self.windowToolBar.addAction(self.closeAct) |
118 |
118 |
119 self.fileToolBar = QToolBar(self.trUtf8("File"), self) |
119 self.fileToolBar = QToolBar(self.tr("File"), self) |
120 self.fileToolBar.setIconSize(UI.Config.ToolBarIconSize) |
120 self.fileToolBar.setIconSize(UI.Config.ToolBarIconSize) |
121 self.fileToolBar.addAction(self.openAct) |
121 self.fileToolBar.addAction(self.openAct) |
122 self.fileToolBar.addSeparator() |
122 self.fileToolBar.addSeparator() |
123 self.fileToolBar.addAction(self.saveAct) |
123 self.fileToolBar.addAction(self.saveAct) |
124 self.fileToolBar.addAction(self.saveAsAct) |
124 self.fileToolBar.addAction(self.saveAsAct) |
369 |
369 |
370 @param filename name of the file containing the invalid data (string) |
370 @param filename name of the file containing the invalid data (string) |
371 @param linenum number of the invalid line (integer) |
371 @param linenum number of the invalid line (integer) |
372 """ |
372 """ |
373 if linenum < 0: |
373 if linenum < 0: |
374 msg = self.trUtf8("""<p>The file <b>{0}</b> does not contain""" |
374 msg = self.tr("""<p>The file <b>{0}</b> does not contain""" |
375 """ valid data.</p>""").format(filename) |
375 """ valid data.</p>""").format(filename) |
376 else: |
376 else: |
377 msg = self.trUtf8("""<p>The file <b>{0}</b> does not contain""" |
377 msg = self.tr("""<p>The file <b>{0}</b> does not contain""" |
378 """ valid data.</p><p>Invalid line: {1}</p>""" |
378 """ valid data.</p><p>Invalid line: {1}</p>""" |
379 ).format(filename, linenum + 1) |
379 ).format(filename, linenum + 1) |
380 E5MessageBox.critical(self, self.trUtf8("Load Diagram"), msg) |
380 E5MessageBox.critical(self, self.tr("Load Diagram"), msg) |