- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/CmdAction/VersionAction.cpp
r623e89 r047878 6 6 */ 7 7 8 #include "Helpers/MemDebug.hpp" 9 8 10 #include "Actions/CmdAction/VersionAction.hpp" 11 #include "Actions/ActionRegistry.hpp" 9 12 10 13 #include <iostream> … … 15 18 #include "UIElements/UIFactory.hpp" 16 19 #include "UIElements/Dialog.hpp" 17 #include " Actions/MapOfActions.hpp"20 #include "UIElements/ValueStorage.hpp" 18 21 19 22 const char CommandLineVersionAction::NAME[] = "version"; … … 26 29 {} 27 30 28 Action::state_ptr CommandLineVersionAction::performCall() { 29 Dialog *dialog = UIFactory::getInstance().makeDialog(); 31 void CommandVersion() { 32 ActionRegistry::getInstance().getActionByName(CommandLineVersionAction::NAME)->call(Action::NonInteractive); 33 }; 34 35 Dialog* CommandLineVersionAction::fillDialog(Dialog *dialog) { 36 ASSERT(dialog,"No Dialog given when filling action dialog"); 30 37 31 38 dialog->queryEmpty(NAME, ESPACKVersion); 32 39 33 if(dialog->display()) { 34 delete dialog; 35 return Action::success; 36 } else { 37 delete dialog; 38 return Action::failure; 39 } 40 return dialog; 41 } 42 43 Action::state_ptr CommandLineVersionAction::performCall() { 44 return Action::success; 40 45 } 41 46 42 47 Action::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)); 48 return Action::success; 50 49 } 51 50 52 51 Action::state_ptr CommandLineVersionAction::performRedo(Action::state_ptr _state){ 53 return Action:: failure;52 return Action::success; 54 53 } 55 54 56 55 bool CommandLineVersionAction::canUndo() { 57 return false;56 return true; 58 57 } 59 58 60 59 bool CommandLineVersionAction::shouldUndo() { 61 return false;60 return true; 62 61 } 63 62
Note:
See TracChangeset
for help on using the changeset viewer.