From 718f9811b71f3fc7d131b9fd27f39b0f2082623f Mon Sep 17 00:00:00 2001 From: Willem Ferguson Date: Sun, 8 Apr 2018 08:07:57 +0200 Subject: 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 --- profile-widget/profilewidget2.cpp | 14 ++++++++------ 1 file 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())); -- cgit v1.2.3-70-g09d2