From 69ea7a3d51d653906d35a86203ce197cf22f73a5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 13 Mar 2020 18:51:48 +0100 Subject: [PATCH] Gui: move disabling of auto transactions before the call of showing a task dialog This is needed because a task dialog's open() function still fails to open a transaction when it checks for a pending transaction and auto transaction is still enabled. --- src/Gui/Control.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Gui/Control.cpp b/src/Gui/Control.cpp index 522c4c21ba2c..11ca885cd496 100644 --- a/src/Gui/Control.cpp +++ b/src/Gui/Control.cpp @@ -109,6 +109,14 @@ void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg) } return; } + + // Since the caller sets up a modeless task panel, it indicates intension + // for prolonged editing. So disable auto transaction in the current call + // stack. + // Do this before showing the dialog because its open() function is called + // which may open a transaction but fails when auto transaction is still active. + App::AutoTransaction::setEnable(false); + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); // should return the pointer to combo view @@ -148,11 +156,6 @@ void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg) dw->raise(); } } - - // Since the caller sets up a modeless task panel, it indicates intension - // for prolonged editing. So disable auto transaction in the current call - // stack. - App::AutoTransaction::setEnable(false); } QTabWidget* ControlSingleton::tabPanel() const