diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-03-15 15:14:59 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-15 15:38:10 -0700 |
commit | cb41f34826e7cc1caf0fd0358f99266030f8c0c3 (patch) | |
tree | 9538ef16912ca3ecb2a898cee6ca150f99130ee4 /qt-ui/maintab.cpp | |
parent | a636e4f2c1715500ca4947229dd963802924b5b2 (diff) | |
download | subsurface-cb41f34826e7cc1caf0fd0358f99266030f8c0c3.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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) |