Only offer to merge dives if they are consecutive in the divelist

You cannot merge dives if there is another, unselected dive "between"
them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-09-24 03:42:40 -07:00
parent 2d40172d78
commit 446ab45858
3 changed files with 26 additions and 1 deletions

View file

@ -400,7 +400,7 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
}
if (d)
popup.addAction(tr("delete dive"), this, SLOT(deleteDive()));
if (amount_selected > 1)
if (amount_selected > 1 && consecutive_selected())
popup.addAction(tr("merge selected dives"), this, SLOT(mergeDives()));
// "collapse all" really closes all trips,
// "collapse" keeps the trip with the selected dive open