summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-20 15:59:38 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-21 14:31:37 -0700
commit30e6102886a5a8d2fc38d2a1b0d425cdcea0fbe0 (patch)
tree9a4260262693dc39a63b211de1beecd70ae99e3c /mobile-widgets/qmlmanager.cpp
parentc77cc93eecb4ed4663110e97817fe7524046e8aa (diff)
downloadsubsurface-30e6102886a5a8d2fc38d2a1b0d425cdcea0fbe0.tar.gz
mobile/divelist: add UI to toggle dive invalid flag
This reuses the corresponding undo command. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 4b3286911..06bc5d8ef 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1404,6 +1404,16 @@ void QMLManager::deleteDive(int id)
changesNeedSaving();
}
+void QMLManager::toggleDiveInvalid(int id)
+{
+ struct dive *d = get_dive_by_uniq_id(id);
+ if (!d) {
+ appendTextToLog("trying to toggle invalid flag of non-existing dive");
+ return;
+ }
+ Command::editInvalid(!d->invalid, true);
+}
+
bool QMLManager::toggleDiveSite(bool toggle)
{
if (toggle)