mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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:
parent
a636e4f2c1
commit
cb41f34826
1 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue