Ignore:
Timestamp:
Aug 28, 2010, 12:57:56 AM (15 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

All Actions are converted to the new macro framework.

  • included all three values that have been used to create or convert the files
    • createdef.sh
    • createCpp.sh
    • createHeader.sh
Location:
src/Actions/CommandAction
Files:
6 added
12 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/CommandAction/BondLengthTableAction.cpp

    r53d01c r1fd675  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "Actions/CommandAction/BondLengthTableAction.hpp"
    23 #include "Actions/ActionRegistry.hpp"
    2422#include "bondgraph.hpp"
    2523#include "config.hpp"
     
    3331using namespace std;
    3432
    35 #include "UIElements/UIFactory.hpp"
    36 #include "UIElements/Dialog.hpp"
    37 #include "Actions/ValueStorage.hpp"
     33#include "Actions/CommandAction/BondLengthTableAction.hpp"
    3834
    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 ====================== */
    6439Action::state_ptr CommandBondLengthTableAction::performCall() {
    6540  ostringstream usage;
    66   string BondGraphFileName;
    6741
    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);
    7046  config *configuration = World::getInstance().getConfig();
    7147  if (configuration->BG == NULL) {
    7248    configuration->BG = new BondGraph(configuration->GetIsAngstroem());
    73     if ((!BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(BondGraphFileName))) {
     49    if ((!params.BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName))) {
    7450      DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    7551      return Action::success;
     
    10985  return NAME;
    11086}
     87/** =========== end of function ====================== */
  • src/Actions/CommandAction/BondLengthTableAction.hpp

    r53d01c r1fd675  
    1111#include "Actions/Action.hpp"
    1212
    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"
    3615
    3716#endif /* BONDLENGTHTABLEACTION_HPP_ */
  • src/Actions/CommandAction/ElementDbAction.cpp

    r53d01c r1fd675  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "Actions/CommandAction/ElementDbAction.hpp"
    23 #include "Actions/ActionRegistry.hpp"
    2422#include "config.hpp"
    2523#include "Helpers/Log.hpp"
     
    3331using namespace std;
    3432
    35 #include "UIElements/UIFactory.hpp"
    36 #include "UIElements/Dialog.hpp"
    37 #include "Actions/ValueStorage.hpp"
     33#include "Actions/CommandAction/ElementDbAction.hpp"
    3834
    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 ====================== */
    6439Action::state_ptr CommandElementDbAction::performCall() {
    6540  ostringstream usage;
    66   string databasepath;
     41
     42  // obtain information
     43  getParametersfromValueStorage();
    6744
    6845  // get the path
    6946  // TODO: Make databasepath a std::string
    7047  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());
    7349
    7450  // load table
     
    11086  return NAME;
    11187}
     88/** =========== end of function ====================== */
  • src/Actions/CommandAction/ElementDbAction.hpp

    r53d01c r1fd675  
    1111#include "Actions/Action.hpp"
    1212
    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"
    3615
    3716#endif /* ELEMENTDBACTION_HPP_ */
  • src/Actions/CommandAction/FastParsingAction.cpp

    r53d01c r1fd675  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "Actions/CommandAction/FastParsingAction.hpp"
    23 #include "Actions/ActionRegistry.hpp"
    2422#include "config.hpp"
    2523#include "Helpers/Log.hpp"
     
    3230using namespace std;
    3331
    34 #include "UIElements/UIFactory.hpp"
    35 #include "UIElements/Dialog.hpp"
    36 #include "Actions/ValueStorage.hpp"
     32#include "Actions/CommandAction/FastParsingAction.hpp"
    3733
    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 ====================== */
    7638Action::state_ptr CommandFastParsingAction::performCall() {
    7739  config *configuration = World::getInstance().getConfig();
    7840  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;
    8246  if (configuration->FastParsing)
    8347    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    8448  else
    8549    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));
    8751}
    8852
     
    10468
    10569  config *configuration = World::getInstance().getConfig();
    106   configuration->FastParsing = state->newvalue;
     70  configuration->FastParsing = state->params.fastparsing;
    10771  if (configuration->FastParsing)
    10872    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
     
    12488  return NAME;
    12589}
     90/** =========== end of function ====================== */
  • src/Actions/CommandAction/FastParsingAction.hpp

    r53d01c r1fd675  
    1111#include "Actions/Action.hpp"
    1212
    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"
    3615
    3716#endif /* FASTPARSINGACTION_HPP_ */
  • src/Actions/CommandAction/HelpAction.cpp

    r53d01c r1fd675  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "Actions/CommandAction/HelpAction.hpp"
    23 #include "Actions/ActionRegistry.hpp"
    2422#include "CommandLineParser.hpp"
    2523
     
    2927using namespace std;
    3028
    31 #include "UIElements/UIFactory.hpp"
    32 #include "UIElements/Dialog.hpp"
    33 #include "Actions/ValueStorage.hpp"
     29#include "Actions/CommandAction/HelpAction.hpp"
    3430
    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 ====================== */
     35Action::state_ptr CommandHelpAction::performCall() {
     36  // obtain information
     37  getParametersfromValueStorage();
    3638
    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() {
    6239  return Action::success;
    6340}
     
    8259  return NAME;
    8360}
     61/** =========== end of function ====================== */
  • src/Actions/CommandAction/HelpAction.hpp

    r53d01c r1fd675  
    1111#include "Actions/Action.hpp"
    1212
    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"
    3615
    3716#endif /* HELPACTION_HPP_ */
  • src/Actions/CommandAction/VerboseAction.cpp

    r53d01c r1fd675  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "Actions/CommandAction/VerboseAction.hpp"
    23 #include "Actions/ActionRegistry.hpp"
    2422#include "Helpers/Log.hpp"
    2523#include "Helpers/Verbose.hpp"
     
    3028using namespace std;
    3129
    32 #include "UIElements/UIFactory.hpp"
    33 #include "UIElements/Dialog.hpp"
    34 #include "Actions/ValueStorage.hpp"
     30#include "Actions/CommandAction/VerboseAction.hpp"
    3531
    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 ====================== */
    7436Action::state_ptr CommandVerboseAction::performCall() {
    7537  int oldverbosity = getVerbosity();
    76   int newverbosity = 2;
    7738
    78   ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity);
     39  // obtain information
     40  getParametersfromValueStorage();
    7941
    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);
    8446    return Action::state_ptr(UndoState);
    8547  } else {
     
    9254  CommandVerboseState *state = assert_cast<CommandVerboseState*>(_state.get());
    9355
    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);
    9557  setVerbosity(state->oldverbosity);
    9658
     
    10163  CommandVerboseState *state = assert_cast<CommandVerboseState*>(_state.get());
    10264
    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);
    10567
    10668  return Action::state_ptr(_state);
     
    11880  return NAME;
    11981}
     82/** =========== end of function ====================== */
  • src/Actions/CommandAction/VerboseAction.hpp

    r53d01c r1fd675  
    1111#include "Actions/Action.hpp"
    1212
    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"
    3615
    3716#endif /* VERBOSEACTION_HPP_ */
  • src/Actions/CommandAction/VersionAction.cpp

    r53d01c r1fd675  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "Actions/CommandAction/VersionAction.hpp"
    23 #include "Actions/ActionRegistry.hpp"
    2422#include "version.h"
    2523
     
    2927using namespace std;
    3028
    31 #include "UIElements/UIFactory.hpp"
    32 #include "UIElements/Dialog.hpp"
    33 #include "Actions/ValueStorage.hpp"
     29#include "Actions/CommandAction/VersionAction.hpp"
    3430
    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 ====================== */
     35Action::state_ptr CommandVersionAction::performCall() {
     36  // obtain information
     37  getParametersfromValueStorage();
    3638
    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() {
    6039  return Action::success;
    6140}
     
    8059  return NAME;
    8160}
     61/** =========== end of function ====================== */
  • src/Actions/CommandAction/VersionAction.hpp

    r53d01c r1fd675  
    1010
    1111#include "Actions/Action.hpp"
    12 #include "version.h"
    1312
    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"
    3715
    3816#endif /* VERSIONACTION_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.