source: molecuilder/src/Actions/CmdAction/VersionAction.cpp@ e62daa

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

Added VersionAction.

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

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 * VersionAction.cpp
3 *
4 * Created on: May 8, 2010
5 * Author: heber
6 */
7
8#include "Actions/CmdAction/VersionAction.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 CommandLineVersionAction::NAME[] = "version";
20
21CommandLineVersionAction::CommandLineVersionAction() :
22 Action(NAME)
23{}
24
25CommandLineVersionAction::~CommandLineVersionAction()
26{}
27
28Action::state_ptr CommandLineVersionAction::performCall() {
29 Dialog *dialog = UIFactory::getInstance().makeDialog();
30
31 dialog->queryEmpty(NAME, ESPACKVersion);
32
33 if(dialog->display()) {
34 delete dialog;
35 return Action::success;
36 } else {
37 delete dialog;
38 return Action::failure;
39 }
40}
41
42Action::state_ptr CommandLineVersionAction::performUndo(Action::state_ptr _state) {
43// ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
44
45 return Action::failure;
46// string newName = state->mol->getName();
47// state->mol->setName(state->lastName);
48//
49// return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
50}
51
52Action::state_ptr CommandLineVersionAction::performRedo(Action::state_ptr _state){
53 return Action::failure;
54}
55
56bool CommandLineVersionAction::canUndo() {
57 return false;
58}
59
60bool CommandLineVersionAction::shouldUndo() {
61 return false;
62}
63
64const string CommandLineVersionAction::getName() {
65 return NAME;
66}
Note: See TracBrowser for help on using the repository browser.