mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:43:24 +00:00
Correctly check if tank is in use
We always checked if the tank was in use by the planner / dive editor - even if we were not in dive edit mode. With this patch, when not in dive edit mode, we check our cylinder "used" flag instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4a1b9312f3
commit
36ba353450
1 changed files with 4 additions and 1 deletions
|
@ -336,7 +336,10 @@ void CylindersModel::remove(const QModelIndex &index)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cylinder_t *cyl = ¤t->cylinder[index.row()];
|
cylinder_t *cyl = ¤t->cylinder[index.row()];
|
||||||
if (DivePlannerPointsModel::instance()->tankInUse(cyl->gasmix.o2.permille, cyl->gasmix.he.permille)) {
|
if ((DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING &&
|
||||||
|
DivePlannerPointsModel::instance()->tankInUse(cyl->gasmix.o2.permille, cyl->gasmix.he.permille)) ||
|
||||||
|
(DivePlannerPointsModel::instance()->currentMode() == DivePlannerPointsModel::NOTHING && cyl->used))
|
||||||
|
{
|
||||||
QMessageBox::warning(MainWindow::instance(), TITLE_OR_TEXT(
|
QMessageBox::warning(MainWindow::instance(), TITLE_OR_TEXT(
|
||||||
tr("Cylinder cannot be removed"),
|
tr("Cylinder cannot be removed"),
|
||||||
tr("This gas in use. Only cylinders that are not used in the dive can be removed.")),
|
tr("This gas in use. Only cylinders that are not used in the dive can be removed.")),
|
||||||
|
|
Loading…
Add table
Reference in a new issue