Changeset 1fd675 for src/Actions/CommandAction
- Timestamp:
- Aug 28, 2010, 12:57:56 AM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 966e12
- Parents:
- 53d01c
- git-author:
- Frederik Heber <heber@…> (08/26/10 21:05:34)
- git-committer:
- Frederik Heber <heber@…> (08/28/10 00:57:56)
- Location:
- src/Actions/CommandAction
- Files:
-
- 6 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/CommandAction/BondLengthTableAction.cpp
r53d01c r1fd675 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/CommandAction/BondLengthTableAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "bondgraph.hpp" 25 23 #include "config.hpp" … … 33 31 using namespace std; 34 32 35 #include "UIElements/UIFactory.hpp" 36 #include "UIElements/Dialog.hpp" 37 #include "Actions/ValueStorage.hpp" 33 #include "Actions/CommandAction/BondLengthTableAction.hpp" 38 34 39 const char CommandBondLengthTableAction::NAME[] = "bond-table"; 40 41 CommandBondLengthTableAction::CommandBondLengthTableAction() : 42 Action(NAME) 43 {} 44 45 CommandBondLengthTableAction::~CommandBondLengthTableAction() 46 {} 47 48 void CommandBondLengthTable(std::string &BondGraphFileName) { 49 ValueStorage::getInstance().setCurrentValue(CommandBondLengthTableAction::NAME, BondGraphFileName); 50 ActionRegistry::getInstance().getActionByName(CommandBondLengthTableAction::NAME)->call(Action::NonInteractive); 51 }; 52 53 void CommandBondLengthTableAction::getParametersfromValueStorage() 54 {}; 55 56 Dialog* CommandBondLengthTableAction::fillDialog(Dialog *dialog) { 57 ASSERT(dialog,"No Dialog given when filling action dialog"); 58 59 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); 60 61 return dialog; 62 } 63 35 // and construct the stuff 36 #include "BondLengthTableAction.def" 37 #include "Action_impl_pre.hpp" 38 /** =========== define the function ====================== */ 64 39 Action::state_ptr CommandBondLengthTableAction::performCall() { 65 40 ostringstream usage; 66 string BondGraphFileName;67 41 68 ValueStorage::getInstance().queryCurrentValue(NAME, BondGraphFileName); 69 DoLog(0) && (Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl); 42 // obtain information 43 getParametersfromValueStorage(); 44 45 DoLog(0) && (Log() << Verbose(0) << "Using " << params.BondGraphFileName << " as bond length table." << endl); 70 46 config *configuration = World::getInstance().getConfig(); 71 47 if (configuration->BG == NULL) { 72 48 configuration->BG = new BondGraph(configuration->GetIsAngstroem()); 73 if ((! BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(BondGraphFileName))) {49 if ((!params.BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName))) { 74 50 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 75 51 return Action::success; … … 109 85 return NAME; 110 86 } 87 /** =========== end of function ====================== */ -
src/Actions/CommandAction/BondLengthTableAction.hpp
r53d01c r1fd675 11 11 #include "Actions/Action.hpp" 12 12 13 void CommandBondLengthTable(std::string &BondGraphFileName); 14 15 class CommandBondLengthTableAction : public Action { 16 friend void CommandBondLengthTable(std::string &BondGraphFileName); 17 18 public: 19 CommandBondLengthTableAction(); 20 virtual ~CommandBondLengthTableAction(); 21 22 bool canUndo(); 23 bool shouldUndo(); 24 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 28 private: 29 virtual void getParametersfromValueStorage(); 30 virtual Action::state_ptr performCall(); 31 virtual Action::state_ptr performUndo(Action::state_ptr); 32 virtual Action::state_ptr performRedo(Action::state_ptr); 33 34 static const char NAME[]; 35 }; 13 #include "BondLengthTableAction.def" 14 #include "Action_impl_header.hpp" 36 15 37 16 #endif /* BONDLENGTHTABLEACTION_HPP_ */ -
src/Actions/CommandAction/ElementDbAction.cpp
r53d01c r1fd675 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/CommandAction/ElementDbAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "config.hpp" 25 23 #include "Helpers/Log.hpp" … … 33 31 using namespace std; 34 32 35 #include "UIElements/UIFactory.hpp" 36 #include "UIElements/Dialog.hpp" 37 #include "Actions/ValueStorage.hpp" 33 #include "Actions/CommandAction/ElementDbAction.hpp" 38 34 39 const char CommandElementDbAction::NAME[] = "element-db"; 40 41 CommandElementDbAction::CommandElementDbAction() : 42 Action(NAME) 43 {} 44 45 CommandElementDbAction::~CommandElementDbAction() 46 {} 47 48 void CommandElementDb(std::string &databasepath) { 49 ValueStorage::getInstance().setCurrentValue(CommandElementDbAction::NAME, databasepath); 50 ActionRegistry::getInstance().getActionByName(CommandElementDbAction::NAME)->call(Action::NonInteractive); 51 }; 52 53 void CommandElementDbAction::getParametersfromValueStorage() 54 {}; 55 56 Dialog* CommandElementDbAction::fillDialog(Dialog *dialog) { 57 ASSERT(dialog,"No Dialog given when filling action dialog"); 58 59 dialog->queryString(NAME, ValueStorage::getInstance().getDescription(NAME)); 60 61 return dialog; 62 } 63 35 // and construct the stuff 36 #include "ElementDbAction.def" 37 #include "Action_impl_pre.hpp" 38 /** =========== define the function ====================== */ 64 39 Action::state_ptr CommandElementDbAction::performCall() { 65 40 ostringstream usage; 66 string databasepath; 41 42 // obtain information 43 getParametersfromValueStorage(); 67 44 68 45 // get the path 69 46 // TODO: Make databasepath a std::string 70 47 config *configuration = World::getInstance().getConfig(); 71 ValueStorage::getInstance().queryCurrentValue(NAME, databasepath); 72 strcpy(configuration->databasepath, databasepath.c_str()); 48 strcpy(configuration->databasepath, params.databasepath.c_str()); 73 49 74 50 // load table … … 110 86 return NAME; 111 87 } 88 /** =========== end of function ====================== */ -
src/Actions/CommandAction/ElementDbAction.hpp
r53d01c r1fd675 11 11 #include "Actions/Action.hpp" 12 12 13 void CommandElementDb(std::string &databasepath); 14 15 class CommandElementDbAction : public Action { 16 friend void CommandElementDb(std::string &databasepath); 17 18 public: 19 CommandElementDbAction(); 20 virtual ~CommandElementDbAction(); 21 22 bool canUndo(); 23 bool shouldUndo(); 24 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 28 private: 29 virtual void getParametersfromValueStorage(); 30 virtual Action::state_ptr performCall(); 31 virtual Action::state_ptr performUndo(Action::state_ptr); 32 virtual Action::state_ptr performRedo(Action::state_ptr); 33 34 static const char NAME[]; 35 }; 13 #include "ElementDbAction.def" 14 #include "Action_impl_header.hpp" 36 15 37 16 #endif /* ELEMENTDBACTION_HPP_ */ -
src/Actions/CommandAction/FastParsingAction.cpp
r53d01c r1fd675 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/CommandAction/FastParsingAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "config.hpp" 25 23 #include "Helpers/Log.hpp" … … 32 30 using namespace std; 33 31 34 #include "UIElements/UIFactory.hpp" 35 #include "UIElements/Dialog.hpp" 36 #include "Actions/ValueStorage.hpp" 32 #include "Actions/CommandAction/FastParsingAction.hpp" 37 33 38 // memento to remember the state when undoing 39 40 class CommandFastParsingState : public ActionState { 41 public: 42 CommandFastParsingState(const bool _oldvalue, const bool _newvalue) : 43 oldvalue(_oldvalue), 44 newvalue(_newvalue) 45 {} 46 bool oldvalue; 47 bool newvalue; 48 }; 49 50 51 const char CommandFastParsingAction::NAME[] = "fastparsing"; 52 53 CommandFastParsingAction::CommandFastParsingAction() : 54 Action(NAME) 55 {} 56 57 CommandFastParsingAction::~CommandFastParsingAction() 58 {} 59 60 void CommandFastParsing(bool fastparsing) { 61 ValueStorage::getInstance().setCurrentValue(CommandFastParsingAction::NAME, fastparsing); 62 ActionRegistry::getInstance().getActionByName(CommandFastParsingAction::NAME)->call(Action::NonInteractive); 63 }; 64 65 void CommandFastParsingAction::getParametersfromValueStorage() 66 {}; 67 68 Dialog* CommandFastParsingAction::fillDialog(Dialog *dialog) { 69 ASSERT(dialog,"No Dialog given when filling action dialog"); 70 71 dialog->queryBoolean(NAME, ValueStorage::getInstance().getDescription(NAME)); 72 73 return dialog; 74 } 75 34 // and construct the stuff 35 #include "FastParsingAction.def" 36 #include "Action_impl_pre.hpp" 37 /** =========== define the function ====================== */ 76 38 Action::state_ptr CommandFastParsingAction::performCall() { 77 39 config *configuration = World::getInstance().getConfig(); 78 40 bool oldvalue = configuration->FastParsing; 79 bool newvalue; 80 ValueStorage::getInstance().queryCurrentValue(NAME, newvalue); 81 configuration->FastParsing = newvalue; 41 42 // obtain information 43 getParametersfromValueStorage(); 44 45 configuration->FastParsing = params.fastparsing; 82 46 if (configuration->FastParsing) 83 47 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 84 48 else 85 49 DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl); 86 return Action::state_ptr(new CommandFastParsingState(oldvalue, newvalue));50 return Action::state_ptr(new CommandFastParsingState(oldvalue, params)); 87 51 } 88 52 … … 104 68 105 69 config *configuration = World::getInstance().getConfig(); 106 configuration->FastParsing = state-> newvalue;70 configuration->FastParsing = state->params.fastparsing; 107 71 if (configuration->FastParsing) 108 72 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); … … 124 88 return NAME; 125 89 } 90 /** =========== end of function ====================== */ -
src/Actions/CommandAction/FastParsingAction.hpp
r53d01c r1fd675 11 11 #include "Actions/Action.hpp" 12 12 13 void CommandFastParsing(bool fastparsing); 14 15 class CommandFastParsingAction : public Action { 16 friend void CommandFastParsing(bool fastparsing); 17 18 public: 19 CommandFastParsingAction(); 20 virtual ~CommandFastParsingAction(); 21 22 bool canUndo(); 23 bool shouldUndo(); 24 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 28 private: 29 virtual void getParametersfromValueStorage(); 30 virtual Action::state_ptr performCall(); 31 virtual Action::state_ptr performUndo(Action::state_ptr); 32 virtual Action::state_ptr performRedo(Action::state_ptr); 33 34 static const char NAME[]; 35 }; 13 #include "FastParsingAction.def" 14 #include "Action_impl_header.hpp" 36 15 37 16 #endif /* FASTPARSINGACTION_HPP_ */ -
src/Actions/CommandAction/HelpAction.cpp
r53d01c r1fd675 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/CommandAction/HelpAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "CommandLineParser.hpp" 25 23 … … 29 27 using namespace std; 30 28 31 #include "UIElements/UIFactory.hpp" 32 #include "UIElements/Dialog.hpp" 33 #include "Actions/ValueStorage.hpp" 29 #include "Actions/CommandAction/HelpAction.hpp" 34 30 35 const char CommandHelpAction::NAME[] = "help"; 31 // and construct the stuff 32 #include "HelpAction.def" 33 #include "Action_impl_pre.hpp" 34 /** =========== define the function ====================== */ 35 Action::state_ptr CommandHelpAction::performCall() { 36 // obtain information 37 getParametersfromValueStorage(); 36 38 37 CommandHelpAction::CommandHelpAction() :38 Action(NAME)39 {}40 41 CommandHelpAction::~CommandHelpAction()42 {}43 44 void CommandHelp() {45 ActionRegistry::getInstance().getActionByName(CommandHelpAction::NAME)->call(Action::NonInteractive);46 };47 48 void CommandHelpAction::getParametersfromValueStorage()49 {};50 51 Dialog* CommandHelpAction::fillDialog(Dialog *dialog) {52 ASSERT(dialog,"No Dialog given when filling action dialog");53 54 ostringstream usage;55 usage << CommandLineParser::getInstance().visible << endl;56 dialog->queryEmpty(NAME, usage.str());57 58 return dialog;59 }60 61 Action::state_ptr CommandHelpAction::performCall() {62 39 return Action::success; 63 40 } … … 82 59 return NAME; 83 60 } 61 /** =========== end of function ====================== */ -
src/Actions/CommandAction/HelpAction.hpp
r53d01c r1fd675 11 11 #include "Actions/Action.hpp" 12 12 13 void CommandHelp(); 14 15 class CommandHelpAction : public Action { 16 friend void CommandHelp(); 17 18 public: 19 CommandHelpAction(); 20 virtual ~CommandHelpAction(); 21 22 bool canUndo(); 23 bool shouldUndo(); 24 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 28 private: 29 virtual void getParametersfromValueStorage(); 30 virtual Action::state_ptr performCall(); 31 virtual Action::state_ptr performUndo(Action::state_ptr); 32 virtual Action::state_ptr performRedo(Action::state_ptr); 33 34 static const char NAME[]; 35 }; 13 #include "HelpAction.def" 14 #include "Action_impl_header.hpp" 36 15 37 16 #endif /* HELPACTION_HPP_ */ -
src/Actions/CommandAction/VerboseAction.cpp
r53d01c r1fd675 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/CommandAction/VerboseAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "Helpers/Log.hpp" 25 23 #include "Helpers/Verbose.hpp" … … 30 28 using namespace std; 31 29 32 #include "UIElements/UIFactory.hpp" 33 #include "UIElements/Dialog.hpp" 34 #include "Actions/ValueStorage.hpp" 30 #include "Actions/CommandAction/VerboseAction.hpp" 35 31 36 // memento to remember the state when undoing 37 38 class CommandVerboseState : public ActionState { 39 public: 40 CommandVerboseState(const int _oldverbosity, const int _newverbosity) : 41 oldverbosity(_oldverbosity), 42 newverbosity(_newverbosity) 43 {} 44 int oldverbosity; 45 int newverbosity; 46 }; 47 48 49 const char CommandVerboseAction::NAME[] = "verbose"; 50 51 CommandVerboseAction::CommandVerboseAction() : 52 Action(NAME) 53 {} 54 55 CommandVerboseAction::~CommandVerboseAction() 56 {} 57 58 void CommandVerbose(int verbosity) { 59 ValueStorage::getInstance().setCurrentValue(CommandVerboseAction::NAME, verbosity); 60 ActionRegistry::getInstance().getActionByName(CommandVerboseAction::NAME)->call(Action::NonInteractive); 61 }; 62 63 void CommandVerboseAction::getParametersfromValueStorage() 64 {}; 65 66 Dialog* CommandVerboseAction::fillDialog(Dialog *dialog) { 67 ASSERT(dialog,"No Dialog given when filling action dialog"); 68 69 dialog->queryInt(NAME, ValueStorage::getInstance().getDescription(NAME)); 70 71 return dialog; 72 } 73 32 // and construct the stuff 33 #include "VerboseAction.def" 34 #include "Action_impl_pre.hpp" 35 /** =========== define the function ====================== */ 74 36 Action::state_ptr CommandVerboseAction::performCall() { 75 37 int oldverbosity = getVerbosity(); 76 int newverbosity = 2;77 38 78 ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity); 39 // obtain information 40 getParametersfromValueStorage(); 79 41 80 if (oldverbosity != newverbosity) {81 CommandVerboseState *UndoState = new CommandVerboseState(oldverbosity, newverbosity);82 setVerbosity( newverbosity);83 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << oldverbosity << " to " << newverbosity << "." << endl);42 if (oldverbosity != params.verbosity) { 43 CommandVerboseState *UndoState = new CommandVerboseState(oldverbosity, params); 44 setVerbosity(params.verbosity); 45 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << oldverbosity << " to " << params.verbosity << "." << endl); 84 46 return Action::state_ptr(UndoState); 85 47 } else { … … 92 54 CommandVerboseState *state = assert_cast<CommandVerboseState*>(_state.get()); 93 55 94 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state-> newverbosity << " to " << state->oldverbosity << "." << endl);56 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->params.verbosity << " to " << state->oldverbosity << "." << endl); 95 57 setVerbosity(state->oldverbosity); 96 58 … … 101 63 CommandVerboseState *state = assert_cast<CommandVerboseState*>(_state.get()); 102 64 103 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->oldverbosity << " to " << state-> newverbosity << "." << endl);104 setVerbosity(state-> newverbosity);65 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->oldverbosity << " to " << state->params.verbosity << "." << endl); 66 setVerbosity(state->params.verbosity); 105 67 106 68 return Action::state_ptr(_state); … … 118 80 return NAME; 119 81 } 82 /** =========== end of function ====================== */ -
src/Actions/CommandAction/VerboseAction.hpp
r53d01c r1fd675 11 11 #include "Actions/Action.hpp" 12 12 13 void CommandVerbose(int verbosity); 14 15 class CommandVerboseAction : public Action { 16 friend void CommandVerbose(int verbosity); 17 18 public: 19 CommandVerboseAction(); 20 virtual ~CommandVerboseAction(); 21 22 bool canUndo(); 23 bool shouldUndo(); 24 25 virtual const std::string getName(); 26 protected: 27 virtual Dialog * fillDialog(Dialog *dialog); 28 private: 29 virtual void getParametersfromValueStorage(); 30 virtual Action::state_ptr performCall(); 31 virtual Action::state_ptr performUndo(Action::state_ptr); 32 virtual Action::state_ptr performRedo(Action::state_ptr); 33 34 static const char NAME[]; 35 }; 13 #include "VerboseAction.def" 14 #include "Action_impl_header.hpp" 36 15 37 16 #endif /* VERBOSEACTION_HPP_ */ -
src/Actions/CommandAction/VersionAction.cpp
r53d01c r1fd675 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Actions/CommandAction/VersionAction.hpp"23 #include "Actions/ActionRegistry.hpp"24 22 #include "version.h" 25 23 … … 29 27 using namespace std; 30 28 31 #include "UIElements/UIFactory.hpp" 32 #include "UIElements/Dialog.hpp" 33 #include "Actions/ValueStorage.hpp" 29 #include "Actions/CommandAction/VersionAction.hpp" 34 30 35 const char CommandVersionAction::NAME[] = "version"; 31 // and construct the stuff 32 #include "VersionAction.def" 33 #include "Action_impl_pre.hpp" 34 /** =========== define the function ====================== */ 35 Action::state_ptr CommandVersionAction::performCall() { 36 // obtain information 37 getParametersfromValueStorage(); 36 38 37 CommandVersionAction::CommandVersionAction() :38 Action(NAME)39 {}40 41 CommandVersionAction::~CommandVersionAction()42 {}43 44 void CommandVersion() {45 ActionRegistry::getInstance().getActionByName(CommandVersionAction::NAME)->call(Action::NonInteractive);46 };47 48 void CommandVersionAction::getParametersfromValueStorage()49 {};50 51 Dialog* CommandVersionAction::fillDialog(Dialog *dialog) {52 ASSERT(dialog,"No Dialog given when filling action dialog");53 54 dialog->queryEmpty(NAME, MOLECUILDERVERSION);55 56 return dialog;57 }58 59 Action::state_ptr CommandVersionAction::performCall() {60 39 return Action::success; 61 40 } … … 80 59 return NAME; 81 60 } 61 /** =========== end of function ====================== */ -
src/Actions/CommandAction/VersionAction.hpp
r53d01c r1fd675 10 10 11 11 #include "Actions/Action.hpp" 12 #include "version.h"13 12 14 void CommandVersion(); 15 16 class CommandVersionAction : public Action { 17 friend void CommandVersion(); 18 19 public: 20 CommandVersionAction(); 21 virtual ~CommandVersionAction(); 22 23 bool canUndo(); 24 bool shouldUndo(); 25 26 virtual const std::string getName(); 27 protected: 28 virtual Dialog * fillDialog(Dialog *dialog); 29 private: 30 virtual void getParametersfromValueStorage(); 31 virtual Action::state_ptr performCall(); 32 virtual Action::state_ptr performUndo(Action::state_ptr); 33 virtual Action::state_ptr performRedo(Action::state_ptr); 34 35 static const char NAME[]; 36 }; 13 #include "VersionAction.def" 14 #include "Action_impl_header.hpp" 37 15 38 16 #endif /* VERSIONACTION_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.