Changeset 07d2cd for molecuilder/src


Ignore:
Timestamp:
May 8, 2010, 10:51:22 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
788eeb
Parents:
ae8b90
Message:

CommandLineWindow::display() goes through all Actions in ActionRegistry.

  • we check whether title of Action can be found in program_options::vm and if so, execute Action.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/UIElements/CommandLineWindow.cpp

    rae8b90 r07d2cd  
    1111#include "UIElements/CommandLineStatusIndicator.hpp"
    1212
     13#include "Actions/ActionRegistry.hpp"
    1314#include "Actions/CmdAction/HelpAction.hpp"
    1415#include "Actions/ParserAction/LoadXyzAction.hpp"
    1516#include "Actions/ParserAction/SaveXyzAction.hpp"
     17#include "CommandLineParser.hpp"
    1618
    1719#include <iostream>
     
    3537
    3638void CommandLineWindow::display() {
     39  // go through all possible actions
     40  for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRunner != ActionRegistry::getInstance().getEndIter(); ActionRunner++) {
     41    // check whether action is present in command line
     42    if (CommandLineParser::getInstance().vm.count(ActionRunner->first)) {
     43      ActionRunner->second->call();
     44    }
     45  }
    3746}
    3847
Note: See TracChangeset for help on using the changeset viewer.