aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Karina Mochetti <karina.mochetti@gmail.com>2014-08-16 21:35:32 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-21 14:31:15 -0500
commit66cbdea8a194ce230a7240923609b7a7c9a91469 (patch)
tree82331bd6dfab903aaadd8cc8b70d444a4817fc89
parent512c42e38aec8b424135c967b8f12a92621ba702 (diff)
downloadsubsurface-66cbdea8a194ce230a7240923609b7a7c9a91469.tar.gz
Crash clicking on the globe without a dive
When the user right clicks the globe, we should only present the menu action if there's a current dive, if not, we disable it. Signed-off-by: Karina Mochetti <karina.mochetti@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/globe.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index b9bbf2dde..18bdc92c3 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -119,6 +119,7 @@ void GlobeGPS::contextMenuEvent(QContextMenuEvent *ev)
QMenu m;
QAction *a = m.addAction(tr("Edit selected dive locations"), this, SLOT(prepareForGetDiveCoordinates()));
a->setData(QVariant::fromValue<void *>(&m));
+ a->setEnabled(current_dive);
m.exec(ev->globalPos());
}