228 def __initMenu(self): |
228 def __initMenu(self): |
229 """ |
229 """ |
230 Private method to initialize the tab context menu. |
230 Private method to initialize the tab context menu. |
231 """ |
231 """ |
232 self.__menu = QMenu(self) |
232 self.__menu = QMenu(self) |
233 self.leftMenuAct = \ |
233 self.leftMenuAct = self.__menu.addAction( |
234 self.__menu.addAction(UI.PixmapCache.getIcon("1leftarrow.png"), |
234 UI.PixmapCache.getIcon("1leftarrow.png"), |
235 self.trUtf8('Move Left'), self.__contextMenuMoveLeft) |
235 self.trUtf8('Move Left'), self.__contextMenuMoveLeft) |
236 self.rightMenuAct = \ |
236 self.rightMenuAct = self.__menu.addAction( |
237 self.__menu.addAction(UI.PixmapCache.getIcon("1rightarrow.png"), |
237 UI.PixmapCache.getIcon("1rightarrow.png"), |
238 self.trUtf8('Move Right'), self.__contextMenuMoveRight) |
238 self.trUtf8('Move Right'), self.__contextMenuMoveRight) |
239 self.firstMenuAct = \ |
239 self.firstMenuAct = self.__menu.addAction( |
240 self.__menu.addAction(UI.PixmapCache.getIcon("2leftarrow.png"), |
240 UI.PixmapCache.getIcon("2leftarrow.png"), |
241 self.trUtf8('Move First'), self.__contextMenuMoveFirst) |
241 self.trUtf8('Move First'), self.__contextMenuMoveFirst) |
242 self.lastMenuAct = \ |
242 self.lastMenuAct = self.__menu.addAction( |
243 self.__menu.addAction(UI.PixmapCache.getIcon("2rightarrow.png"), |
243 UI.PixmapCache.getIcon("2rightarrow.png"), |
244 self.trUtf8('Move Last'), self.__contextMenuMoveLast) |
244 self.trUtf8('Move Last'), self.__contextMenuMoveLast) |
245 self.__menu.addSeparator() |
245 self.__menu.addSeparator() |
246 self.__menu.addAction(UI.PixmapCache.getIcon("tabClose.png"), |
246 self.__menu.addAction( |
|
247 UI.PixmapCache.getIcon("tabClose.png"), |
247 self.trUtf8('Close'), self.__contextMenuClose) |
248 self.trUtf8('Close'), self.__contextMenuClose) |
248 self.closeOthersMenuAct = self.__menu.addAction( |
249 self.closeOthersMenuAct = self.__menu.addAction( |
249 UI.PixmapCache.getIcon("tabCloseOther.png"), |
250 UI.PixmapCache.getIcon("tabCloseOther.png"), |
250 self.trUtf8("Close Others"), self.__contextMenuCloseOthers) |
251 self.trUtf8("Close Others"), self.__contextMenuCloseOthers) |
251 self.__menu.addAction( |
252 self.__menu.addAction( |
252 self.trUtf8('Close All'), self.__contextMenuCloseAll) |
253 self.trUtf8('Close All'), self.__contextMenuCloseAll) |
253 self.__menu.addSeparator() |
254 self.__menu.addSeparator() |
254 self.saveMenuAct = \ |
255 self.saveMenuAct = self.__menu.addAction( |
255 self.__menu.addAction(UI.PixmapCache.getIcon("fileSave.png"), |
256 UI.PixmapCache.getIcon("fileSave.png"), |
256 self.trUtf8('Save'), self.__contextMenuSave) |
257 self.trUtf8('Save'), self.__contextMenuSave) |
257 self.__menu.addAction(UI.PixmapCache.getIcon("fileSaveAs.png"), |
258 self.__menu.addAction( |
|
259 UI.PixmapCache.getIcon("fileSaveAs.png"), |
258 self.trUtf8('Save As...'), self.__contextMenuSaveAs) |
260 self.trUtf8('Save As...'), self.__contextMenuSaveAs) |
259 self.__menu.addAction(UI.PixmapCache.getIcon("fileSaveAll.png"), |
261 self.__menu.addAction( |
|
262 UI.PixmapCache.getIcon("fileSaveAll.png"), |
260 self.trUtf8('Save All'), self.__contextMenuSaveAll) |
263 self.trUtf8('Save All'), self.__contextMenuSaveAll) |
261 self.__menu.addSeparator() |
264 self.__menu.addSeparator() |
262 self.openRejectionsMenuAct = \ |
265 self.openRejectionsMenuAct = self.__menu.addAction( |
263 self.__menu.addAction(self.trUtf8("Open 'rejection' file"), |
266 self.trUtf8("Open 'rejection' file"), |
264 self.__contextMenuOpenRejections) |
267 self.__contextMenuOpenRejections) |
265 self.__menu.addSeparator() |
268 self.__menu.addSeparator() |
266 self.__menu.addAction(UI.PixmapCache.getIcon("print.png"), |
269 self.__menu.addAction( |
|
270 UI.PixmapCache.getIcon("print.png"), |
267 self.trUtf8('Print'), self.__contextMenuPrintFile) |
271 self.trUtf8('Print'), self.__contextMenuPrintFile) |
268 self.__menu.addSeparator() |
272 self.__menu.addSeparator() |
269 self.copyPathAct = self.__menu.addAction( |
273 self.copyPathAct = self.__menu.addAction( |
270 self.trUtf8("Copy Path to Clipboard"), |
274 self.trUtf8("Copy Path to Clipboard"), |
271 self.__contextMenuCopyPathToClipboard) |
275 self.__contextMenuCopyPathToClipboard) |
506 |
510 |
507 @param sourceIndex index of the tab (integer) |
511 @param sourceIndex index of the tab (integer) |
508 @param targetIndex index position to place it to (integer) |
512 @param targetIndex index position to place it to (integer) |
509 """ |
513 """ |
510 editor = self.widget(sourceIndex).getEditor() |
514 editor = self.widget(sourceIndex).getEditor() |
511 newEditor, assembly = self.vm.cloneEditor(editor, editor.getFileType(), |
515 newEditor, assembly = self.vm.cloneEditor( |
512 editor.getFileName()) |
516 editor, editor.getFileType(), editor.getFileName()) |
513 self.vm.insertView(assembly, self, targetIndex, |
517 self.vm.insertView(assembly, self, targetIndex, |
514 editor.getFileName(), editor.getNoName()) |
518 editor.getFileName(), editor.getNoName()) |
515 |
519 |
516 def currentWidget(self): |
520 def currentWidget(self): |
517 """ |
521 """ |