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>
This commit is contained in:
Karina Mochetti 2014-08-16 21:35:32 -03:00 committed by Dirk Hohndel
parent 512c42e38a
commit 66cbdea8a1

View file

@ -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());
}