mobile/divelist: add UI to toggle dive invalid flag

This reuses the corresponding undo command.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-03-20 15:59:38 -07:00
parent c77cc93eec
commit 30e6102886
3 changed files with 18 additions and 1 deletions

View file

@ -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)