mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
639e079131
commit
f2a2ded04e
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue