/* * VersionAction.cpp * * Created on: May 8, 2010 * Author: heber */ #include "Actions/CmdAction/VersionAction.hpp" #include #include using namespace std; #include "UIElements/UIFactory.hpp" #include "UIElements/Dialog.hpp" #include "Actions/MapOfActions.hpp" const char CommandLineVersionAction::NAME[] = "version"; CommandLineVersionAction::CommandLineVersionAction() : Action(NAME) {} CommandLineVersionAction::~CommandLineVersionAction() {} Action::state_ptr CommandLineVersionAction::performCall() { Dialog *dialog = UIFactory::getInstance().makeDialog(); dialog->queryEmpty(NAME, ESPACKVersion); if(dialog->display()) { delete dialog; return Action::success; } else { delete dialog; return Action::failure; } } Action::state_ptr CommandLineVersionAction::performUndo(Action::state_ptr _state) { // ParserLoadXyzState *state = assert_cast(_state.get()); return Action::failure; // string newName = state->mol->getName(); // state->mol->setName(state->lastName); // // return Action::state_ptr(new ParserLoadXyzState(state->mol,newName)); } Action::state_ptr CommandLineVersionAction::performRedo(Action::state_ptr _state){ return Action::failure; } bool CommandLineVersionAction::canUndo() { return false; } bool CommandLineVersionAction::shouldUndo() { return false; } const string CommandLineVersionAction::getName() { return NAME; }