def redo(self): if not self._redo_stack: return False self._undo_stack.append(copy_hotbox_data(self._current_state)) self._current_state = copy_hotbox_data(self._redo_stack[-1]) del self._redo_stack[-1] return True
def hotbox(self): if self.groupbutton.checkedId() == 0: return get_new_hotbox(self.hotboxes) elif self.groupbutton.checkedId() == 1: name = self.existing.currentText() hotboxes = self.hotboxes elif self.groupbutton.checkedId() == 2: name = self.template_combo.currentText() hotboxes = load_templates() hotbox = [hb for hb in hotboxes if hb['general']['name'] == name][0] hotbox = copy_hotbox_data(hotbox) name = get_valid_name(hotboxes, hotbox['general']['name']) hotbox['general']['name'] = name return hotbox
def set_data_modified(self, data): self._redo_stack = [] self._undo_stack.append(copy_hotbox_data(self._current_state)) self._current_state = copy_hotbox_data(data) self._modified = True
def data(self): return copy_hotbox_data(self._current_state)