mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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)
|
void MainTab::editCylinderWidget(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (editMode == NONE)
|
if (cylindersModel->changed && editMode == NONE) {
|
||||||
enableEdition();
|
enableEdition();
|
||||||
|
return;
|
||||||
if (index.isValid() && index.column() != CylindersModel::REMOVE)
|
}
|
||||||
|
if (index.isValid() && index.column() != CylindersModel::REMOVE) {
|
||||||
|
if (editMode == NONE)
|
||||||
|
enableEdition();
|
||||||
ui.cylinders->edit(index);
|
ui.cylinders->edit(index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::editWeightWidget(const QModelIndex &index)
|
void MainTab::editWeightWidget(const QModelIndex &index)
|
||||||
|
|
Loading…
Add table
Reference in a new issue