From a9e9bc21e4dd901168e257e9da4177ba2caac467 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 13 Oct 2018 12:21:17 +0200 Subject: [PATCH] fixes 0003341: Undoing is missing steps --- src/Gui/propertyeditor/PropertyEditor.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index 413a4eb58f..4f029c895a 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -103,8 +103,15 @@ void PropertyEditor::closeEditor (QWidget * editor, QAbstractItemDelegate::EndEd { if (autoupdate) { App::Document* doc = App::GetApplication().getActiveDocument(); - if (doc && doc->isTouched()) - doc->recompute(); + if (doc) { + if (doc->isTouched()) { + doc->commitTransaction(); + doc->recompute(); + } + else { + doc->abortTransaction(); + } + } } QTreeView::closeEditor(editor, hint); } @@ -140,6 +147,13 @@ void PropertyEditor::currentChanged ( const QModelIndex & current, const QModelI void PropertyEditor::onItemActivated ( const QModelIndex & index ) { + if (autoupdate) { + PropertyItem* property = static_cast(index.internalPointer()); + QString edit = tr("Edit %1").arg(property->propertyName()); + App::Document* doc = App::GetApplication().getActiveDocument(); + if (doc) + doc->openTransaction(edit.toUtf8()); + } openPersistentEditor(model()->buddy(index)); }