UI: Do not allow new undo actions while undo disabled

This commit is contained in:
jp9000 2021-05-21 18:14:59 -07:00
parent 008a7372d3
commit 64cd451def

View File

@ -34,6 +34,9 @@ void undo_stack::add_action(const QString &name, undo_redo_cb undo,
undo_redo_cb redo, std::string undo_data,
std::string redo_data, bool repeatable)
{
if (!is_enabled())
return;
while (undo_items.size() >= MAX_STACK_SIZE) {
undo_redo_t item = undo_items.back();
undo_items.pop_back();