diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-12-06 17:40:59 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-06 17:40:59 -0800 |
commit | df464fcef12e04e0d6e6676a55049771cc075b12 (patch) | |
tree | fa8f41de48ca75cf3b22f6e0209ed383b99ae4a1 /qt-ui | |
parent | 93b5c0cd14fe33c80b801a0177e795462484f719 (diff) | |
download | subsurface-df464fcef12e04e0d6e6676a55049771cc075b12.tar.gz |
Stub out a mark dive invalid function
Not sure I'll be able to finish this for 4.0
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divelistview.cpp | 31 | ||||
-rw-r--r-- | qt-ui/divelistview.h | 1 |
2 files changed, 31 insertions, 1 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index dc1420f64..422d1d21c 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -622,6 +622,31 @@ void DiveListView::addToTripAbove() fixMessyQtModelBehaviour(); } +void DiveListView::markDiveInvalid() +{ + int i; + struct dive *d = (struct dive *) contextMenuIndex.data(DiveTripModel::DIVE_ROLE).value<void*>(); + if (!d) + return; + for_each_dive (i, d) { + if (!d->selected) + continue; + // now mark the dive invalid... how do we do THAT? + // d->invalid = true; + } + if (amount_selected == 0) { + mainWindow()->cleanUpEmpty(); + } + mark_divelist_changed(TRUE); + mainWindow()->refreshDisplay(); + if(prefs.display_invalid_dives == FALSE) { + clearSelection(); + // select top dive that isn't marked invalid + rememberSelection(); + } + fixMessyQtModelBehaviour(); +} + void DiveListView::deleteDive() { int i; @@ -690,8 +715,12 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) popup.addAction(tr("merge trip with trip below"), this, SLOT(mergeTripBelow())); } } - if (d) + if (d) { popup.addAction(tr("delete dive(s)"), this, SLOT(deleteDive())); +#if 0 + popup.addAction(tr("mark dive(s) invalid", this, SLOT(markDiveInvalid()))); +#endif + } if (amount_selected > 1 && consecutive_selected()) popup.addAction(tr("merge selected dives"), this, SLOT(mergeDives())); if (amount_selected >= 1) { diff --git a/qt-ui/divelistview.h b/qt-ui/divelistview.h index da7660e88..c20b6e822 100644 --- a/qt-ui/divelistview.h +++ b/qt-ui/divelistview.h @@ -38,6 +38,7 @@ public slots: void showSearchEdit(); void removeFromTrip(); void deleteDive(); + void markDiveInvalid(); void testSlot(); void fixMessyQtModelBehaviour(); void mergeTripAbove(); |