def add_take(self, take_name): """adds a new take to the takes list """ # condition the input from stalker import Version take_name = Version._format_take_name(take_name) # if the given take name is in the list don't add it if take_name not in self._take_names: # add the item via property new_take_list = self._take_names new_take_list.append(take_name) new_take_list.sort() self.take_names = new_take_list # select the newly added take name index = self.findText(take_name, QtCore.Qt.MatchExactly) if index: self.setCurrentIndex(index)
def add_take(self, take_name): """adds a new take to the takes list """ # condition the input take_name = Version._format_take_name(take_name) # if the given take name is in the list don't add it if take_name not in self._take_names: # add the item via property new_take_list = self._take_names new_take_list.append(take_name) new_take_list.sort() self.take_names = new_take_list # select the newly added take name items = self.findItems(take_name, QtCore.Qt.MatchExactly) if items: item = items[0] # set the take to the new one self.setCurrentItem(item)