Skip to content

Commit

Permalink
Gui: move disabling of auto transactions before the call of showing a…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
wwmayer committed Mar 14, 2020
1 parent 2b16d06 commit 69ea7a3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Gui/Control.cpp
Expand Up @@ -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::DockWnd::ComboView*>
(Gui::DockWindowManager::instance()->getDockWindow("Combo View"));
// should return the pointer to combo view
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 69ea7a3

Please sign in to comment.