mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
512c42e38a
commit
66cbdea8a1
1 changed files with 1 additions and 0 deletions
|
@ -119,6 +119,7 @@ void GlobeGPS::contextMenuEvent(QContextMenuEvent *ev)
|
||||||
QMenu m;
|
QMenu m;
|
||||||
QAction *a = m.addAction(tr("Edit selected dive locations"), this, SLOT(prepareForGetDiveCoordinates()));
|
QAction *a = m.addAction(tr("Edit selected dive locations"), this, SLOT(prepareForGetDiveCoordinates()));
|
||||||
a->setData(QVariant::fromValue<void *>(&m));
|
a->setData(QVariant::fromValue<void *>(&m));
|
||||||
|
a->setEnabled(current_dive);
|
||||||
m.exec(ev->globalPos());
|
m.exec(ev->globalPos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue