mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Scenario: Add some save dialog.
This commit is contained in:
1 parent
5d8ec51417
commit
190ca5d171
1 file changed
+15
-1
@@ -470,9 +470,16 @@ class GraphWidget(QGraphicsView):
|
|||||||
self.changeScenario.emit(self.sender())
|
self.changeScenario.emit(self.sender())
|
||||||
|
|
||||||
def new_scenario(self, pos):
|
def new_scenario(self, pos):
|
||||||
|
must_save = self.dialog_save()
|
||||||
|
if must_save == "Cancel":
|
||||||
|
return
|
||||||
|
|
||||||
def fn():
|
def fn():
|
||||||
self._close_other_window()
|
self._close_other_window()
|
||||||
|
|
||||||
|
if must_save == "Save":
|
||||||
self._study.save()
|
self._study.save()
|
||||||
|
|
||||||
self._undo.push(
|
self._undo.push(
|
||||||
AddScenariosCommand(
|
AddScenariosCommand(
|
||||||
self._study,
|
self._study,
|
||||||
@@ -500,9 +507,16 @@ class GraphWidget(QGraphicsView):
|
|||||||
self.changeScenario.emit(self.sender())
|
self.changeScenario.emit(self.sender())
|
||||||
|
|
||||||
def duplicate_scenario(self, item):
|
def duplicate_scenario(self, item):
|
||||||
|
must_save = self.dialog_save()
|
||||||
|
if must_save == "Cancel":
|
||||||
|
return
|
||||||
|
|
||||||
def fn():
|
def fn():
|
||||||
self._close_other_window()
|
self._close_other_window()
|
||||||
# self._study.save()
|
|
||||||
|
if must_save == "Save":
|
||||||
|
self._study.save()
|
||||||
|
|
||||||
self._undo.push(
|
self._undo.push(
|
||||||
DuplicateScenariosCommand(
|
DuplicateScenariosCommand(
|
||||||
self._study,
|
self._study,
|
||||||
|
|||||||
Reference in new issue
Block a user