source: molecuilder/src/Actions/CmdAction/HelpAction.cpp@ b918031

Last change on this file since b918031 was b918031, checked in by Frederik Heber <heber@…>, 16 years ago

new query class EmptyQuery for showing text messages.

Signed-off-by: Frederik Heber <heber@…>

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 * HelpAction.cpp
3 *
4 * Created on: May 8, 2010
5 * Author: heber
6 */
7
8#include "Actions/CmdAction/HelpAction.hpp"
9#include "CommandLineParser.hpp"
10
11#include <iostream>
12#include <string>
13
14using namespace std;
15
16#include "UIElements/UIFactory.hpp"
17#include "UIElements/Dialog.hpp"
18
19const char CommandLineHelpAction::NAME[] = "help";
20
21CommandLineHelpAction::CommandLineHelpAction() :
22 Action(NAME)
23{}
24
25CommandLineHelpAction::~CommandLineHelpAction()
26{}
27
28Action::state_ptr CommandLineHelpAction::performCall() {
29 ostringstream usage;
30 Dialog *dialog = UIFactory::getInstance().makeDialog();
31
32 usage << CommandLineParser::getInstance().visible << endl;
33 dialog->queryEmpty(NAME, usage.str());
34
35 if(dialog->display()) {
36 delete dialog;
37 return Action::success;
38 } else {
39 delete dialog;
40 return Action::failure;
41 }
42}
43
44Action::state_ptr CommandLineHelpAction::performUndo(Action::state_ptr _state) {
45// ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
46
47 return Action::failure;
48// string newName = state->mol->getName();
49// state->mol->setName(state->lastName);
50//
51// return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
52}
53
54Action::state_ptr CommandLineHelpAction::performRedo(Action::state_ptr _state){
55 return Action::failure;
56}
57
58bool CommandLineHelpAction::canUndo() {
59 return false;
60}
61
62bool CommandLineHelpAction::shouldUndo() {
63 return false;
64}
65
66const string CommandLineHelpAction::getName() {
67 return NAME;
68}
Note: See TracBrowser for help on using the repository browser.