Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AtomAction/ChangeElementAction.cpp

    r54b953 r112b09  
    66 */
    77
     8#include "Helpers/MemDebug.hpp"
     9
    810#include "Actions/AtomAction/ChangeElementAction.hpp"
     11#include "CommandLineParser.hpp"
    912#include "atom.hpp"
    1013#include "log.hpp"
     
    3336Action::state_ptr AtomChangeElementAction::performCall() {
    3437  Dialog *dialog = UIFactory::getInstance().makeDialog();
     38  int Z = -1;
    3539  atom *first = NULL;
    36   std::vector<element *> elements;
     40  element *elemental = NULL;
    3741
    38   dialog->queryAtom(NAME, &first, MapOfActions::getInstance().getDescription(NAME));
    39   dialog->queryElement("element", &elements, MapOfActions::getInstance().getDescription("element"));
     42  dialog->queryElement(NAME, (const element **) &elemental, MapOfActions::getInstance().getDescription(NAME));
     43  dialog->queryAtom("atom-by-id", &first, MapOfActions::getInstance().getDescription("atom-by-id"));
    4044
    4145  if(dialog->display()) {
    4246    delete dialog;
    43     ASSERT(elements.size() == 1, "Unequal to one element specified when changing an atom's element");
    44     ASSERT(first != NULL, "No valid atom specified");
    45     DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elements.at(0) << "." << endl);
    46     if (elements.at(0) != NULL) {
    47       first->type = elements.at(0);
     47    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental << "." << endl);
     48    if (elemental != NULL) {
     49      first->type = elemental;
    4850      return Action::success;
    4951    } else
Note: See TracChangeset for help on using the changeset viewer.