From 8669de63e137aa873a8cf843ad79fffaee0afa40 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 14 Jun 2013 07:13:06 -0700 Subject: 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 --- qt-ui/divelistview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 980939355..12243f468 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -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()); -- cgit v1.2.3-70-g09d2