diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index e839aedf4b..6423753446 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -225,7 +225,7 @@ void PropertyEditor::setupTransaction(const QModelIndex &index) { str << prop->getName(); if(items.size()>1) str << "..."; - app.setActiveTransaction(str.str().c_str()); + transactionID = app.setActiveTransaction(str.str().c_str()); FC_LOG("editor transaction " << app.getActiveTransaction()); } @@ -249,8 +249,11 @@ void PropertyEditor::closeTransaction() doc->recompute(); } } - App::GetApplication().closeActiveTransaction(); } + + int tid = 0; + if(App::GetApplication().getActiveTransaction(&tid) && tid == transactionID) + App::GetApplication().closeActiveTransaction(); } void PropertyEditor::closeEditor (QWidget * editor, QAbstractItemDelegate::EndEditHint hint) @@ -325,8 +328,7 @@ void PropertyEditor::buildUp(PropertyModel::PropertyList &&props, bool checkDocu return; } - if(this->state() == EditingState) - closeTransaction(); + closeTransaction(); QModelIndex index = this->currentIndex(); QStringList propertyPath = propertyModel->propertyPathFromIndex(index); diff --git a/src/Gui/propertyeditor/PropertyEditor.h b/src/Gui/propertyeditor/PropertyEditor.h index a41087b0fe..70df5b2128 100644 --- a/src/Gui/propertyeditor/PropertyEditor.h +++ b/src/Gui/propertyeditor/PropertyEditor.h @@ -118,11 +118,13 @@ private: bool autoupdate; bool committing; bool delaybuild; + bool binding; + + int transactionID = 0; + QColor groupColor; QBrush background; - bool binding; - friend class Gui::PropertyView; };