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>
This commit is contained in:
Dirk Hohndel 2014-03-15 15:14:59 -07:00
parent a636e4f2c1
commit cb41f34826

View file

@ -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)