From f2a2ded04e89376874b9ec11a7e7a2a9ba8097ff Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 19 Nov 2014 22:44:33 +0000 Subject: Profile: don't offer to switch to an already active tank Adding a gas change to tank that we are already breathing from makes no sense, so let's not offer this. 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 8d4d24ef2..c4ef97ddc 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1110,6 +1110,8 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event) } } // create the profile context menu + QPointF scenePos = mapToScene(event->pos()); + struct plot_data *entry = getEntryFromPos(scenePos); GasSelectionModel *model = GasSelectionModel::instance(); model->repopulate(); int rowCount = model->rowCount(); @@ -1121,6 +1123,8 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event) action->setText(model->data(model->index(i, 0), Qt::DisplayRole).toString() + QString(tr(" (Tank %1)")).arg(i + 1)); connect(action, SIGNAL(triggered(bool)), this, SLOT(changeGas())); action->setData(event->globalPos()); + if (i == entry->cylinderindex) + action->setDisabled(true); gasChange->addAction(action); } } -- cgit v1.2.3-70-g09d2