Scenario: Add some save dialog.

disable_edition_parent_scenario
Pierre-Antoine 2026-05-22 09:22:35 +02:00
parent 5d8ec51417
commit 190ca5d171
1 changed files with 16 additions and 2 deletions

View File

@ -470,9 +470,16 @@ class GraphWidget(QGraphicsView):
self.changeScenario.emit(self.sender())
def new_scenario(self, pos):
must_save = self.dialog_save()
if must_save == "Cancel":
return
def fn():
self._close_other_window()
self._study.save()
if must_save == "Save":
self._study.save()
self._undo.push(
AddScenariosCommand(
self._study,
@ -500,9 +507,16 @@ class GraphWidget(QGraphicsView):
self.changeScenario.emit(self.sender())
def duplicate_scenario(self, item):
must_save = self.dialog_save()
if must_save == "Cancel":
return
def fn():
self._close_other_window()
# self._study.save()
if must_save == "Save":
self._study.save()
self._undo.push(
DuplicateScenariosCommand(
self._study,