Changeset 852ea3 for src/UIElements


Ignore:
Timestamp:
Aug 27, 2012, 11:36:59 AM (13 years ago)
Author:
Michael Ankele <ankele@…>
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, Candidate_v1.7.0, 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:
7e6a1b
Parents:
1c55b8
git-author:
Michael Ankele <ankele@…> (08/16/12 15:38:10)
git-committer:
Michael Ankele <ankele@…> (08/27/12 11:36:59)
Message:

further query merging (QtQuery added, handle() won't use param.set())

Location:
src/UIElements
Files:
65 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp

    r1c55b8 r852ea3  
    4343  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    4444    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
    45     param.set(World::getInstance().getAtom(AtomById(IdxOfAtom)));
     45    temp = World::getInstance().getAtom(AtomById(IdxOfAtom));
    4646    return true;
    4747  } else {
  • src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp

    r1c55b8 r852ea3  
    4444        temp.push_back(temp_element);
    4545    }
    46     param.set(temp);
    4746    return true;
    4847  } else {
  • src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::BooleanCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as<bool>());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as<bool>();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3434bool CommandLineDialog::DoubleCommandLineQuery::handle() {
    3535  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    36     param.set(CommandLineParser::getInstance().vm[getTitle()].as<double>());
     36    temp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
    3737    return true;
    3838  } else {
  • src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::DoublesCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp

    r1c55b8 r852ea3  
    4040  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    4141    int Z = CommandLineParser::getInstance().vm[getTitle()].as< int >();
    42     param.set(periode->FindElement(Z));
    43     ASSERT(param.get() != NULL, "Invalid element specified in ElementCommandLineQuery");
     42    temp = periode->FindElement(Z);
     43    ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery");
    4444    return true;
    4545  } else {
  • src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp

    r1c55b8 r852ea3  
    4646      temp.push_back(temp_element);
    4747    }
    48     param.set(temp);
    4948    return true;
    5049  } else {
  • src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::FileCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/FilesCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::FilesCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<boost::filesystem::path> >());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<boost::filesystem::path> >();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::IntCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as<int>());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::IntsCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3838  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    3939    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
    40     param.set(World::getInstance().getMolecule(MoleculeById(IdxOfMol)));
     40    temp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
    4141    return true;
    4242  } else {
  • src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp

    r1c55b8 r852ea3  
    4444        temp.push_back(temp_element);
    4545    }
    46     param.set(temp);
    4746    return true;
    4847  } else {
  • src/UIElements/CommandLineUI/Query/RandomNumberDistribution_ParametersCommandLineQuery.cpp

    r1c55b8 r852ea3  
    4343//    LOG(1, "INFO: Parameter set from CommandLine is '" << text.str() << "'");
    4444    text >> temp;
    45     param.set(temp);
    4645    return true;
    4746  } else {
  • src/UIElements/CommandLineUI/Query/RealSpaceMatrixCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3838  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    3939    _temp = CommandLineParser::getInstance().vm[getTitle()].as< RealSpaceMatrixValue >();
    40     param.set(_temp.toRealSpaceMatrix());
     40    temp = _temp.toRealSpaceMatrix();
    4141    return true;
    4242  } else {
  • src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::StringCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as<string>());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::StringsCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::UnsignedIntCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as<unsigned int>());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as<unsigned int>();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/UnsignedIntsCommandLineQuery.cpp

    r1c55b8 r852ea3  
    3333bool CommandLineDialog::UnsignedIntsCommandLineQuery::handle() {
    3434  if (CommandLineParser::getInstance().vm.count(getTitle())) {
    35     param.set(CommandLineParser::getInstance().vm[getTitle()].as< std::vector<unsigned int> >());
     35    temp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<unsigned int> >();
    3636    return true;
    3737  } else {
  • src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp

    r1c55b8 r852ea3  
    4141    _temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
    4242    temp = _temp.toVector();
    43     param.set(temp);
    4443    return true;
    4544  } else {
  • src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp

    r1c55b8 r852ea3  
    4444      temp.push_back(temp_element);
    4545    }
    46     param.set(temp);
    4746    return true;
    4847  } else {
  • src/UIElements/Dialog.cpp

    r1c55b8 r852ea3  
    5252
    5353bool Dialog::display(){
     54  handleAll();
    5455  if(checkAll()){
    5556    setAll();
     
    6162}
    6263
     64void Dialog::handleAll(){
     65  list<Query*>::iterator iter;
     66  for(iter=queries.begin(); iter!=queries.end(); iter++){
     67    try{
     68      (*iter)->handle();
     69    }catch(...){
     70    // if any query fails (is canceled), we can end the handling process
     71      ELOG(1, "The following query failed: " << (**iter).getTitle() << ".");
     72      break;
     73    }
     74  }
     75}
     76
    6377bool Dialog::checkAll(){
    6478  list<Query*>::iterator iter;
    6579  bool retval = true;
    6680  for(iter=queries.begin(); iter!=queries.end(); iter++){
    67     try {
    68       retval &= (*iter)->handle();
    69     } catch (ParameterException &e) {
    70       if( const std::string *name=boost::get_error_info<ParameterName>(e) )
    71         ELOG(1, "The following parameter value is not valid: " << *name << ".");
    72       retval = false;
    73       break;
    74     }
     81    retval &= (*iter)->isValid();
    7582    // if any query fails (is canceled), we can end the handling process
    7683    if(!retval) {
  • src/UIElements/Dialog.hpp

    r1c55b8 r852ea3  
    156156  virtual ~Dialog();
    157157
    158   // Used as type for empty queries.
    159   //class EmptyType{};
    160 
    161158  template <class T> void query(Parameter<T> &, const char *, std::string = "");
    162159
     
    186183  virtual bool display();
    187184
     185  virtual void handleAll();
    188186  virtual bool checkAll();
    189187  virtual void setAll();
     
    250248    virtual ~Query();
    251249    virtual bool handle()=0;
     250    virtual bool isValid()=0;
    252251    virtual void setResult()=0;
    253252  protected:
     
    267266    virtual ~TQuery(){}
    268267    virtual bool handle()=0;
    269     virtual void setResult(){}
     268    virtual bool isValid(){ return param.isValid(temp);  }
     269    virtual void setResult(){ param.set(temp);  }
    270270  protected:
    271271    T temp;
     
    279279    virtual ~EmptyQuery();
    280280    virtual bool handle()=0;
     281    virtual bool isValid(){ return true;  }
    281282    virtual void setResult();
    282283  };
  • src/UIElements/Qt4/Query/AtomQtQuery.cpp

    r1c55b8 r852ea3  
    3030
    3131QtDialog::AtomQtQuery::AtomQtQuery(Parameter<const atom *> &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    32     Dialog::TQuery<const atom *>(_param, _title),
     32    QtQuery<const atom *>(_param, _title),
    3333    parent(_parent),
    3434    dialog(_dialog)
     
    6161}
    6262
    63 bool QtDialog::AtomQtQuery::handle() {
    64   if (param.isValid(temp)){
    65     param.set(temp);
    66     return true;
    67   }
    68   return false;
    69 }
    7063
    71 
  • src/UIElements/Qt4/Query/AtomsQtQuery.cpp

    r1c55b8 r852ea3  
    2929
    3030QtDialog::AtomsQtQuery::AtomsQtQuery(Parameter<std::vector<const atom *> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    31     Dialog::TQuery<std::vector<const atom *> >(_param, _title),
     31    QtQuery<std::vector<const atom *> >(_param, _title),
    3232    QtQueryList<const atom *>(_parent, _dialog, temp)
    3333{
     
    6363}
    6464
    65 bool QtDialog::AtomsQtQuery::handle()
    66 {
    67   if (param.isValid(temp)){
    68     param.set(temp);
    69     return true;
    70   }
    71   return false;
    72 }
    7365
    7466
    75 
  • src/UIElements/Qt4/Query/BooleanQtQuery.cpp

    r1c55b8 r852ea3  
    2828
    2929QtDialog::BooleanQtQuery::BooleanQtQuery(Parameter<bool> &_param, std::string _title, QBoxLayout *_parent, Dialog *_dialog) :
    30     Dialog::TQuery<bool>(_param, _title),
     30    QtQuery<bool>(_param, _title),
    3131    parent(_parent),
    3232    dialog(_dialog)
     
    5656}
    5757
    58 bool QtDialog::BooleanQtQuery::handle(){
    59   if (param.isValid(temp)){
    60     param.set(temp);
    61     return true;
    62   }
    63   return false;
    64 }
    6558
    66 
  • src/UIElements/Qt4/Query/DoubleQtQuery.cpp

    r1c55b8 r852ea3  
    2828
    2929QtDialog::DoubleQtQuery::DoubleQtQuery(Parameter<double> &_param, std::string title,QBoxLayout *_parent,Dialog *_dialog) :
    30     Dialog::TQuery<double>(_param, title),
     30    QtQuery<double>(_param, title),
    3131    parent(_parent),
    3232    dialog(_dialog)
     
    5050QtDialog::DoubleQtQuery::~DoubleQtQuery()
    5151{
    52   //delete pipe;
    5352}
    5453
     
    5857}
    5958
    60 bool QtDialog::DoubleQtQuery::handle() {
    61   if (param.isValid(temp)){
    62     param.set(temp);
    63     return true;
    64   }
    65   return false;
    66 }
    6759
    68 
  • src/UIElements/Qt4/Query/DoublesQtQuery.cpp

    r1c55b8 r852ea3  
    2929
    3030QtDialog::DoublesQtQuery::DoublesQtQuery(Parameter<std::vector<double> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    31     Dialog::TQuery<std::vector<double> >(_param, _title),
     31    QtQuery<std::vector<double> >(_param, _title),
    3232    QtQueryList<double>(_parent, _dialog, temp)
    3333{
     
    6363}
    6464
    65 bool QtDialog::DoublesQtQuery::handle()
    66 {
    67   if (param.isValid(temp)){
    68     param.set(temp);
    69     return true;
    70   }
    71   return false;
    72 }
    7365
    7466
    75 
  • src/UIElements/Qt4/Query/ElementQtQuery.cpp

    r1c55b8 r852ea3  
    3131
    3232QtDialog::ElementQtQuery::ElementQtQuery(Parameter<const element *> &_param, std::string _title, QBoxLayout *_parent, Dialog *_dialog) :
    33     Dialog::TQuery<const element *>(_param, _title),
     33    QtQuery<const element *>(_param, _title),
    3434    parent(_parent),
    3535    dialog(_dialog)
     
    6666}
    6767
    68 bool QtDialog::ElementQtQuery::handle(){
    69   if (param.isValid(temp)){
    70     param.set(temp);
    71     return true;
    72   }
    73   return false;
    74 }
    7568
    76 
  • src/UIElements/Qt4/Query/ElementsQtQuery.cpp

    r1c55b8 r852ea3  
    3030
    3131QtDialog::ElementsQtQuery::ElementsQtQuery(Parameter<std::vector<const element *> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    32     Dialog::TQuery<std::vector<const element *> >(_param, _title),
     32    QtQuery<std::vector<const element *> >(_param, _title),
    3333    QtQueryList<const element *>(_parent, _dialog, temp)
    3434{
     
    6464}
    6565
    66 bool QtDialog::ElementsQtQuery::handle()
    67 {
    68   if (param.isValid(temp)){
    69     param.set(temp);
    70     return true;
    71   }
    72   return false;
    73 }
    7466
    75 
  • src/UIElements/Qt4/Query/FileQtQuery.cpp

    r1c55b8 r852ea3  
    3030
    3131QtDialog::FileQtQuery::FileQtQuery(Parameter<boost::filesystem::path> &_param, std::string _title, QBoxLayout *_parent, Dialog *_dialog) :
    32     Dialog::TQuery<boost::filesystem::path>(_param, _title),
     32    QtQuery<boost::filesystem::path>(_param, _title),
    3333    parent(_parent),
    3434    dialog(_dialog)
     
    8282}
    8383
    84 bool QtDialog::FileQtQuery::handle(){
    85   if (param.isValid(temp)){
    86     param.set(temp);
    87     return true;
    88   }
    89   return false;
    90 }
    91 
  • src/UIElements/Qt4/Query/FilesQtQuery.cpp

    r1c55b8 r852ea3  
    3030
    3131QtDialog::FilesQtQuery::FilesQtQuery(Parameter<std::vector<boost::filesystem::path> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    32     Dialog::TQuery<std::vector<boost::filesystem::path> >(_param, _title),
     32    QtQuery<std::vector<boost::filesystem::path> >(_param, _title),
    3333    QtQueryList<boost::filesystem::path>(_parent, _dialog, temp)
    3434{
     
    6464}
    6565
    66 bool QtDialog::FilesQtQuery::handle()
    67 {
    68   if (param.isValid(temp)){
    69     param.set(temp);
    70     return true;
    71   }
    72   return false;
    73 }
    7466
    75 
  • src/UIElements/Qt4/Query/IntQtQuery.cpp

    r1c55b8 r852ea3  
    2828
    2929QtDialog::IntQtQuery::IntQtQuery(Parameter<int> &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    30     Dialog::TQuery<int>(_param, _title),
     30    QtQuery<int>(_param, _title),
    3131    parent(_parent),
    3232    dialog(_dialog)
     
    5555}
    5656
    57 bool QtDialog::IntQtQuery::handle() {
    58   if (param.isValid(temp)){
    59     param.set(temp);
    60     return true;
    61   }
    62   return false;
    63 }
    64 
  • src/UIElements/Qt4/Query/IntsQtQuery.cpp

    r1c55b8 r852ea3  
    2929
    3030QtDialog::IntsQtQuery::IntsQtQuery(Parameter<std::vector<int> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    31     Dialog::TQuery<std::vector<int> >(_param, _title),
     31    QtQuery<std::vector<int> >(_param, _title),
    3232    QtQueryList<int>(_parent, _dialog, temp)
    3333{
     
    6363}
    6464
    65 bool QtDialog::IntsQtQuery::handle()
    66 {
    67   if (param.isValid(temp)){
    68     param.set(temp);
    69     return true;
    70   }
    71   return false;
    72 }
    7365
    7466
    75 
  • src/UIElements/Qt4/Query/MoleculeQtQuery.cpp

    r1c55b8 r852ea3  
    3131
    3232QtDialog::MoleculeQtQuery::MoleculeQtQuery(Parameter<const molecule *> &_param, std::string _title, QBoxLayout *_parent,Dialog *_dialog) :
    33     Dialog::TQuery<const molecule *>(_param, _title),
     33    QtQuery<const molecule *>(_param, _title),
    3434    parent(_parent),
    3535    dialog(_dialog)
     
    6565}
    6666
    67 // Handling is easy, since the GUI makes it impossible to select invalid values
    68 bool QtDialog::MoleculeQtQuery::handle()
    69 {
    70   if (param.isValid(temp)){
    71     param.set(temp);
    72     return true;
    73   }
    74   return false;
    75 }
    76 
  • src/UIElements/Qt4/Query/MoleculesQtQuery.cpp

    r1c55b8 r852ea3  
    2929
    3030QtDialog::MoleculesQtQuery::MoleculesQtQuery(Parameter<std::vector<const molecule *> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    31     Dialog::TQuery<std::vector<const molecule *> >(_param, _title),
     31    QtQuery<std::vector<const molecule *> >(_param, _title),
    3232    QtQueryList<const molecule *>(_parent, _dialog, temp)
    3333{
     
    6363}
    6464
    65 bool QtDialog::MoleculesQtQuery::handle()
    66 {
    67   if (param.isValid(temp)){
    68     param.set(temp);
    69     return true;
    70   }
    71   return false;
    72 }
    7365
    7466
    75 
  • src/UIElements/Qt4/Query/QtQuery.hpp

    r1c55b8 r852ea3  
    3535class QFileDialog;
    3636
    37 class QtDialog::AtomQtQuery : public QWidget, public Dialog::TQuery<const atom *> {
     37template<class T>
     38class QtQuery : public Dialog::TQuery<T>
     39{
     40public:
     41  QtQuery(Parameter<T> &_param, std::string title, std::string _description = "") :
     42    Dialog::TQuery<T>(_param, title, _description) {}
     43  // QtQueries are interactive - no need for handle().
     44  virtual bool handle(){  return true;  }
     45};
     46
     47class QtDialog::AtomQtQuery : public QWidget, public QtQuery<const atom *> {
    3848  Q_OBJECT
    3949public:
    4050  AtomQtQuery(Parameter<const atom *> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    4151  virtual ~AtomQtQuery();
    42   virtual bool handle();
    4352
    4453public slots:
     
    5362};
    5463
    55 class QtDialog::AtomsQtQuery : public QWidget, public Dialog::TQuery<std::vector<const atom *> >, public QtQueryList<const atom *> {
     64class QtDialog::AtomsQtQuery : public QWidget, public QtQuery<std::vector<const atom *> >, public QtQueryList<const atom *> {
    5665  Q_OBJECT
    5766public:
    5867  AtomsQtQuery(Parameter<std::vector<const atom *> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    5968  virtual ~AtomsQtQuery();
    60   virtual bool handle();
    6169
    6270  virtual void onSubUpdate();
     
    7179};
    7280
    73 class QtDialog::BooleanQtQuery : public QWidget, public Dialog::TQuery<bool> {
     81class QtDialog::BooleanQtQuery : public QWidget, public QtQuery<bool> {
    7482  Q_OBJECT
    7583public:
    7684  BooleanQtQuery(Parameter<bool> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog);
    7785  virtual ~BooleanQtQuery();
    78   virtual bool handle();
    7986
    8087public slots:
     
    8996};
    9097
    91 class QtDialog::RealSpaceMatrixQtQuery : public QWidget, public Dialog::TQuery<RealSpaceMatrix> {
     98class QtDialog::RealSpaceMatrixQtQuery : public QWidget, public QtQuery<RealSpaceMatrix> {
    9299  Q_OBJECT
    93100public:
    94101  RealSpaceMatrixQtQuery(Parameter<RealSpaceMatrix> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    95102  virtual ~RealSpaceMatrixQtQuery();
    96   virtual bool handle();
    97103
    98104public slots:
     
    107113};
    108114
    109 class QtDialog::DoubleQtQuery : public QWidget, public Dialog::TQuery<double> {
     115class QtDialog::DoubleQtQuery : public QWidget, public QtQuery<double> {
    110116  Q_OBJECT
    111117public:
    112118  DoubleQtQuery(Parameter<double> &, std::string title,QBoxLayout *_parent,Dialog *_dialog);
    113119  virtual ~DoubleQtQuery();
    114   virtual bool handle();
    115120
    116121public slots:
     
    125130};
    126131
    127 class QtDialog::DoublesQtQuery : public QWidget, public Dialog::TQuery<std::vector<double> >, public QtQueryList<double> {
     132class QtDialog::DoublesQtQuery : public QWidget, public QtQuery<std::vector<double> >, public QtQueryList<double> {
    128133  Q_OBJECT
    129134public:
    130135  DoublesQtQuery(Parameter<std::vector<double> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    131136  virtual ~DoublesQtQuery();
    132   virtual bool handle();
    133137
    134138  virtual void onSubUpdate();
     
    143147};
    144148
    145 class QtDialog::ElementQtQuery : public QWidget, public Dialog::TQuery<const element *> {
     149class QtDialog::ElementQtQuery : public QWidget, public QtQuery<const element *> {
    146150  Q_OBJECT
    147151public:
    148152  ElementQtQuery(Parameter<const element *> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog);
    149153  virtual ~ElementQtQuery();
    150   virtual bool handle();
    151154
    152155public slots:
     
    161164};
    162165
    163 class QtDialog::ElementsQtQuery : public QWidget, public Dialog::TQuery<std::vector<const element *> >, public QtQueryList<const element *> {
     166class QtDialog::ElementsQtQuery : public QWidget, public QtQuery<std::vector<const element *> >, public QtQueryList<const element *> {
    164167  Q_OBJECT
    165168public:
    166169  ElementsQtQuery(Parameter<std::vector<const element *> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    167170  virtual ~ElementsQtQuery();
    168   virtual bool handle();
    169171
    170172  virtual void onSubUpdate();
     
    191193};
    192194
    193 class QtDialog::FileQtQuery : public QWidget, public Dialog::TQuery<boost::filesystem::path> {
     195class QtDialog::FileQtQuery : public QWidget, public QtQuery<boost::filesystem::path> {
    194196  Q_OBJECT
    195197public:
    196198  FileQtQuery(Parameter<boost::filesystem::path> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog);
    197199  virtual ~FileQtQuery();
    198   virtual bool handle();
    199200
    200201public slots:
     
    212213};
    213214
    214 class QtDialog::FilesQtQuery : public QWidget, public Dialog::TQuery<std::vector<boost::filesystem::path> >, public QtQueryList<boost::filesystem::path> {
     215class QtDialog::FilesQtQuery : public QWidget, public QtQuery<std::vector<boost::filesystem::path> >, public QtQueryList<boost::filesystem::path> {
    215216  Q_OBJECT
    216217public:
    217218  FilesQtQuery(Parameter<std::vector<boost::filesystem::path> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    218219  virtual ~FilesQtQuery();
    219   virtual bool handle();
    220220
    221221  virtual void onSubUpdate();
     
    230230};
    231231
    232 class QtDialog::IntQtQuery : public QWidget, public Dialog::TQuery<int> {
     232class QtDialog::IntQtQuery : public QWidget, public QtQuery<int> {
    233233  Q_OBJECT
    234234public:
    235235  IntQtQuery(Parameter<int> &, std::string _title,QBoxLayout *_parent,Dialog *_dialog);
    236236  virtual ~IntQtQuery();
    237   virtual bool handle();
    238237
    239238public slots:
     
    248247};
    249248
    250 class QtDialog::IntsQtQuery : public QWidget, public Dialog::TQuery<std::vector<int> >, public QtQueryList<int> {
     249class QtDialog::IntsQtQuery : public QWidget, public QtQuery<std::vector<int> >, public QtQueryList<int> {
    251250  Q_OBJECT
    252251public:
    253252  IntsQtQuery(Parameter<std::vector<int> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    254253  virtual ~IntsQtQuery();
    255   virtual bool handle();
    256254
    257255  virtual void onSubUpdate();
     
    266264};
    267265
    268 class QtDialog::MoleculeQtQuery : public QWidget, public Dialog::TQuery<const molecule *> {
     266class QtDialog::MoleculeQtQuery : public QWidget, public QtQuery<const molecule *> {
    269267  Q_OBJECT
    270268public:
    271269  MoleculeQtQuery(Parameter<const molecule *> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    272270  virtual ~MoleculeQtQuery();
    273   virtual bool handle();
    274271
    275272public slots:
     
    284281};
    285282
    286 class QtDialog::MoleculesQtQuery : public QWidget, public Dialog::TQuery<std::vector<const molecule *> >, public QtQueryList<const molecule *> {
     283class QtDialog::MoleculesQtQuery : public QWidget, public QtQuery<std::vector<const molecule *> >, public QtQueryList<const molecule *> {
    287284  Q_OBJECT
    288285public:
    289286  MoleculesQtQuery(Parameter<std::vector<const molecule *> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    290287  virtual ~MoleculesQtQuery();
    291   virtual bool handle();
    292288
    293289  virtual void onSubUpdate();
     
    302298};
    303299
    304 class QtDialog::StringQtQuery : public QWidget, public Dialog::TQuery<std::string> {
     300class QtDialog::StringQtQuery : public QWidget, public QtQuery<std::string> {
    305301  Q_OBJECT
    306302public:
    307303  StringQtQuery(Parameter<std::string> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    308304  virtual ~StringQtQuery();
    309   virtual bool handle();
    310305
    311306public slots:
     
    320315};
    321316
    322 class QtDialog::StringsQtQuery : public QWidget, public Dialog::TQuery<std::vector<std::string> >, public QtQueryList<std::string> {
     317class QtDialog::StringsQtQuery : public QWidget, public QtQuery<std::vector<std::string> >, public QtQueryList<std::string> {
    323318  Q_OBJECT
    324319public:
    325320  StringsQtQuery(Parameter<std::vector<std::string> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    326321  virtual ~StringsQtQuery();
    327   virtual bool handle();
    328322
    329323  virtual void onSubUpdate();
     
    338332};
    339333
    340 class QtDialog::UnsignedIntQtQuery : public QWidget, public Dialog::TQuery<unsigned int> {
     334class QtDialog::UnsignedIntQtQuery : public QWidget, public QtQuery<unsigned int> {
    341335  Q_OBJECT
    342336public:
    343337  UnsignedIntQtQuery(Parameter<unsigned int> &, std::string _title,QBoxLayout *_parent,Dialog *_dialog);
    344338  virtual ~UnsignedIntQtQuery();
    345   virtual bool handle();
    346339
    347340public slots:
     
    356349};
    357350
    358 class QtDialog::UnsignedIntsQtQuery : public QWidget, public Dialog::TQuery<std::vector<unsigned int> >, public QtQueryList<unsigned int> {
     351class QtDialog::UnsignedIntsQtQuery : public QWidget, public QtQuery<std::vector<unsigned int> >, public QtQueryList<unsigned int> {
    359352  Q_OBJECT
    360353public:
    361354  UnsignedIntsQtQuery(Parameter<std::vector<unsigned int> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    362355  virtual ~UnsignedIntsQtQuery();
    363   virtual bool handle();
    364356
    365357  virtual void onSubUpdate();
     
    374366};
    375367
    376 class QtDialog::VectorQtQuery : public QWidget, public Dialog::TQuery<Vector> {
     368class QtDialog::VectorQtQuery : public QWidget, public QtQuery<Vector> {
    377369  Q_OBJECT
    378370public:
    379371  VectorQtQuery(Parameter<Vector> &, std::string title,QBoxLayout *,Dialog *);
    380372  virtual ~VectorQtQuery();
    381   virtual bool handle();
    382373
    383374public slots:
     
    399390};
    400391
    401 class QtDialog::VectorsQtQuery : public QWidget, public Dialog::TQuery<std::vector<Vector> >, public QtQueryList<Vector> {
     392class QtDialog::VectorsQtQuery : public QWidget, public QtQuery<std::vector<Vector> >, public QtQueryList<Vector> {
    402393  Q_OBJECT
    403394public:
    404395  VectorsQtQuery(Parameter<std::vector<Vector> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
    405396  virtual ~VectorsQtQuery();
    406   virtual bool handle();
    407397
    408398  virtual void onSubUpdate();
     
    417407};
    418408
    419 class QtDialog::RandomNumberDistribution_ParametersQtQuery : public QWidget, public Dialog::TQuery<RandomNumberDistribution_Parameters> {
     409class QtDialog::RandomNumberDistribution_ParametersQtQuery : public QWidget, public QtQuery<RandomNumberDistribution_Parameters> {
    420410  Q_OBJECT
    421411public:
    422412  RandomNumberDistribution_ParametersQtQuery(Parameter<RandomNumberDistribution_Parameters> &, std::string title,QBoxLayout *,Dialog *);
    423413  virtual ~RandomNumberDistribution_ParametersQtQuery();
    424   virtual bool handle();
    425414
    426415public slots:
  • src/UIElements/Qt4/Query/RandomNumberDistribution_ParametersQtQuery.cpp

    r1c55b8 r852ea3  
    3131
    3232QtDialog::RandomNumberDistribution_ParametersQtQuery::RandomNumberDistribution_ParametersQtQuery(Parameter<RandomNumberDistribution_Parameters> &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    33     Dialog::TQuery<RandomNumberDistribution_Parameters>(_param, _title),
     33    QtQuery<RandomNumberDistribution_Parameters>(_param, _title),
    3434    parent(_parent),
    3535    dialog(_dialog)
     
    6565}
    6666
    67 bool QtDialog::RandomNumberDistribution_ParametersQtQuery::handle() {
    68   if (param.isValid(temp)){
    69     param.set(temp);
    70     return true;
    71   }
    72   return false;
    73 }
    7467
    75 
  • src/UIElements/Qt4/Query/RealSpaceMatrixQtQuery.cpp

    r1c55b8 r852ea3  
    3030
    3131QtDialog::RealSpaceMatrixQtQuery::RealSpaceMatrixQtQuery(Parameter<RealSpaceMatrix> &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    32     Dialog::TQuery<RealSpaceMatrix>(_param, _title),
     32    QtQuery<RealSpaceMatrix>(_param, _title),
    3333    parent(_parent),
    3434    dialog(_dialog)
     
    7070}
    7171
    72 bool QtDialog::RealSpaceMatrixQtQuery::handle() {
    73   if (param.isValid(temp)){
    74     param.set(temp);
    75     return true;
    76   }
    77   return false;
    78 }
    7972
    80 
  • src/UIElements/Qt4/Query/StringQtQuery.cpp

    r1c55b8 r852ea3  
    2828
    2929QtDialog::StringQtQuery::StringQtQuery(Parameter<std::string> &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    30     Dialog::TQuery<std::string>(_param, _title),
     30    QtQuery<std::string>(_param, _title),
    3131    parent(_parent),
    3232    dialog(_dialog)
     
    5555}
    5656
    57 // All values besides the empty std::string are valid
    58 bool QtDialog::StringQtQuery::handle()
    59 {
    60   if (temp != "")
    61     if (param.isValid(temp)){
    62       param.set(temp);
    63       return true;
    64     }
    65   return false;
    66 }
    67 
  • src/UIElements/Qt4/Query/StringsQtQuery.cpp

    r1c55b8 r852ea3  
    2929
    3030QtDialog::StringsQtQuery::StringsQtQuery(Parameter<std::vector<std::string> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    31     Dialog::TQuery<std::vector<std::string> >(_param, _title),
     31    QtQuery<std::vector<std::string> >(_param, _title),
    3232    QtQueryList<std::string>(_parent, _dialog, temp)
    3333{
     
    6363}
    6464
    65 // All values besides the empty std::string are valid
    66 bool QtDialog::StringsQtQuery::handle()
    67 {
    68   if (param.isValid(temp)){
    69     param.set(temp);
    70     return true;
    71   }
    72   return false;
    73 }
    74 
  • src/UIElements/Qt4/Query/UnsignedIntQtQuery.cpp

    r1c55b8 r852ea3  
    2828
    2929QtDialog::UnsignedIntQtQuery::UnsignedIntQtQuery(Parameter<unsigned int> &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    30     Dialog::TQuery<unsigned int>(_param, _title),
     30    QtQuery<unsigned int>(_param, _title),
    3131    parent(_parent),
    3232    dialog(_dialog)
     
    5656}
    5757
    58 bool QtDialog::UnsignedIntQtQuery::handle() {
    59   if (param.isValid(temp)){
    60     param.set(temp);
    61     return true;
    62   }
    63   return false;
    64 }
    65 
  • src/UIElements/Qt4/Query/UnsignedIntsQtQuery.cpp

    r1c55b8 r852ea3  
    2929
    3030QtDialog::UnsignedIntsQtQuery::UnsignedIntsQtQuery(Parameter<std::vector<unsigned int> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    31     Dialog::TQuery<std::vector<unsigned int> >(_param, _title),
     31    QtQuery<std::vector<unsigned int> >(_param, _title),
    3232    QtQueryList<unsigned int>(_parent, _dialog, temp)
    3333{
     
    6363}
    6464
    65 bool QtDialog::UnsignedIntsQtQuery::handle()
    66 {
    67   if (param.isValid(temp)){
    68     param.set(temp);
    69     return true;
    70   }
    71   return false;
    72 }
    7365
    7466
    75 
  • src/UIElements/Qt4/Query/VectorQtQuery.cpp

    r1c55b8 r852ea3  
    2929
    3030QtDialog::VectorQtQuery::VectorQtQuery(Parameter<Vector> &_param, std::string title, QBoxLayout *_parent,Dialog *_dialog) :
    31     Dialog::TQuery<Vector>(_param, title),
     31    QtQuery<Vector>(_param, title),
    3232    parent(_parent),
    3333    dialog(_dialog)
     
    8888}
    8989
    90 bool QtDialog::VectorQtQuery::handle() {
    91   if (param.isValid(temp)){
    92     param.set(temp);
    93     return true;
    94   }
    95   return false;
    96 }
    9790
    98 
  • src/UIElements/Qt4/Query/VectorsQtQuery.cpp

    r1c55b8 r852ea3  
    3030
    3131QtDialog::VectorsQtQuery::VectorsQtQuery(Parameter<std::vector<Vector> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
    32     Dialog::TQuery<std::vector<Vector> >(_param, _title),
     32    QtQuery<std::vector<Vector> >(_param, _title),
    3333    QtQueryList<Vector>(_parent, _dialog, temp)
    3434{
     
    6464}
    6565
    66 bool QtDialog::VectorsQtQuery::handle()
    67 {
    68   if (param.isValid(temp)){
    69     param.set(temp);
    70     return true;
    71   }
    72   return false;
    73 }
    7466
    75 
  • src/UIElements/TextUI/Query/AtomTextQuery.cpp

    r1c55b8 r852ea3  
    5555      std::cout << "Invalid Atom Index" << idxOfAtom << std::endl;
    5656      badInput = true;
    57     }else
    58       param.set(temp);
     57    }
    5958
    6059  } while(badInput);
  • src/UIElements/TextUI/Query/AtomsTextQuery.cpp

    r1c55b8 r852ea3  
    6767    }
    6868  }
    69   param.set(temp);
    7069
    7170  return (idxOfAtom!=-1);
  • src/UIElements/TextUI/Query/BooleanTextQuery.cpp

    r1c55b8 r852ea3  
    4242    std::cin >> input;
    4343    if ((input == 'y' ) || (input == 'Y')) {
    44       param.set(true);
     44      temp = true;
    4545    } else if ((input == 'n' ) || (input == 'N')) {
    46       param.set(false);
     46      temp = false;
    4747    } else {
    4848      badInput=true;
  • src/UIElements/TextUI/Query/DoubleTextQuery.cpp

    r1c55b8 r852ea3  
    4545      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    4646      std::cout << "Input was not a number!" << std::endl;
    47     }else
    48       param.set(temp);
     47    }
    4948  }while(badInput);
    5049  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
  • src/UIElements/TextUI/Query/DoublesTextQuery.cpp

    r1c55b8 r852ea3  
    5454    temp.push_back(temp_element);
    5555  }
    56   param.set(temp);
    5756
    5857  return true;
  • src/UIElements/TextUI/Query/ElementsTextQuery.cpp

    r1c55b8 r852ea3  
    8383    }
    8484  }
    85   param.set(temp);
    8685
    8786  return (Z!=-1);
  • src/UIElements/TextUI/Query/FileTextQuery.cpp

    r1c55b8 r852ea3  
    5252  } while(badInput);
    5353  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    54   param.set(temp);
    5554  return true;
    5655}
  • src/UIElements/TextUI/Query/FilesTextQuery.cpp

    r1c55b8 r852ea3  
    3838
    3939bool TextDialog::FilesTextQuery::handle() {
    40   std::vector<boost::filesystem::path> tempfiles;
    4140  bool badInput = false;
    4241  bool continueflag = true;
     
    6160    if (tempstring != "y")
    6261      continueflag = false;
    63     tempfiles.push_back(tempfile);
     62    temp.push_back(tempfile);
    6463  } while(continueflag);
    6564  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    66   param.set(tempfiles);
    6765  return true;
    6866}
  • src/UIElements/TextUI/Query/IntTextQuery.cpp

    r1c55b8 r852ea3  
    4545      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    4646      std::cout << "Input was not a number!" << std::endl;
    47     }else
    48       param.set(temp);
     47    }
    4948  } while(badInput);
    5049  // clear the input buffer of anything still in the line
  • src/UIElements/TextUI/Query/IntsTextQuery.cpp

    r1c55b8 r852ea3  
    5454    temp.push_back(temp_element);
    5555  }
    56   param.set(temp);
    5756
    5857  return true;
  • src/UIElements/TextUI/Query/MoleculeTextQuery.cpp

    r1c55b8 r852ea3  
    5757      badInput = true;
    5858    }
    59     param.set(temp);
    6059
    6160  } while(badInput);
  • src/UIElements/TextUI/Query/MoleculesTextQuery.cpp

    r1c55b8 r852ea3  
    6767    }
    6868  }
    69   param.set(temp);
    7069
    7170  return (idxOfMol!=-1);
  • src/UIElements/TextUI/Query/RandomNumberDistribution_ParametersTextQuery.cpp

    r1c55b8 r852ea3  
    5151      continue;
    5252    }
    53     param.set(temp);
    5453
    5554  } while(badInput);
  • src/UIElements/TextUI/Query/RealSpaceMatrixTextQuery.cpp

    r1c55b8 r852ea3  
    5555  temp.set(2,1, dtemp[4]);
    5656  temp.set(2,2, dtemp[5]);
    57   param.set(temp);
    5857  return true;
    5958}
  • src/UIElements/TextUI/Query/StringTextQuery.cpp

    r1c55b8 r852ea3  
    3737  std::cout << getDescription() << ": ";
    3838  getline(std::cin,temp);
    39   param.set(temp);
    4039  return true;
    4140}
  • src/UIElements/TextUI/Query/StringsTextQuery.cpp

    r1c55b8 r852ea3  
    4848  if (olditer != temp_element.begin())  // insert last part also
    4949    temp.push_back(std::string(olditer, temp_element.end()));
    50   param.set(temp);
    5150
    5251  return true;
  • src/UIElements/TextUI/Query/UnsignedIntTextQuery.cpp

    r1c55b8 r852ea3  
    4545      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    4646      std::cout << "Input was not a number!" << std::endl;
    47     }else
    48       param.set(temp);
     47    }
    4948  } while(badInput);
    5049  // clear the input buffer of anything still in the line
  • src/UIElements/TextUI/Query/UnsignedIntsTextQuery.cpp

    r1c55b8 r852ea3  
    5454    temp.push_back(temp_element);
    5555  }
    56   param.set(temp);
    5756
    5857  return true;
  • src/UIElements/TextUI/Query/VectorTextQuery.cpp

    r1c55b8 r852ea3  
    5454  for(std::string::iterator iter = line.begin(); (iter != line.end()) && (counter != 3); ++iter) {
    5555    if (*iter == ',') {
    56       std::istringstream stream(std::string(iter, olditer));
     56      iter++;
     57      std::istringstream stream(std::string(olditer, iter));
    5758      stream >> coord;
    5859      temp[counter++] = coord;
     
    6566    temp[counter++] = coord;
    6667  }
    67   param.set(temp);
    6868
    6969  // check vector
  • src/UIElements/TextUI/Query/VectorsTextQuery.cpp

    r1c55b8 r852ea3  
    7777    }
    7878  }
    79   param.set(temp);
    8079
    8180  return true;
Note: See TracChangeset for help on using the changeset viewer.