mirror of https://gitlab.com/pamhyr/pamhyr2
stab window InitialCond AdisTS (undo / redo / add / delete / save / load), all should work correctly
parent
b1daadf9f2
commit
b450796df5
|
|
@ -245,8 +245,10 @@ class InitialConditionTableModel(PamhyrTableModel):
|
|||
|
||||
def undo(self):
|
||||
self._undo.undo()
|
||||
self._setup_lst()
|
||||
self.layoutChanged.emit()
|
||||
|
||||
def redo(self):
|
||||
self._undo.redo()
|
||||
self._setup_lst()
|
||||
self.layoutChanged.emit()
|
||||
|
|
|
|||
|
|
@ -273,11 +273,27 @@ class InitialConditionsAdisTSWindow(PamhyrWindow):
|
|||
self._update()
|
||||
|
||||
def _undo(self):
|
||||
self._table.undo()
|
||||
undo_stack = self._undo_stack
|
||||
if undo_stack is None or not undo_stack.canUndo():
|
||||
return
|
||||
|
||||
if isinstance(undo_stack.command(undo_stack.index() - 1), SetCommand):
|
||||
self._table.undo()
|
||||
else:
|
||||
self._table_spec.undo()
|
||||
|
||||
self._update()
|
||||
|
||||
def _redo(self):
|
||||
self._table.redo()
|
||||
undo_stack = self._undo_stack
|
||||
if undo_stack is None or not undo_stack.canRedo():
|
||||
return
|
||||
|
||||
if isinstance(undo_stack.command(undo_stack.index()), SetCommand):
|
||||
self._table.redo()
|
||||
else:
|
||||
self._table_spec.redo()
|
||||
|
||||
self._update()
|
||||
|
||||
def add(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue