aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-06 17:40:59 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-06 17:40:59 -0800
commitdf464fcef12e04e0d6e6676a55049771cc075b12 (patch)
treefa8f41de48ca75cf3b22f6e0209ed383b99ae4a1 /qt-ui
parent93b5c0cd14fe33c80b801a0177e795462484f719 (diff)
downloadsubsurface-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.cpp31
-rw-r--r--qt-ui/divelistview.h1
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();