From bbfa2b655bac88306f8e7805f2eb61b2f801ad0a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 23 Apr 2015 13:56:24 -0700 Subject: 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 --- qt-ui/profile/profilewidget2.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 8e3641b66..2d1b7276f 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -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(sceneItem)) { action = new QAction(&m); action->setText(tr("Remove event")); -- cgit v1.2.3-70-g09d2