Profile context menu: trigger editing of manually added dive

Right now the way to edit the profile of a manually added dive is really
counterintuitive: you have to first make some random change to the dive
information, then the profile switches in to editing mode.

This commit adds a simple context menu entry on the profile that is only
shown when the a manually added dive is displayed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-04-23 13:56:24 -07:00
parent 59f283a4fc
commit bbfa2b655b

View file

@ -1222,6 +1222,10 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
setpointAction->setData(event->globalPos());
QAction *action = m.addAction(tr("Add bookmark"), this, SLOT(addBookmark()));
action->setData(event->globalPos());
if (same_string(current_dc->model, "manually added dive"))
QAction *editProfileAction = m.addAction(tr("Edit the profile"), MainWindow::instance(), SLOT(editCurrentDive()));
if (DiveEventItem *item = dynamic_cast<DiveEventItem *>(sceneItem)) {
action = new QAction(&m);
action->setText(tr("Remove event"));