Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/CmdAction/VersionAction.cpp

    r623e89 r047878  
    66 */
    77
     8#include "Helpers/MemDebug.hpp"
     9
    810#include "Actions/CmdAction/VersionAction.hpp"
     11#include "Actions/ActionRegistry.hpp"
    912
    1013#include <iostream>
     
    1518#include "UIElements/UIFactory.hpp"
    1619#include "UIElements/Dialog.hpp"
    17 #include "Actions/MapOfActions.hpp"
     20#include "UIElements/ValueStorage.hpp"
    1821
    1922const char CommandLineVersionAction::NAME[] = "version";
     
    2629{}
    2730
    28 Action::state_ptr CommandLineVersionAction::performCall() {
    29   Dialog *dialog = UIFactory::getInstance().makeDialog();
     31void CommandVersion() {
     32  ActionRegistry::getInstance().getActionByName(CommandLineVersionAction::NAME)->call(Action::NonInteractive);
     33};
     34
     35Dialog* CommandLineVersionAction::fillDialog(Dialog *dialog) {
     36  ASSERT(dialog,"No Dialog given when filling action dialog");
    3037
    3138  dialog->queryEmpty(NAME, ESPACKVersion);
    3239
    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
     43Action::state_ptr CommandLineVersionAction::performCall() {
     44  return Action::success;
    4045}
    4146
    4247Action::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;
    5049}
    5150
    5251Action::state_ptr CommandLineVersionAction::performRedo(Action::state_ptr _state){
    53   return Action::failure;
     52  return Action::success;
    5453}
    5554
    5655bool CommandLineVersionAction::canUndo() {
    57   return false;
     56  return true;
    5857}
    5958
    6059bool CommandLineVersionAction::shouldUndo() {
    61   return false;
     60  return true;
    6261}
    6362
Note: See TracChangeset for help on using the changeset viewer.