aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-23 13:56:24 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-23 13:56:24 -0700
commitbbfa2b655bac88306f8e7805f2eb61b2f801ad0a (patch)
tree53d02d4b7bf5a4aaaf0b2434938811b8016a8029
parent59f283a4fc1d6ce63ddaea5feb17fdfd26a82951 (diff)
downloadsubsurface-bbfa2b655bac88306f8e7805f2eb61b2f801ad0a.tar.gz
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>
-rw-r--r--qt-ui/profile/profilewidget2.cpp4
1 files changed, 4 insertions, 0 deletions
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<DiveEventItem *>(sceneItem)) {
action = new QAction(&m);
action->setText(tr("Remove event"));