diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-03-20 21:46:58 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 6f574c53a38ad848bfd364acb0ae16680c3f6c8a (patch) | |
tree | f62f5d8c24dc7787d60d161e63640393add7bad8 /desktop-widgets/mainwindow.cpp | |
parent | 4cb1ceefff96121331f63e1455d233b32b3d7680 (diff) | |
download | subsurface-6f574c53a38ad848bfd364acb0ae16680c3f6c8a.tar.gz |
Undo: implement undo of dive site editing
This one is a bit more tricky. There are two modes: set dive site
and set newly created dive site. This is realized using an OO model
with derived classed. Quite convoluted - but it seems to work.
Moreover, editing a dive site is not simply setting a value,
but the list of dives in a dive site has to be kept up to date.
Finally, we have to inform the dive site list of the changed
number of dives. Therefore add a new signal diveSiteDivesChanged.
To send only one signal per dive site, hook into the undo() and
redo() functions and call the functions of the base class there.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 0b3f9fc4a..a181a8ceb 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -213,7 +213,6 @@ MainWindow::MainWindow() : QMainWindow(), } ui.menuFile->insertSeparator(ui.actionQuit); connect(mainTab, SIGNAL(addDiveFinished()), graphics, SLOT(setProfileState())); - connect(mainTab, SIGNAL(dateTimeChanged()), graphics, SLOT(dateTimeChanged())); connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated())); connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled())); connect(DivePlannerPointsModel::instance(), SIGNAL(variationsComputed(QString)), this, SLOT(updateVariations(QString))); @@ -387,7 +386,8 @@ void MainWindow::editDiveSite(dive_site *ds) void MainWindow::startDiveSiteEdit() { - editDiveSite(get_dive_site_for_dive(&displayed_dive)); + if (current_dive) + editDiveSite(get_dive_site_for_dive(current_dive)); } void MainWindow::enableDisableCloudActions() |