mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: implement invalidate-dive command
Connect command to context menu. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
329641fdcd
commit
4e47cdfa2c
8 changed files with 43 additions and 21 deletions
|
@ -838,22 +838,7 @@ void DiveListView::addToTrip(int delta)
|
|||
|
||||
void DiveListView::markDiveInvalid()
|
||||
{
|
||||
int i;
|
||||
struct dive *d = contextMenuIndex.data(DiveTripModelBase::DIVE_ROLE).value<struct dive *>();
|
||||
if (!d)
|
||||
return;
|
||||
for_each_dive (i, d) {
|
||||
if (!d->selected)
|
||||
continue;
|
||||
//TODO: this should be done in the future
|
||||
// now mark the dive invalid... how do we do THAT?
|
||||
// d->invalid = true;
|
||||
}
|
||||
mark_divelist_changed(true);
|
||||
MainWindow::instance()->refreshDisplay();
|
||||
if (prefs.display_invalid_dives == false) {
|
||||
clearSelection();
|
||||
}
|
||||
Command::editInvalid(true, false);
|
||||
}
|
||||
|
||||
void DiveListView::deleteDive()
|
||||
|
@ -935,9 +920,7 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
|
|||
}
|
||||
if (d) {
|
||||
popup.addAction(tr("Delete dive(s)"), this, &DiveListView::deleteDive);
|
||||
#if 0
|
||||
popup.addAction(tr("Mark dive(s) invalid", this, &DiveListView::markDiveInvalid);
|
||||
#endif
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue