Skip to content

Commit

Permalink
Gui: [skip ci] add user option to disable to open a transaction on ma…
Browse files Browse the repository at this point in the history
…nual document recompute
  • Loading branch information
wwmayer committed Feb 15, 2020
1 parent 802ca4e commit 902cd41
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Gui/CommandDoc.cpp
Expand Up @@ -1291,13 +1291,22 @@ StdCmdRefresh::StdCmdRefresh()
sAccel = keySequenceToAccel(QKeySequence::Refresh);
eType = AlterDoc | Alter3DView | AlterSelection | ForEdit;
bCanLog = false;

// Make it optional to create a transaction for a recompute.
// The new default behaviour is quite cumbersome in some cases because when
// undoing the last transaction the manual recompute will clear the redo stack.
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Document");
bool create = hGrp->GetBool("TransactionOnRecompute", true);
if (!create)
eType = eType | NoTransaction;
}

void StdCmdRefresh::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
App::AutoTransaction trans("Recompute");
App::AutoTransaction trans((eType & NoTransaction) ? nullptr : "Recompute");
try {
doCommand(Doc,"App.activeDocument().recompute(None,True,True)");
}
Expand Down

0 comments on commit 902cd41

Please sign in to comment.