mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Dive list: add option to mark dives valid
If the dive the user clicked on is invalid show an option to make the dive valid. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
65acd9976c
commit
ca336d13e5
2 changed files with 10 additions and 1 deletions
|
@ -841,6 +841,11 @@ void DiveListView::markDiveInvalid()
|
|||
Command::editInvalid(true, false);
|
||||
}
|
||||
|
||||
void DiveListView::markDiveValid()
|
||||
{
|
||||
Command::editInvalid(false, false);
|
||||
}
|
||||
|
||||
void DiveListView::deleteDive()
|
||||
{
|
||||
struct dive *d = contextMenuIndex.data(DiveTripModelBase::DIVE_ROLE).value<struct dive *>();
|
||||
|
@ -920,7 +925,10 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
|
|||
}
|
||||
if (d) {
|
||||
popup.addAction(tr("Delete dive(s)"), this, &DiveListView::deleteDive);
|
||||
popup.addAction(tr("Mark dive(s) invalid"), this, &DiveListView::markDiveInvalid);
|
||||
if (d->invalid)
|
||||
popup.addAction(tr("Mark dive(s) valid"), this, &DiveListView::markDiveValid);
|
||||
else
|
||||
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);
|
||||
|
|
|
@ -47,6 +47,7 @@ slots:
|
|||
void removeFromTrip();
|
||||
void deleteDive();
|
||||
void markDiveInvalid();
|
||||
void markDiveValid();
|
||||
void rowsInserted(const QModelIndex &parent, int start, int end) override;
|
||||
void reset() override;
|
||||
void mergeTripAbove();
|
||||
|
|
Loading…
Reference in a new issue