Skip to content

Commit

Permalink
Disable undo-redo (#185 | GRIDEDIT-1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacarniato authored Aug 28, 2024
1 parent 1483354 commit 89bbb48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions meshkernel/meshkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def __init__(self, projection: ProjectionType = ProjectionType.CARTESIAN):

self._float_invalid_value = float(invalid_value)

self._set_undo_size(0)

def __del__(self):
self._deallocate_state()

Expand Down Expand Up @@ -168,6 +170,14 @@ def _allocate_state(self, projection: ProjectionType) -> None:
byref(self._meshkernelid),
)

def _set_undo_size(self, undo_stack_size: int) -> None:
"""Sets the maximum size of the undo stack.
Args:
undo_stack_size (int): The maximum size of the undo stack.
"""
self._execute_function(self.lib.mkernel_set_undo_size, undo_stack_size)

def _deallocate_state(self) -> None:
"""
Deallocate mesh state.
Expand Down

0 comments on commit 89bbb48

Please sign in to comment.