Plugins/ViewManagerPlugins/Tabview/Tabview.py

changeset 12
1d8dd9706f46
parent 8
0ae9bd4d2993
child 13
1af94a91f439
equal deleted inserted replaced
11:b0996e4a289e 12:1d8dd9706f46
109 Protected method to handle drop events. 109 Protected method to handle drop events.
110 110
111 @param event reference to the drop event (QDropEvent) 111 @param event reference to the drop event (QDropEvent)
112 """ 112 """
113 mimeData = event.mimeData() 113 mimeData = event.mimeData()
114 oldID = mimeData.data("tabbar-id") 114 oldID = mimeData.data("tabbar-id").toLong()[0]
115 fromIndex = mimeData.data("source-index") 115 fromIndex = mimeData.data("source-index").toInt()[0]
116 toIndex = self.tabAt(event.pos()) 116 toIndex = self.tabAt(event.pos())
117 if oldID != id(self): 117 if oldID != id(self):
118 parentID = mimeData.data("tabwidget-id") 118 parentID = mimeData.data("tabwidget-id").toLong()[0]
119 if event.proposedAction() == Qt.MoveAction: 119 if event.proposedAction() == Qt.MoveAction:
120 self.emit(SIGNAL("tabRelocateRequested(long, int, int)"), 120 self.emit(SIGNAL("tabRelocateRequested(long, int, int)"),
121 parentID, fromIndex, toIndex) 121 parentID, fromIndex, toIndex)
122 event.acceptProposedAction() 122 event.acceptProposedAction()
123 elif event.proposedAction() == Qt.CopyAction: 123 elif event.proposedAction() == Qt.CopyAction:
511 def __contextMenuCloseOthers(self): 511 def __contextMenuCloseOthers(self):
512 """ 512 """
513 Private method to close the other tabs. 513 Private method to close the other tabs.
514 """ 514 """
515 index = self.contextMenuIndex 515 index = self.contextMenuIndex
516 for i in range(self.count() - 1, index, -1) + range(index - 1, -1, -1): 516 for i in list(range(self.count() - 1, index, -1)) + list(range(index - 1, -1, -1)):
517 editor = self.widget(i) 517 editor = self.widget(i)
518 self.vm.closeEditorWindow(editor) 518 self.vm.closeEditorWindow(editor)
519 519
520 def __contextMenuCloseAll(self): 520 def __contextMenuCloseAll(self):
521 """ 521 """
697 win.closeIt() 697 win.closeIt()
698 self.__inRemoveView = False 698 self.__inRemoveView = False
699 699
700 # if this was the last editor in this view, switch to the next, that 700 # if this was the last editor in this view, switch to the next, that
701 # still has open editors 701 # still has open editors
702 for i in range(self.tabWidgets.index(tw), -1, -1) + \ 702 for i in list(range(self.tabWidgets.index(tw), -1, -1)) + \
703 range(self.tabWidgets.index(tw) + 1, len(self.tabWidgets)): 703 list(range(self.tabWidgets.index(tw) + 1, len(self.tabWidgets))):
704 if self.tabWidgets[i].hasEditors(): 704 if self.tabWidgets[i].hasEditors():
705 self.currentTabWidget.showIndicator(False) 705 self.currentTabWidget.showIndicator(False)
706 self.currentTabWidget = self.tabWidgets[i] 706 self.currentTabWidget = self.tabWidgets[i]
707 self.currentTabWidget.showIndicator(True) 707 self.currentTabWidget.showIndicator(True)
708 self.activeWindow().setFocus() 708 self.activeWindow().setFocus()

eric ide

mercurial