summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-12-12 23:07:17 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-20 15:20:44 -0700
commit4e47cdfa2c611e0e02f46b84d76d29f1fab74e20 (patch)
treeec7de6591f918f7fb6b73f2b89f41d4b9ee1a1d1 /desktop-widgets
parent329641fdcdf7759d430aea2d2a115550bc5caf62 (diff)
downloadsubsurface-4e47cdfa2c611e0e02f46b84d76d29f1fab74e20.tar.gz
Undo: implement invalidate-dive command
Connect command to context menu. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/divelistview.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp
index 1f3a20455..7050863bf 100644
--- a/desktop-widgets/divelistview.cpp
+++ b/desktop-widgets/divelistview.cpp
@@ -838,22 +838,7 @@ void DiveListView::addToTrip(int delta)
void DiveListView::markDiveInvalid()
{
- int i;
- struct dive *d = contextMenuIndex.data(DiveTripModelBase::DIVE_ROLE).value<struct dive *>();
- if (!d)
- return;
- for_each_dive (i, d) {
- if (!d->selected)
- continue;
- //TODO: this should be done in the future
- // now mark the dive invalid... how do we do THAT?
- // d->invalid = true;
- }
- mark_divelist_changed(true);
- MainWindow::instance()->refreshDisplay();
- if (prefs.display_invalid_dives == false) {
- clearSelection();
- }
+ Command::editInvalid(true, false);
}
void DiveListView::deleteDive()
@@ -935,9 +920,7 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
}
if (d) {
popup.addAction(tr("Delete dive(s)"), this, &DiveListView::deleteDive);
-#if 0
- popup.addAction(tr("Mark dive(s) invalid", this, &DiveListView::markDiveInvalid);
-#endif
+ popup.addAction(tr("Mark dive(s) invalid"), this, &DiveListView::markDiveInvalid);
}
if (amount_selected > 1 && consecutive_selected())
popup.addAction(tr("Merge selected dives"), this, &DiveListView::mergeDives);