summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Willem Ferguson <willemferguson@zoology.up.ac.za>2018-04-08 08:07:57 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-05-14 23:47:00 +0300
commit718f9811b71f3fc7d131b9fd27f39b0f2082623f (patch)
treef6c0fa7d769a15cb9c24fb3e36de328bda447e40 /profile-widget
parente46cb2f8007e4767beef8b43a51e2824010875e8 (diff)
downloadsubsurface-718f9811b71f3fc7d131b9fd27f39b0f2082623f.tar.gz
Show divemode swith options only for rebreather dives
The dive profile context menu gets rather long with three additional divome switches that can be selected. This is now changed so that the additional options are only shown when in CCR or in PSCR divemode. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 3b61cee2f..4c141b5bb 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -1413,12 +1413,14 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
setpointAction->setData(event->globalPos());
QAction *action = m.addAction(tr("Add bookmark"), this, SLOT(addBookmark()));
action->setData(event->globalPos());
- QAction *OCAction = m.addAction(tr("Add OC switch"), this, SLOT(addOCSwitch()));
- OCAction->setData(event->globalPos());
- QAction *CCRAction = m.addAction(tr("Add CCR switch"), this, SLOT(addCCRSwitch()));
- CCRAction->setData(event->globalPos());
- QAction *PSCRAction = m.addAction(tr("Add PSCR switch"), this, SLOT(addPSCRSwitch()));
- PSCRAction->setData(event->globalPos());
+ if(current_dc->divemode) {
+ QAction *OCAction = m.addAction(tr("Add OC switch"), this, SLOT(addOCSwitch()));
+ OCAction->setData(event->globalPos());
+ QAction *CCRAction = m.addAction(tr("Add CCR switch"), this, SLOT(addCCRSwitch()));
+ CCRAction->setData(event->globalPos());
+ QAction *PSCRAction = m.addAction(tr("Add PSCR switch"), this, SLOT(addPSCRSwitch()));
+ PSCRAction->setData(event->globalPos());
+ }
if (same_string(current_dc->model, "manually added dive"))
m.addAction(tr("Edit the profile"), this, SIGNAL(editCurrentDive()));