Changeset 852ea3 for src/UIElements
- Timestamp:
- Aug 27, 2012, 11:36:59 AM (13 years ago)
- 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)
- Location:
- src/UIElements
- Files:
-
- 65 edited
-
CommandLineUI/Query/AtomCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/AtomsCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/BooleanCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/DoubleCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/DoublesCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/ElementCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/ElementsCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/FileCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/FilesCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/IntCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/IntsCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/MoleculeCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/MoleculesCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/RandomNumberDistribution_ParametersCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/RealSpaceMatrixCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/StringCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/StringsCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/UnsignedIntsCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/VectorCommandLineQuery.cpp (modified) (1 diff)
-
CommandLineUI/Query/VectorsCommandLineQuery.cpp (modified) (1 diff)
-
Dialog.cpp (modified) (2 diffs)
-
Dialog.hpp (modified) (5 diffs)
-
Qt4/Query/AtomQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/AtomsQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/BooleanQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/DoubleQtQuery.cpp (modified) (3 diffs)
-
Qt4/Query/DoublesQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/ElementQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/ElementsQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/FileQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/FilesQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/IntQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/IntsQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/MoleculeQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/MoleculesQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/QtQuery.hpp (modified) (21 diffs)
-
Qt4/Query/RandomNumberDistribution_ParametersQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/RealSpaceMatrixQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/StringQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/StringsQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/UnsignedIntQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/UnsignedIntsQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/VectorQtQuery.cpp (modified) (2 diffs)
-
Qt4/Query/VectorsQtQuery.cpp (modified) (2 diffs)
-
TextUI/Query/AtomTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/AtomsTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/BooleanTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/DoubleTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/DoublesTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/ElementsTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/FileTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/FilesTextQuery.cpp (modified) (2 diffs)
-
TextUI/Query/IntTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/IntsTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/MoleculeTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/MoleculesTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/RandomNumberDistribution_ParametersTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/RealSpaceMatrixTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/StringTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/StringsTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/UnsignedIntTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/UnsignedIntsTextQuery.cpp (modified) (1 diff)
-
TextUI/Query/VectorTextQuery.cpp (modified) (2 diffs)
-
TextUI/Query/VectorsTextQuery.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
r1c55b8 r852ea3 43 43 if (CommandLineParser::getInstance().vm.count(getTitle())) { 44 44 IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>(); 45 param.set(World::getInstance().getAtom(AtomById(IdxOfAtom)));45 temp = World::getInstance().getAtom(AtomById(IdxOfAtom)); 46 46 return true; 47 47 } else { -
src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
r1c55b8 r852ea3 44 44 temp.push_back(temp_element); 45 45 } 46 param.set(temp);47 46 return true; 48 47 } else { -
src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::BooleanCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 param.set(CommandLineParser::getInstance().vm[getTitle()].as<bool>());35 temp = CommandLineParser::getInstance().vm[getTitle()].as<bool>(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
r1c55b8 r852ea3 34 34 bool CommandLineDialog::DoubleCommandLineQuery::handle() { 35 35 if (CommandLineParser::getInstance().vm.count(getTitle())) { 36 param.set(CommandLineParser::getInstance().vm[getTitle()].as<double>());36 temp = CommandLineParser::getInstance().vm[getTitle()].as<double>(); 37 37 return true; 38 38 } else { -
src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::DoublesCommandLineQuery::handle() { 34 34 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> >(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
r1c55b8 r852ea3 40 40 if (CommandLineParser::getInstance().vm.count(getTitle())) { 41 41 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"); 44 44 return true; 45 45 } else { -
src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
r1c55b8 r852ea3 46 46 temp.push_back(temp_element); 47 47 } 48 param.set(temp);49 48 return true; 50 49 } else { -
src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::FileCommandLineQuery::handle() { 34 34 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 >(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/FilesCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::FilesCommandLineQuery::handle() { 34 34 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> >(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::IntCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 param.set(CommandLineParser::getInstance().vm[getTitle()].as<int>());35 temp = CommandLineParser::getInstance().vm[getTitle()].as<int>(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::IntsCommandLineQuery::handle() { 34 34 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> >(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
r1c55b8 r852ea3 38 38 if (CommandLineParser::getInstance().vm.count(getTitle())) { 39 39 IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>(); 40 param.set(World::getInstance().getMolecule(MoleculeById(IdxOfMol)));40 temp = World::getInstance().getMolecule(MoleculeById(IdxOfMol)); 41 41 return true; 42 42 } else { -
src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
r1c55b8 r852ea3 44 44 temp.push_back(temp_element); 45 45 } 46 param.set(temp);47 46 return true; 48 47 } else { -
src/UIElements/CommandLineUI/Query/RandomNumberDistribution_ParametersCommandLineQuery.cpp
r1c55b8 r852ea3 43 43 // LOG(1, "INFO: Parameter set from CommandLine is '" << text.str() << "'"); 44 44 text >> temp; 45 param.set(temp);46 45 return true; 47 46 } else { -
src/UIElements/CommandLineUI/Query/RealSpaceMatrixCommandLineQuery.cpp
r1c55b8 r852ea3 38 38 if (CommandLineParser::getInstance().vm.count(getTitle())) { 39 39 _temp = CommandLineParser::getInstance().vm[getTitle()].as< RealSpaceMatrixValue >(); 40 param.set(_temp.toRealSpaceMatrix());40 temp = _temp.toRealSpaceMatrix(); 41 41 return true; 42 42 } else { -
src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::StringCommandLineQuery::handle() { 34 34 if (CommandLineParser::getInstance().vm.count(getTitle())) { 35 param.set(CommandLineParser::getInstance().vm[getTitle()].as<string>());35 temp = CommandLineParser::getInstance().vm[getTitle()].as<string>(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::StringsCommandLineQuery::handle() { 34 34 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> >(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/UnsignedIntCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::UnsignedIntCommandLineQuery::handle() { 34 34 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>(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/UnsignedIntsCommandLineQuery.cpp
r1c55b8 r852ea3 33 33 bool CommandLineDialog::UnsignedIntsCommandLineQuery::handle() { 34 34 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> >(); 36 36 return true; 37 37 } else { -
src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
r1c55b8 r852ea3 41 41 _temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >(); 42 42 temp = _temp.toVector(); 43 param.set(temp);44 43 return true; 45 44 } else { -
src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
r1c55b8 r852ea3 44 44 temp.push_back(temp_element); 45 45 } 46 param.set(temp);47 46 return true; 48 47 } else { -
src/UIElements/Dialog.cpp
r1c55b8 r852ea3 52 52 53 53 bool Dialog::display(){ 54 handleAll(); 54 55 if(checkAll()){ 55 56 setAll(); … … 61 62 } 62 63 64 void 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 63 77 bool Dialog::checkAll(){ 64 78 list<Query*>::iterator iter; 65 79 bool retval = true; 66 80 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(); 75 82 // if any query fails (is canceled), we can end the handling process 76 83 if(!retval) { -
src/UIElements/Dialog.hpp
r1c55b8 r852ea3 156 156 virtual ~Dialog(); 157 157 158 // Used as type for empty queries.159 //class EmptyType{};160 161 158 template <class T> void query(Parameter<T> &, const char *, std::string = ""); 162 159 … … 186 183 virtual bool display(); 187 184 185 virtual void handleAll(); 188 186 virtual bool checkAll(); 189 187 virtual void setAll(); … … 250 248 virtual ~Query(); 251 249 virtual bool handle()=0; 250 virtual bool isValid()=0; 252 251 virtual void setResult()=0; 253 252 protected: … … 267 266 virtual ~TQuery(){} 268 267 virtual bool handle()=0; 269 virtual void setResult(){} 268 virtual bool isValid(){ return param.isValid(temp); } 269 virtual void setResult(){ param.set(temp); } 270 270 protected: 271 271 T temp; … … 279 279 virtual ~EmptyQuery(); 280 280 virtual bool handle()=0; 281 virtual bool isValid(){ return true; } 281 282 virtual void setResult(); 282 283 }; -
src/UIElements/Qt4/Query/AtomQtQuery.cpp
r1c55b8 r852ea3 30 30 31 31 QtDialog::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), 33 33 parent(_parent), 34 34 dialog(_dialog) … … 61 61 } 62 62 63 bool QtDialog::AtomQtQuery::handle() {64 if (param.isValid(temp)){65 param.set(temp);66 return true;67 }68 return false;69 }70 63 71 -
src/UIElements/Qt4/Query/AtomsQtQuery.cpp
r1c55b8 r852ea3 29 29 30 30 QtDialog::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), 32 32 QtQueryList<const atom *>(_parent, _dialog, temp) 33 33 { … … 63 63 } 64 64 65 bool QtDialog::AtomsQtQuery::handle()66 {67 if (param.isValid(temp)){68 param.set(temp);69 return true;70 }71 return false;72 }73 65 74 66 75 -
src/UIElements/Qt4/Query/BooleanQtQuery.cpp
r1c55b8 r852ea3 28 28 29 29 QtDialog::BooleanQtQuery::BooleanQtQuery(Parameter<bool> &_param, std::string _title, QBoxLayout *_parent, Dialog *_dialog) : 30 Dialog::TQuery<bool>(_param, _title),30 QtQuery<bool>(_param, _title), 31 31 parent(_parent), 32 32 dialog(_dialog) … … 56 56 } 57 57 58 bool QtDialog::BooleanQtQuery::handle(){59 if (param.isValid(temp)){60 param.set(temp);61 return true;62 }63 return false;64 }65 58 66 -
src/UIElements/Qt4/Query/DoubleQtQuery.cpp
r1c55b8 r852ea3 28 28 29 29 QtDialog::DoubleQtQuery::DoubleQtQuery(Parameter<double> &_param, std::string title,QBoxLayout *_parent,Dialog *_dialog) : 30 Dialog::TQuery<double>(_param, title),30 QtQuery<double>(_param, title), 31 31 parent(_parent), 32 32 dialog(_dialog) … … 50 50 QtDialog::DoubleQtQuery::~DoubleQtQuery() 51 51 { 52 //delete pipe;53 52 } 54 53 … … 58 57 } 59 58 60 bool QtDialog::DoubleQtQuery::handle() {61 if (param.isValid(temp)){62 param.set(temp);63 return true;64 }65 return false;66 }67 59 68 -
src/UIElements/Qt4/Query/DoublesQtQuery.cpp
r1c55b8 r852ea3 29 29 30 30 QtDialog::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), 32 32 QtQueryList<double>(_parent, _dialog, temp) 33 33 { … … 63 63 } 64 64 65 bool QtDialog::DoublesQtQuery::handle()66 {67 if (param.isValid(temp)){68 param.set(temp);69 return true;70 }71 return false;72 }73 65 74 66 75 -
src/UIElements/Qt4/Query/ElementQtQuery.cpp
r1c55b8 r852ea3 31 31 32 32 QtDialog::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), 34 34 parent(_parent), 35 35 dialog(_dialog) … … 66 66 } 67 67 68 bool QtDialog::ElementQtQuery::handle(){69 if (param.isValid(temp)){70 param.set(temp);71 return true;72 }73 return false;74 }75 68 76 -
src/UIElements/Qt4/Query/ElementsQtQuery.cpp
r1c55b8 r852ea3 30 30 31 31 QtDialog::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), 33 33 QtQueryList<const element *>(_parent, _dialog, temp) 34 34 { … … 64 64 } 65 65 66 bool QtDialog::ElementsQtQuery::handle()67 {68 if (param.isValid(temp)){69 param.set(temp);70 return true;71 }72 return false;73 }74 66 75 -
src/UIElements/Qt4/Query/FileQtQuery.cpp
r1c55b8 r852ea3 30 30 31 31 QtDialog::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), 33 33 parent(_parent), 34 34 dialog(_dialog) … … 82 82 } 83 83 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 30 30 31 31 QtDialog::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), 33 33 QtQueryList<boost::filesystem::path>(_parent, _dialog, temp) 34 34 { … … 64 64 } 65 65 66 bool QtDialog::FilesQtQuery::handle()67 {68 if (param.isValid(temp)){69 param.set(temp);70 return true;71 }72 return false;73 }74 66 75 -
src/UIElements/Qt4/Query/IntQtQuery.cpp
r1c55b8 r852ea3 28 28 29 29 QtDialog::IntQtQuery::IntQtQuery(Parameter<int> &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) : 30 Dialog::TQuery<int>(_param, _title),30 QtQuery<int>(_param, _title), 31 31 parent(_parent), 32 32 dialog(_dialog) … … 55 55 } 56 56 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 29 29 30 30 QtDialog::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), 32 32 QtQueryList<int>(_parent, _dialog, temp) 33 33 { … … 63 63 } 64 64 65 bool QtDialog::IntsQtQuery::handle()66 {67 if (param.isValid(temp)){68 param.set(temp);69 return true;70 }71 return false;72 }73 65 74 66 75 -
src/UIElements/Qt4/Query/MoleculeQtQuery.cpp
r1c55b8 r852ea3 31 31 32 32 QtDialog::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), 34 34 parent(_parent), 35 35 dialog(_dialog) … … 65 65 } 66 66 67 // Handling is easy, since the GUI makes it impossible to select invalid values68 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 29 29 30 30 QtDialog::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), 32 32 QtQueryList<const molecule *>(_parent, _dialog, temp) 33 33 { … … 63 63 } 64 64 65 bool QtDialog::MoleculesQtQuery::handle()66 {67 if (param.isValid(temp)){68 param.set(temp);69 return true;70 }71 return false;72 }73 65 74 66 75 -
src/UIElements/Qt4/Query/QtQuery.hpp
r1c55b8 r852ea3 35 35 class QFileDialog; 36 36 37 class QtDialog::AtomQtQuery : public QWidget, public Dialog::TQuery<const atom *> { 37 template<class T> 38 class QtQuery : public Dialog::TQuery<T> 39 { 40 public: 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 47 class QtDialog::AtomQtQuery : public QWidget, public QtQuery<const atom *> { 38 48 Q_OBJECT 39 49 public: 40 50 AtomQtQuery(Parameter<const atom *> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 41 51 virtual ~AtomQtQuery(); 42 virtual bool handle();43 52 44 53 public slots: … … 53 62 }; 54 63 55 class QtDialog::AtomsQtQuery : public QWidget, public Dialog::TQuery<std::vector<const atom *> >, public QtQueryList<const atom *> {64 class QtDialog::AtomsQtQuery : public QWidget, public QtQuery<std::vector<const atom *> >, public QtQueryList<const atom *> { 56 65 Q_OBJECT 57 66 public: 58 67 AtomsQtQuery(Parameter<std::vector<const atom *> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 59 68 virtual ~AtomsQtQuery(); 60 virtual bool handle();61 69 62 70 virtual void onSubUpdate(); … … 71 79 }; 72 80 73 class QtDialog::BooleanQtQuery : public QWidget, public Dialog::TQuery<bool> {81 class QtDialog::BooleanQtQuery : public QWidget, public QtQuery<bool> { 74 82 Q_OBJECT 75 83 public: 76 84 BooleanQtQuery(Parameter<bool> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog); 77 85 virtual ~BooleanQtQuery(); 78 virtual bool handle();79 86 80 87 public slots: … … 89 96 }; 90 97 91 class QtDialog::RealSpaceMatrixQtQuery : public QWidget, public Dialog::TQuery<RealSpaceMatrix> {98 class QtDialog::RealSpaceMatrixQtQuery : public QWidget, public QtQuery<RealSpaceMatrix> { 92 99 Q_OBJECT 93 100 public: 94 101 RealSpaceMatrixQtQuery(Parameter<RealSpaceMatrix> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 95 102 virtual ~RealSpaceMatrixQtQuery(); 96 virtual bool handle();97 103 98 104 public slots: … … 107 113 }; 108 114 109 class QtDialog::DoubleQtQuery : public QWidget, public Dialog::TQuery<double> {115 class QtDialog::DoubleQtQuery : public QWidget, public QtQuery<double> { 110 116 Q_OBJECT 111 117 public: 112 118 DoubleQtQuery(Parameter<double> &, std::string title,QBoxLayout *_parent,Dialog *_dialog); 113 119 virtual ~DoubleQtQuery(); 114 virtual bool handle();115 120 116 121 public slots: … … 125 130 }; 126 131 127 class QtDialog::DoublesQtQuery : public QWidget, public Dialog::TQuery<std::vector<double> >, public QtQueryList<double> {132 class QtDialog::DoublesQtQuery : public QWidget, public QtQuery<std::vector<double> >, public QtQueryList<double> { 128 133 Q_OBJECT 129 134 public: 130 135 DoublesQtQuery(Parameter<std::vector<double> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 131 136 virtual ~DoublesQtQuery(); 132 virtual bool handle();133 137 134 138 virtual void onSubUpdate(); … … 143 147 }; 144 148 145 class QtDialog::ElementQtQuery : public QWidget, public Dialog::TQuery<const element *> {149 class QtDialog::ElementQtQuery : public QWidget, public QtQuery<const element *> { 146 150 Q_OBJECT 147 151 public: 148 152 ElementQtQuery(Parameter<const element *> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog); 149 153 virtual ~ElementQtQuery(); 150 virtual bool handle();151 154 152 155 public slots: … … 161 164 }; 162 165 163 class QtDialog::ElementsQtQuery : public QWidget, public Dialog::TQuery<std::vector<const element *> >, public QtQueryList<const element *> {166 class QtDialog::ElementsQtQuery : public QWidget, public QtQuery<std::vector<const element *> >, public QtQueryList<const element *> { 164 167 Q_OBJECT 165 168 public: 166 169 ElementsQtQuery(Parameter<std::vector<const element *> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 167 170 virtual ~ElementsQtQuery(); 168 virtual bool handle();169 171 170 172 virtual void onSubUpdate(); … … 191 193 }; 192 194 193 class QtDialog::FileQtQuery : public QWidget, public Dialog::TQuery<boost::filesystem::path> {195 class QtDialog::FileQtQuery : public QWidget, public QtQuery<boost::filesystem::path> { 194 196 Q_OBJECT 195 197 public: 196 198 FileQtQuery(Parameter<boost::filesystem::path> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog); 197 199 virtual ~FileQtQuery(); 198 virtual bool handle();199 200 200 201 public slots: … … 212 213 }; 213 214 214 class QtDialog::FilesQtQuery : public QWidget, public Dialog::TQuery<std::vector<boost::filesystem::path> >, public QtQueryList<boost::filesystem::path> {215 class QtDialog::FilesQtQuery : public QWidget, public QtQuery<std::vector<boost::filesystem::path> >, public QtQueryList<boost::filesystem::path> { 215 216 Q_OBJECT 216 217 public: 217 218 FilesQtQuery(Parameter<std::vector<boost::filesystem::path> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 218 219 virtual ~FilesQtQuery(); 219 virtual bool handle();220 220 221 221 virtual void onSubUpdate(); … … 230 230 }; 231 231 232 class QtDialog::IntQtQuery : public QWidget, public Dialog::TQuery<int> {232 class QtDialog::IntQtQuery : public QWidget, public QtQuery<int> { 233 233 Q_OBJECT 234 234 public: 235 235 IntQtQuery(Parameter<int> &, std::string _title,QBoxLayout *_parent,Dialog *_dialog); 236 236 virtual ~IntQtQuery(); 237 virtual bool handle();238 237 239 238 public slots: … … 248 247 }; 249 248 250 class QtDialog::IntsQtQuery : public QWidget, public Dialog::TQuery<std::vector<int> >, public QtQueryList<int> {249 class QtDialog::IntsQtQuery : public QWidget, public QtQuery<std::vector<int> >, public QtQueryList<int> { 251 250 Q_OBJECT 252 251 public: 253 252 IntsQtQuery(Parameter<std::vector<int> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 254 253 virtual ~IntsQtQuery(); 255 virtual bool handle();256 254 257 255 virtual void onSubUpdate(); … … 266 264 }; 267 265 268 class QtDialog::MoleculeQtQuery : public QWidget, public Dialog::TQuery<const molecule *> {266 class QtDialog::MoleculeQtQuery : public QWidget, public QtQuery<const molecule *> { 269 267 Q_OBJECT 270 268 public: 271 269 MoleculeQtQuery(Parameter<const molecule *> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 272 270 virtual ~MoleculeQtQuery(); 273 virtual bool handle();274 271 275 272 public slots: … … 284 281 }; 285 282 286 class QtDialog::MoleculesQtQuery : public QWidget, public Dialog::TQuery<std::vector<const molecule *> >, public QtQueryList<const molecule *> {283 class QtDialog::MoleculesQtQuery : public QWidget, public QtQuery<std::vector<const molecule *> >, public QtQueryList<const molecule *> { 287 284 Q_OBJECT 288 285 public: 289 286 MoleculesQtQuery(Parameter<std::vector<const molecule *> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 290 287 virtual ~MoleculesQtQuery(); 291 virtual bool handle();292 288 293 289 virtual void onSubUpdate(); … … 302 298 }; 303 299 304 class QtDialog::StringQtQuery : public QWidget, public Dialog::TQuery<std::string> {300 class QtDialog::StringQtQuery : public QWidget, public QtQuery<std::string> { 305 301 Q_OBJECT 306 302 public: 307 303 StringQtQuery(Parameter<std::string> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 308 304 virtual ~StringQtQuery(); 309 virtual bool handle();310 305 311 306 public slots: … … 320 315 }; 321 316 322 class QtDialog::StringsQtQuery : public QWidget, public Dialog::TQuery<std::vector<std::string> >, public QtQueryList<std::string> {317 class QtDialog::StringsQtQuery : public QWidget, public QtQuery<std::vector<std::string> >, public QtQueryList<std::string> { 323 318 Q_OBJECT 324 319 public: 325 320 StringsQtQuery(Parameter<std::vector<std::string> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 326 321 virtual ~StringsQtQuery(); 327 virtual bool handle();328 322 329 323 virtual void onSubUpdate(); … … 338 332 }; 339 333 340 class QtDialog::UnsignedIntQtQuery : public QWidget, public Dialog::TQuery<unsigned int> {334 class QtDialog::UnsignedIntQtQuery : public QWidget, public QtQuery<unsigned int> { 341 335 Q_OBJECT 342 336 public: 343 337 UnsignedIntQtQuery(Parameter<unsigned int> &, std::string _title,QBoxLayout *_parent,Dialog *_dialog); 344 338 virtual ~UnsignedIntQtQuery(); 345 virtual bool handle();346 339 347 340 public slots: … … 356 349 }; 357 350 358 class QtDialog::UnsignedIntsQtQuery : public QWidget, public Dialog::TQuery<std::vector<unsigned int> >, public QtQueryList<unsigned int> {351 class QtDialog::UnsignedIntsQtQuery : public QWidget, public QtQuery<std::vector<unsigned int> >, public QtQueryList<unsigned int> { 359 352 Q_OBJECT 360 353 public: 361 354 UnsignedIntsQtQuery(Parameter<std::vector<unsigned int> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 362 355 virtual ~UnsignedIntsQtQuery(); 363 virtual bool handle();364 356 365 357 virtual void onSubUpdate(); … … 374 366 }; 375 367 376 class QtDialog::VectorQtQuery : public QWidget, public Dialog::TQuery<Vector> {368 class QtDialog::VectorQtQuery : public QWidget, public QtQuery<Vector> { 377 369 Q_OBJECT 378 370 public: 379 371 VectorQtQuery(Parameter<Vector> &, std::string title,QBoxLayout *,Dialog *); 380 372 virtual ~VectorQtQuery(); 381 virtual bool handle();382 373 383 374 public slots: … … 399 390 }; 400 391 401 class QtDialog::VectorsQtQuery : public QWidget, public Dialog::TQuery<std::vector<Vector> >, public QtQueryList<Vector> {392 class QtDialog::VectorsQtQuery : public QWidget, public QtQuery<std::vector<Vector> >, public QtQueryList<Vector> { 402 393 Q_OBJECT 403 394 public: 404 395 VectorsQtQuery(Parameter<std::vector<Vector> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog); 405 396 virtual ~VectorsQtQuery(); 406 virtual bool handle();407 397 408 398 virtual void onSubUpdate(); … … 417 407 }; 418 408 419 class QtDialog::RandomNumberDistribution_ParametersQtQuery : public QWidget, public Dialog::TQuery<RandomNumberDistribution_Parameters> {409 class QtDialog::RandomNumberDistribution_ParametersQtQuery : public QWidget, public QtQuery<RandomNumberDistribution_Parameters> { 420 410 Q_OBJECT 421 411 public: 422 412 RandomNumberDistribution_ParametersQtQuery(Parameter<RandomNumberDistribution_Parameters> &, std::string title,QBoxLayout *,Dialog *); 423 413 virtual ~RandomNumberDistribution_ParametersQtQuery(); 424 virtual bool handle();425 414 426 415 public slots: -
src/UIElements/Qt4/Query/RandomNumberDistribution_ParametersQtQuery.cpp
r1c55b8 r852ea3 31 31 32 32 QtDialog::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), 34 34 parent(_parent), 35 35 dialog(_dialog) … … 65 65 } 66 66 67 bool QtDialog::RandomNumberDistribution_ParametersQtQuery::handle() {68 if (param.isValid(temp)){69 param.set(temp);70 return true;71 }72 return false;73 }74 67 75 -
src/UIElements/Qt4/Query/RealSpaceMatrixQtQuery.cpp
r1c55b8 r852ea3 30 30 31 31 QtDialog::RealSpaceMatrixQtQuery::RealSpaceMatrixQtQuery(Parameter<RealSpaceMatrix> &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) : 32 Dialog::TQuery<RealSpaceMatrix>(_param, _title),32 QtQuery<RealSpaceMatrix>(_param, _title), 33 33 parent(_parent), 34 34 dialog(_dialog) … … 70 70 } 71 71 72 bool QtDialog::RealSpaceMatrixQtQuery::handle() {73 if (param.isValid(temp)){74 param.set(temp);75 return true;76 }77 return false;78 }79 72 80 -
src/UIElements/Qt4/Query/StringQtQuery.cpp
r1c55b8 r852ea3 28 28 29 29 QtDialog::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), 31 31 parent(_parent), 32 32 dialog(_dialog) … … 55 55 } 56 56 57 // All values besides the empty std::string are valid58 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 29 29 30 30 QtDialog::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), 32 32 QtQueryList<std::string>(_parent, _dialog, temp) 33 33 { … … 63 63 } 64 64 65 // All values besides the empty std::string are valid66 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 28 28 29 29 QtDialog::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), 31 31 parent(_parent), 32 32 dialog(_dialog) … … 56 56 } 57 57 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 29 29 30 30 QtDialog::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), 32 32 QtQueryList<unsigned int>(_parent, _dialog, temp) 33 33 { … … 63 63 } 64 64 65 bool QtDialog::UnsignedIntsQtQuery::handle()66 {67 if (param.isValid(temp)){68 param.set(temp);69 return true;70 }71 return false;72 }73 65 74 66 75 -
src/UIElements/Qt4/Query/VectorQtQuery.cpp
r1c55b8 r852ea3 29 29 30 30 QtDialog::VectorQtQuery::VectorQtQuery(Parameter<Vector> &_param, std::string title, QBoxLayout *_parent,Dialog *_dialog) : 31 Dialog::TQuery<Vector>(_param, title),31 QtQuery<Vector>(_param, title), 32 32 parent(_parent), 33 33 dialog(_dialog) … … 88 88 } 89 89 90 bool QtDialog::VectorQtQuery::handle() {91 if (param.isValid(temp)){92 param.set(temp);93 return true;94 }95 return false;96 }97 90 98 -
src/UIElements/Qt4/Query/VectorsQtQuery.cpp
r1c55b8 r852ea3 30 30 31 31 QtDialog::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), 33 33 QtQueryList<Vector>(_parent, _dialog, temp) 34 34 { … … 64 64 } 65 65 66 bool QtDialog::VectorsQtQuery::handle()67 {68 if (param.isValid(temp)){69 param.set(temp);70 return true;71 }72 return false;73 }74 66 75 -
src/UIElements/TextUI/Query/AtomTextQuery.cpp
r1c55b8 r852ea3 55 55 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; 56 56 badInput = true; 57 }else 58 param.set(temp); 57 } 59 58 60 59 } while(badInput); -
src/UIElements/TextUI/Query/AtomsTextQuery.cpp
r1c55b8 r852ea3 67 67 } 68 68 } 69 param.set(temp);70 69 71 70 return (idxOfAtom!=-1); -
src/UIElements/TextUI/Query/BooleanTextQuery.cpp
r1c55b8 r852ea3 42 42 std::cin >> input; 43 43 if ((input == 'y' ) || (input == 'Y')) { 44 param.set(true);44 temp = true; 45 45 } else if ((input == 'n' ) || (input == 'N')) { 46 param.set(false);46 temp = false; 47 47 } else { 48 48 badInput=true; -
src/UIElements/TextUI/Query/DoubleTextQuery.cpp
r1c55b8 r852ea3 45 45 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 46 46 std::cout << "Input was not a number!" << std::endl; 47 }else 48 param.set(temp); 47 } 49 48 }while(badInput); 50 49 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); -
src/UIElements/TextUI/Query/DoublesTextQuery.cpp
r1c55b8 r852ea3 54 54 temp.push_back(temp_element); 55 55 } 56 param.set(temp);57 56 58 57 return true; -
src/UIElements/TextUI/Query/ElementsTextQuery.cpp
r1c55b8 r852ea3 83 83 } 84 84 } 85 param.set(temp);86 85 87 86 return (Z!=-1); -
src/UIElements/TextUI/Query/FileTextQuery.cpp
r1c55b8 r852ea3 52 52 } while(badInput); 53 53 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 54 param.set(temp);55 54 return true; 56 55 } -
src/UIElements/TextUI/Query/FilesTextQuery.cpp
r1c55b8 r852ea3 38 38 39 39 bool TextDialog::FilesTextQuery::handle() { 40 std::vector<boost::filesystem::path> tempfiles;41 40 bool badInput = false; 42 41 bool continueflag = true; … … 61 60 if (tempstring != "y") 62 61 continueflag = false; 63 temp files.push_back(tempfile);62 temp.push_back(tempfile); 64 63 } while(continueflag); 65 64 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 66 param.set(tempfiles);67 65 return true; 68 66 } -
src/UIElements/TextUI/Query/IntTextQuery.cpp
r1c55b8 r852ea3 45 45 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 46 46 std::cout << "Input was not a number!" << std::endl; 47 }else 48 param.set(temp); 47 } 49 48 } while(badInput); 50 49 // clear the input buffer of anything still in the line -
src/UIElements/TextUI/Query/IntsTextQuery.cpp
r1c55b8 r852ea3 54 54 temp.push_back(temp_element); 55 55 } 56 param.set(temp);57 56 58 57 return true; -
src/UIElements/TextUI/Query/MoleculeTextQuery.cpp
r1c55b8 r852ea3 57 57 badInput = true; 58 58 } 59 param.set(temp);60 59 61 60 } while(badInput); -
src/UIElements/TextUI/Query/MoleculesTextQuery.cpp
r1c55b8 r852ea3 67 67 } 68 68 } 69 param.set(temp);70 69 71 70 return (idxOfMol!=-1); -
src/UIElements/TextUI/Query/RandomNumberDistribution_ParametersTextQuery.cpp
r1c55b8 r852ea3 51 51 continue; 52 52 } 53 param.set(temp);54 53 55 54 } while(badInput); -
src/UIElements/TextUI/Query/RealSpaceMatrixTextQuery.cpp
r1c55b8 r852ea3 55 55 temp.set(2,1, dtemp[4]); 56 56 temp.set(2,2, dtemp[5]); 57 param.set(temp);58 57 return true; 59 58 } -
src/UIElements/TextUI/Query/StringTextQuery.cpp
r1c55b8 r852ea3 37 37 std::cout << getDescription() << ": "; 38 38 getline(std::cin,temp); 39 param.set(temp);40 39 return true; 41 40 } -
src/UIElements/TextUI/Query/StringsTextQuery.cpp
r1c55b8 r852ea3 48 48 if (olditer != temp_element.begin()) // insert last part also 49 49 temp.push_back(std::string(olditer, temp_element.end())); 50 param.set(temp);51 50 52 51 return true; -
src/UIElements/TextUI/Query/UnsignedIntTextQuery.cpp
r1c55b8 r852ea3 45 45 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 46 46 std::cout << "Input was not a number!" << std::endl; 47 }else 48 param.set(temp); 47 } 49 48 } while(badInput); 50 49 // clear the input buffer of anything still in the line -
src/UIElements/TextUI/Query/UnsignedIntsTextQuery.cpp
r1c55b8 r852ea3 54 54 temp.push_back(temp_element); 55 55 } 56 param.set(temp);57 56 58 57 return true; -
src/UIElements/TextUI/Query/VectorTextQuery.cpp
r1c55b8 r852ea3 54 54 for(std::string::iterator iter = line.begin(); (iter != line.end()) && (counter != 3); ++iter) { 55 55 if (*iter == ',') { 56 std::istringstream stream(std::string(iter, olditer)); 56 iter++; 57 std::istringstream stream(std::string(olditer, iter)); 57 58 stream >> coord; 58 59 temp[counter++] = coord; … … 65 66 temp[counter++] = coord; 66 67 } 67 param.set(temp);68 68 69 69 // check vector -
src/UIElements/TextUI/Query/VectorsTextQuery.cpp
r1c55b8 r852ea3 77 77 } 78 78 } 79 param.set(temp);80 79 81 80 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
