mirror of https://gitlab.com/pamhyr/pamhyr2
Scenario: Add some save dialog.
parent
5d8ec51417
commit
190ca5d171
|
|
@ -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()
|
||||||
self._study.save()
|
|
||||||
|
if must_save == "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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue