diff options
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 01a3c33b3..1689139e1 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -336,7 +336,10 @@ void CylindersModel::remove(const QModelIndex &index) return; } 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( tr("Cylinder cannot be removed"), tr("This gas in use. Only cylinders that are not used in the dive can be removed.")), |