Gui: improve transaction handling in PropertyEditor
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user