- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/CmdAction/HelpAction.cpp
r112b09 r047878 9 9 10 10 #include "Actions/CmdAction/HelpAction.hpp" 11 #include "Actions/ActionRegistry.hpp" 11 12 #include "CommandLineParser.hpp" 12 13 … … 29 30 {} 30 31 31 Action::state_ptr CommandLineHelpAction::performCall() { 32 void CommandHelp() { 33 ActionRegistry::getInstance().getActionByName(CommandLineHelpAction::NAME)->call(Action::NonInteractive); 34 }; 35 36 Dialog* CommandLineHelpAction::fillDialog(Dialog *dialog) { 37 ASSERT(dialog,"No Dialog given when filling action dialog"); 38 32 39 ostringstream usage; 33 Dialog *dialog = UIFactory::getInstance().makeDialog();34 35 40 usage << CommandLineParser::getInstance().visible << endl; 36 41 dialog->queryEmpty(NAME, usage.str()); 37 42 38 if(dialog->display()) { 39 delete dialog; 40 return Action::success; 41 } else { 42 delete dialog; 43 return Action::failure; 44 } 43 return dialog; 44 } 45 46 Action::state_ptr CommandLineHelpAction::performCall() { 47 return Action::success; 45 48 } 46 49 47 50 Action::state_ptr CommandLineHelpAction::performUndo(Action::state_ptr _state) { 48 // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get()); 49 50 return Action::failure; 51 // string newName = state->mol->getName(); 52 // state->mol->setName(state->lastName); 53 // 54 // return Action::state_ptr(new ParserLoadXyzState(state->mol,newName)); 51 return Action::success; 55 52 } 56 53 57 54 Action::state_ptr CommandLineHelpAction::performRedo(Action::state_ptr _state){ 58 return Action:: failure;55 return Action::success; 59 56 } 60 57 61 58 bool CommandLineHelpAction::canUndo() { 62 return false;59 return true; 63 60 } 64 61 65 62 bool CommandLineHelpAction::shouldUndo() { 66 return false;63 return true; 67 64 } 68 65
Note:
See TracChangeset
for help on using the changeset viewer.