Plugins/ViewManagerPlugins/Tabview/Tabview.py

changeset 825
9cdec3c5bc07
parent 791
9ec2ac20e54e
child 945
8cd4d08fa9f6
child 1417
d5dac73181be
equal deleted inserted replaced
824:360e007523bd 825:9cdec3c5bc07
239 self.trUtf8('Save'), self.__contextMenuSave) 239 self.trUtf8('Save'), self.__contextMenuSave)
240 self.__menu.addAction(UI.PixmapCache.getIcon("fileSaveAs.png"), 240 self.__menu.addAction(UI.PixmapCache.getIcon("fileSaveAs.png"),
241 self.trUtf8('Save As...'), self.__contextMenuSaveAs) 241 self.trUtf8('Save As...'), self.__contextMenuSaveAs)
242 self.__menu.addAction(UI.PixmapCache.getIcon("fileSaveAll.png"), 242 self.__menu.addAction(UI.PixmapCache.getIcon("fileSaveAll.png"),
243 self.trUtf8('Save All'), self.__contextMenuSaveAll) 243 self.trUtf8('Save All'), self.__contextMenuSaveAll)
244 self.projectMenuAct = \
245 self.__menu.addAction(UI.PixmapCache.getIcon("fileSaveProject.png"),
246 self.trUtf8('Save to Project'), self.__contextMenuSaveToProject)
247 self.__menu.addSeparator() 244 self.__menu.addSeparator()
248 self.__menu.addAction(UI.PixmapCache.getIcon("print.png"), 245 self.__menu.addAction(UI.PixmapCache.getIcon("print.png"),
249 self.trUtf8('Print'), self.__contextMenuPrintFile) 246 self.trUtf8('Print'), self.__contextMenuPrintFile)
250 self.__menu.addSeparator() 247 self.__menu.addSeparator()
251 self.copyPathAct = self.__menu.addAction(self.trUtf8("Copy Path to Clipboard"), 248 self.copyPathAct = self.__menu.addAction(self.trUtf8("Copy Path to Clipboard"),
261 if self.editors: 258 if self.editors:
262 self.contextMenuEditor = self.widget(index) 259 self.contextMenuEditor = self.widget(index)
263 if self.contextMenuEditor: 260 if self.contextMenuEditor:
264 self.saveMenuAct.setEnabled(self.contextMenuEditor.isModified()) 261 self.saveMenuAct.setEnabled(self.contextMenuEditor.isModified())
265 self.copyPathAct.setEnabled(bool(self.contextMenuEditor.getFileName())) 262 self.copyPathAct.setEnabled(bool(self.contextMenuEditor.getFileName()))
266 self.projectMenuAct.setEnabled(e5App().getObject("Project").isOpen())
267 263
268 self.contextMenuIndex = index 264 self.contextMenuIndex = index
269 self.leftMenuAct.setEnabled(index > 0) 265 self.leftMenuAct.setEnabled(index > 0)
270 self.rightMenuAct.setEnabled(index < self.count() - 1) 266 self.rightMenuAct.setEnabled(index < self.count() - 1)
271 self.firstMenuAct.setEnabled(index > 0) 267 self.firstMenuAct.setEnabled(index > 0)
536 def __contextMenuSaveAll(self): 532 def __contextMenuSaveAll(self):
537 """ 533 """
538 Private method to save all tabs. 534 Private method to save all tabs.
539 """ 535 """
540 self.vm.saveEditorsList(self.editors) 536 self.vm.saveEditorsList(self.editors)
541
542 def __contextMenuSaveToProject(self):
543 """
544 Private method to save the selected tab to the current project.
545 """
546 if self.contextMenuEditor:
547 self.vm.saveEditorToProjectEd(self.contextMenuEditor)
548 537
549 def __contextMenuPrintFile(self): 538 def __contextMenuPrintFile(self):
550 """ 539 """
551 Private method to print the selected tab. 540 Private method to print the selected tab.
552 """ 541 """

eric ide

mercurial