SetLineBudgetsCommand.h header

#include <ew/core/branching/SetLineBudgetsCommand.h>

Namespace ew::core::branching

SetLineBudgetsCommand class

class ew::core::branching::SetLineBudgetsCommand

Command that replaces what a line is allowed to cost – the budgets and the reading rate. Undo restores the previous registry.

Whole-registry rather than per-budget, for the reason SetDialogueCommandsCommand beside it is: nothing else is in play when a panel edits a project-wide registry, so the tempting shortcut is to call the setter directly – which compiles, works, and silently makes the edit un-undoable.

Members

ew::core::branching::SetLineBudgetsCommand::SetLineBudgetsCommand(ew::core::project::Project &project, LineBudgets budgets)

Creates a command that sets the registry to budgets when applied.

ew::core::branching::SetLineBudgetsCommand::~SetLineBudgetsCommand() override

Destroys the command.

void ew::core::branching::SetLineBudgetsCommand::apply() override

Records the current registry and applies the new one.

void ew::core::branching::SetLineBudgetsCommand::undo() override

Restores the previous registry.

QString ew::core::branching::SetLineBudgetsCommand::description() const override

Returns a short description for the undo/redo UI.

ew::core::foundation::OperationSubject ew::core::branching::SetLineBudgetsCommand::subject() const override

Returns the subject this command changes. See Command::subject().