mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
undo: add flag that indicates whether a command has been placed
In multiple places we have the problem that when an undo command is executed, the corresponding value-changed signals are emitted, which in turn updates the UI. This can have nasty UI effects, such as the cursor position in the notes field being reset. To avoid this, add a flag that indicates whether a newly placed command is currently executed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
04c5ab0e36
commit
1b8f3a06ec
2 changed files with 9 additions and 0 deletions
|
@ -91,10 +91,13 @@ QString changesMade()
|
|||
return changeTexts;
|
||||
}
|
||||
|
||||
static bool executingCommand = false;
|
||||
bool execute(Base *cmd)
|
||||
{
|
||||
if (cmd->workToBeDone()) {
|
||||
executingCommand = true;
|
||||
undoStack.push(cmd);
|
||||
executingCommand = false;
|
||||
emit diveListNotifier.commandExecuted();
|
||||
return true;
|
||||
} else {
|
||||
|
@ -103,6 +106,11 @@ bool execute(Base *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
bool placingCommand()
|
||||
{
|
||||
return executingCommand;
|
||||
}
|
||||
|
||||
} // namespace Command
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue