Simulation settings window

This commit is contained in:
Joppe Blondel
2026-07-30 21:27:15 +02:00
parent a03c6d624e
commit b3aabae5e8
9 changed files with 372 additions and 20 deletions
@@ -0,0 +1,21 @@
from __future__ import annotations
from copy import deepcopy
from PySide6.QtGui import QUndoCommand
from bedit_gui.models import SimulationDatabase
class ChangeSimulationDatabaseCommand(QUndoCommand):
def __init__(self, document: object, database: SimulationDatabase) -> None:
super().__init__("Edit simulation settings")
self.document = document
self.old_database = document.stored_simulation_database()
self.new_database = deepcopy(database)
def redo(self) -> None:
self.document._set_simulation_database(self.new_database)
def undo(self) -> None:
self.document._set_simulation_database(self.old_database)