Don't offer "delete dive" context menu for trip

If we are not on a dive we shouldn't try to delete it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-06-14 07:13:06 -07:00
parent d8c5f366c8
commit 8669de63e1

View file

@ -340,7 +340,8 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
popup.addAction(tr("remove dive from trip"), this, SLOT(removeFromTrip()));
}
}
popup.addAction(tr("delete dive"), this, SLOT(deleteDive()));
if (d)
popup.addAction(tr("delete dive"), this, SLOT(deleteDive()));
// "collapse all" really closes all trips,
// "collapse" keeps the trip with the selected dive open
QAction * actionTaken = popup.exec(event->globalPos());