|
Last change
on this file since ae8b90 was ae8b90, checked in by Frederik Heber <heber@…>, 16 years ago |
|
New HelpAction that will print the help from boost::program_options.
- new class CommandLineHelpAction that will print the boost::program_options help
- therefore CommandLineParser::visible had to be made public
- CommandLineHelpAction is instantiated in CommandLineWindow::populateParserActions()
|
-
Property mode
set to
100644
|
|
File size:
1.3 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 |
|
|---|
| 14 | using namespace std;
|
|---|
| 15 |
|
|---|
| 16 | #include "UIElements/UIFactory.hpp"
|
|---|
| 17 | #include "UIElements/Dialog.hpp"
|
|---|
| 18 |
|
|---|
| 19 | const char CommandLineHelpAction::NAME[] = "help";
|
|---|
| 20 |
|
|---|
| 21 | CommandLineHelpAction::CommandLineHelpAction() :
|
|---|
| 22 | Action(NAME)
|
|---|
| 23 | {}
|
|---|
| 24 |
|
|---|
| 25 | CommandLineHelpAction::~CommandLineHelpAction()
|
|---|
| 26 | {}
|
|---|
| 27 |
|
|---|
| 28 | Action::state_ptr CommandLineHelpAction::performCall() {
|
|---|
| 29 | Dialog *dialog = UIFactory::getInstance().makeDialog();
|
|---|
| 30 |
|
|---|
| 31 | cout << CommandLineParser::getInstance().visible << endl;
|
|---|
| 32 |
|
|---|
| 33 | delete dialog;
|
|---|
| 34 | return Action::failure;
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | Action::state_ptr CommandLineHelpAction::performUndo(Action::state_ptr _state) {
|
|---|
| 38 | // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
|
|---|
| 39 |
|
|---|
| 40 | return Action::failure;
|
|---|
| 41 | // string newName = state->mol->getName();
|
|---|
| 42 | // state->mol->setName(state->lastName);
|
|---|
| 43 | //
|
|---|
| 44 | // return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | Action::state_ptr CommandLineHelpAction::performRedo(Action::state_ptr _state){
|
|---|
| 48 | return Action::failure;
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | bool CommandLineHelpAction::canUndo() {
|
|---|
| 52 | return false;
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | bool CommandLineHelpAction::shouldUndo() {
|
|---|
| 56 | return false;
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 | const string CommandLineHelpAction::getName() {
|
|---|
| 60 | return NAME;
|
|---|
| 61 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.