Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/CmdAction/HelpAction.cpp

    r112b09 r047878  
    99
    1010#include "Actions/CmdAction/HelpAction.hpp"
     11#include "Actions/ActionRegistry.hpp"
    1112#include "CommandLineParser.hpp"
    1213
     
    2930{}
    3031
    31 Action::state_ptr CommandLineHelpAction::performCall() {
     32void CommandHelp() {
     33  ActionRegistry::getInstance().getActionByName(CommandLineHelpAction::NAME)->call(Action::NonInteractive);
     34};
     35
     36Dialog* CommandLineHelpAction::fillDialog(Dialog *dialog) {
     37  ASSERT(dialog,"No Dialog given when filling action dialog");
     38
    3239  ostringstream usage;
    33   Dialog *dialog = UIFactory::getInstance().makeDialog();
    34 
    3540  usage << CommandLineParser::getInstance().visible << endl;
    3641  dialog->queryEmpty(NAME, usage.str());
    3742
    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
     46Action::state_ptr CommandLineHelpAction::performCall() {
     47  return Action::success;
    4548}
    4649
    4750Action::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;
    5552}
    5653
    5754Action::state_ptr CommandLineHelpAction::performRedo(Action::state_ptr _state){
    58   return Action::failure;
     55  return Action::success;
    5956}
    6057
    6158bool CommandLineHelpAction::canUndo() {
    62   return false;
     59  return true;
    6360}
    6461
    6562bool CommandLineHelpAction::shouldUndo() {
    66   return false;
     63  return true;
    6764}
    6865
Note: See TracChangeset for help on using the changeset viewer.