From cb41f34826e7cc1caf0fd0358f99266030f8c0c3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 15 Mar 2014 15:14:59 -0700 Subject: Don't put cylinder widget in edit mode if deletion of cylinder failed If the user tries to delete a cylinder that is in use and that action is rejected, the cylinder widget (and the whole dive) should not be put into edit mode. After all, nothing changed. Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'qt-ui/maintab.cpp') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 45483f177..378ee6163 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -977,11 +977,15 @@ void MainTab::on_visibility_valueChanged(int value) void MainTab::editCylinderWidget(const QModelIndex &index) { - if (editMode == NONE) + if (cylindersModel->changed && editMode == NONE) { enableEdition(); - - if (index.isValid() && index.column() != CylindersModel::REMOVE) + return; + } + if (index.isValid() && index.column() != CylindersModel::REMOVE) { + if (editMode == NONE) + enableEdition(); ui.cylinders->edit(index); + } } void MainTab::editWeightWidget(const QModelIndex &index) -- cgit v1.2.3-70-g09d2