Undo: only show warning message if dives were actually edited

The multiple-dives-edited message was shown even if the value was
not changed. Notably, when tab-flipping through the dive fields.

Therefore, changed the execute_edit() function to return zero
when no command was executed. For this, return a boolean from
the execute() function indicating whether the command was really
executed or trashed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-05-24 21:17:22 +02:00 committed by Dirk Hohndel
parent 944a9aed54
commit f51e402e04
3 changed files with 10 additions and 8 deletions

View file

@ -168,8 +168,8 @@ public:
// Put a command on the undoStack (and take ownership), but test whether there
// is something to be done beforehand by calling the workToBeDone() function.
// If nothing is to be done, the command will be deleted.
void execute(Base *cmd);
// If nothing is to be done, the command will be deleted and false is returned.
bool execute(Base *cmd);
} // namespace Command