def restoreNextSelect(self): """Go forward to the most recent saved selection""" self.validateHistory() if self.nextSelects: for item in self.nextSelects[-1]: item.openParents(False) globalref.updateViewItem(item) self.prevSelects.append(list(self)) self[:] = self.nextSelects.pop(-1) globalref.updateViewSelection() else: globalref.updateViewMenuStat()
def changeSearchOpen(self, selectList): """Replace selection with items in list, if open search enabled, close previously selected search items, open new selected search items""" if self == selectList: return openSearch = globalref.options.boolData('OpenSearchNodes') if openSearch: for item in self.searchOpenList: item.open = False globalref.updateViewItem(item) self.searchOpenList = [] for item in selectList: parents = item.openParents(openSearch) parents.reverse() # must start with a visible (loaded) node self.searchOpenList.extend(parents) for item in self.searchOpenList: globalref.updateViewItem(item) self.addToHistory() self[:] = selectList globalref.updateViewSelection()
def change(self, selectList): """Replace selection with items in list and update view""" self.addToHistory() self[:] = selectList globalref.updateViewSelection()