SetPropertyMigrationAnswerCommand.h header

#include <ew/core/SetPropertyMigrationAnswerCommand.h>

Namespace ew::core

SetPropertyMigrationAnswerCommand class

class ew::core::SetPropertyMigrationAnswerCommand

Command that records the project's answer to the property-migration prompt – empty (never asked), "accepted", or "declined".

A command rather than a bare setter for the same reason every other project-wide setting has one: the answer is stored in the project file, so writing it directly from a dialog would make an edit the writer cannot take back. Undoing an accepted migration has to undo the recorded answer with it, or the prompt would never return and the project would sit half-migrated with nothing offering to finish.

Members

ew::core::project::SetPropertyMigrationAnswerCommand::SetPropertyMigrationAnswerCommand(Project &project, QString answer)

Creates a command that records answer on project when applied.

ew::core::project::SetPropertyMigrationAnswerCommand::~SetPropertyMigrationAnswerCommand() override

Destroys the command.

void ew::core::project::SetPropertyMigrationAnswerCommand::apply() override

Records the previous answer and applies the new one.

void ew::core::project::SetPropertyMigrationAnswerCommand::undo() override

Restores the previous answer.

QString ew::core::project::SetPropertyMigrationAnswerCommand::description() const override

Returns a short description for the undo/redo UI.