Plugins/ViewManagerPlugins/Tabview/Tabview.py

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

eric ide

mercurial