From db82bf99bbd6d246f3e8da19fe88705f7015f144 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 16 Nov 2015 20:39:21 +0300 Subject: Move TextCommandType enum into separate file and convert to strong typed. --- src/gui/windows/textcommandeditor.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/windows/textcommandeditor.cpp b/src/gui/windows/textcommandeditor.cpp index 32cc0959f..115a3bace 100644 --- a/src/gui/windows/textcommandeditor.cpp +++ b/src/gui/windows/textcommandeditor.cpp @@ -47,7 +47,8 @@ TextCommandEditor::TextCommandEditor(TextCommand *const command) : Window(_("Command Editor"), Modal_false, nullptr, "commandeditor.xml"), ActionListener(), mIsMagicCommand(command ? - (command->getCommandType() == TEXT_COMMAND_MAGIC) : false), + (command->getCommandType() == TextCommandType::Magic) : + false), mCommand(command), // TRANSLATORS: command editor button mIsMagic(new RadioButton(this, _("magic"), "magic", mIsMagicCommand)), @@ -131,7 +132,7 @@ TextCommandEditor::TextCommandEditor(TextCommand *const command) : if (command) { - if (command->getCommandType() == TEXT_COMMAND_MAGIC) + if (command->getCommandType() == TextCommandType::Magic) showControls(Visible_true); else showControls(Visible_false); @@ -252,9 +253,9 @@ void TextCommandEditor::scheduleDelete() void TextCommandEditor::save() { if (mIsMagicCommand) - mCommand->setCommandType(TEXT_COMMAND_MAGIC); + mCommand->setCommandType(TextCommandType::Magic); else - mCommand->setCommandType(TEXT_COMMAND_TEXT); + mCommand->setCommandType(TextCommandType::Text); mCommand->setSymbol(mSymbolTextField->getText()); mCommand->setCommand(mCommandTextField->getText()); @@ -273,7 +274,7 @@ void TextCommandEditor::save() void TextCommandEditor::deleteCommand() { - mCommand->setCommandType(TEXT_COMMAND_TEXT); + mCommand->setCommandType(TextCommandType::Text); mCommand->setSymbol(""); mCommand->setCommand(""); mCommand->setComment(""); -- cgit v1.2.3-60-g2f50