- Timestamp:
- Jun 11, 2015, 11:21:41 PM (10 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, 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:
- 043598
- Parents:
- dd6c07
- git-author:
- Frederik Heber <heber@…> (05/17/15 04:22:43)
- git-committer:
- Frederik Heber <heber@…> (06/11/15 23:21:41)
- Location:
- src
- Files:
-
- 7 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Values.cpp
rdd6c07 r33e801 37 37 #include "CodePatterns/Assert.hpp" 38 38 39 #include "Box.hpp" 39 40 #include "LinearAlgebra/BoxVector.hpp" 40 41 #include "LinearAlgebra/RealSpaceMatrix.hpp" 41 42 #include "LinearAlgebra/Vector.hpp" 42 #include "Box.hpp"43 43 44 44 #include "Values.hpp" -
src/Actions/Values.hpp
rdd6c07 r33e801 15 15 16 16 #include "LinearAlgebra/defs.hpp" 17 18 #include <string> 17 19 18 20 class Box; … … 45 47 }; 46 48 49 #endif /* VALUES_HPP_ */ 47 50 48 #endif /* VALUES_HPP_ */ -
src/Actions/toCLIString.cpp
rdd6c07 r33e801 40 40 #include "LinearAlgebra/RealSpaceMatrix.hpp" 41 41 #include "LinearAlgebra/Vector.hpp" 42 #include "Parameters/Specifics/KeyValuePair.hpp" 43 44 #include "Actions/toPythonString.hpp" 42 45 43 46 template <> … … 65 68 << _value.at(2,0) << "," 66 69 << _value.at(2,1) << "," 67 << _value.at(2,2) << "\""; 70 << _value.at(2,2) 71 << "\""; 68 72 return output.str(); 69 73 } … … 73 77 { 74 78 std::stringstream output; 75 output << "\"" << _value[0] << "," << _value[1] << "," << _value[2]<< "\"";79 output << "\"" << toPythonString(_value) << "\""; 76 80 return output.str(); 77 81 } … … 84 88 return output.str(); 85 89 } 90 91 template <> 92 const std::string toCLIString( const KeyValuePair& _value) 93 { 94 std::stringstream output; 95 output << "\"" << toPythonString(_value) << "\""; 96 return output.str(); 97 } -
src/Actions/toCLIString.hpp
rdd6c07 r33e801 21 21 22 22 class element; 23 struct KeyValuePair; 23 24 class RealSpaceMatrix; 24 25 class Vector; … … 77 78 template <> const std::string toCLIString( const std::string& _value); 78 79 80 template <> const std::string toCLIString( const KeyValuePair& _value); 81 79 82 #endif /* TOCLISTRING_HPP_ */ -
src/Actions/toPythonString.cpp
rdd6c07 r33e801 41 41 #include "LinearAlgebra/Vector.hpp" 42 42 43 #include "Parameters/Specifics/KeyValuePair.hpp" 44 43 45 template <> 44 46 const std::string toPythonString( const boost::filesystem::path & _value) … … 52 54 std::stringstream output; 53 55 output << _value.getAtomicNumber(); 56 return output.str(); 57 } 58 59 template <> 60 const std::string toPythonString( const KeyValuePair & _value) 61 { 62 std::stringstream output; 63 const char semicolon(';'); 64 const size_t semicolon_pos = _value.find_last_of(semicolon, std::string::npos); 65 const size_t final_equality_pos = _value.find('=', semicolon_pos); 66 output << _value; 67 if ((semicolon_pos == std::string::npos) 68 || (final_equality_pos != std::string::npos)) 69 output << semicolon; 54 70 return output.str(); 55 71 } -
src/Actions/toPythonString.hpp
rdd6c07 r33e801 21 21 22 22 class element; 23 struct KeyValuePair; 23 24 class RealSpaceMatrix; 24 25 class Vector; … … 71 72 template <> const std::string toPythonString( const boost::filesystem::path & _value); 72 73 74 template <> const std::string toPythonString( const KeyValuePair& _value); 75 73 76 template <> const std::string toPythonString( const RealSpaceMatrix& _value); 74 77 -
src/Actions/unittests/stubs/DummyUI.hpp
rdd6c07 r33e801 47 47 virtual void queryFile(Parameter<boost::filesystem::path> &, const std::string ="", const std::string = ""){}; 48 48 virtual void queryFiles(Parameter< std::vector<boost::filesystem::path> > &, const std::string ="", const std::string = ""){}; 49 virtual void queryKeyValuePair(Parameter<KeyValuePair> &, const std::string ="", const std::string = ""){}; 50 virtual void queryKeyValuePairs(Parameter<std::vector<KeyValuePair> > &, const std::string ="", const std::string = ""){}; 49 51 }; 50 52 -
src/Parameters/Makefile.am
rdd6c07 r33e801 43 43 Parameters/ValueAsString.hpp \ 44 44 Parameters/ValueInterface.hpp \ 45 Parameters/Specifics/KeyValuePair.hpp \ 45 46 Parameters/Specifics/Value_atom.hpp \ 46 47 Parameters/Specifics/Value_element.hpp \ -
src/UIElements/CommandLineUI/CommandLineDialog.cpp
rdd6c07 r33e801 136 136 } 137 137 138 void CommandLineDialog::queryKeyValuePair(Parameter<KeyValuePair> ¶m, const std::string title, const std::string description) 139 { 140 registerQuery(new KeyValuePairCommandLineQuery(param, title,description)); 141 } 142 143 void CommandLineDialog::queryKeyValuePairs(Parameter< std::vector<KeyValuePair> > ¶m, const std::string title, const std::string description) 144 { 145 registerQuery(new KeyValuePairsCommandLineQuery(param, title,description)); 146 } 147 138 148 /************************** Query Infrastructure ************************/ 139 149 /* ---> shifted to folder Query */ -
src/UIElements/CommandLineUI/CommandLineDialog.hpp
rdd6c07 r33e801 54 54 virtual void queryFile(Parameter<boost::filesystem::path> &, const std::string ="", const std::string = ""); 55 55 virtual void queryFiles(Parameter<std::vector< boost::filesystem::path> > &, const std::string ="", const std::string = ""); 56 virtual void queryKeyValuePair(Parameter<KeyValuePair> &, const std::string ="", const std::string = ""); 57 virtual void queryKeyValuePairs(Parameter< std::vector<KeyValuePair> > &, const std::string ="", const std::string = ""); 58 56 59 // specialized stuff for command line queries 57 60 // all placed into Query/CommandLineQuery.hpp 58 61 // !please adhere to alphabetical ordering! 62 59 63 class AtomCommandLineQuery; 60 64 class AtomsCommandLineQuery; … … 69 73 class IntCommandLineQuery; 70 74 class IntsCommandLineQuery; 75 class KeyValuePairCommandLineQuery; 76 class KeyValuePairsCommandLineQuery; 71 77 class MoleculeCommandLineQuery; 72 78 class MoleculesCommandLineQuery; -
src/UIElements/CommandLineUI/CommandLineParser.cpp
rdd6c07 r33e801 52 52 #include "CommandLineParser.hpp" 53 53 #include "CommandLineParser_validate.hpp" 54 #include "Parameters/Specifics/KeyValuePair.hpp" 54 55 #include "World.hpp" 55 56 … … 408 409 // po::value < RealSpaceMatrixValue >()->default_value(boost::lexical_cast<BoxValue>(currentOption->getDefaultValue().c_str())) : 409 410 po::value < RealSpaceMatrixValue >(), 411 currentOption->getDescription().c_str()) 412 ; 413 break; 414 case TypeEnumContainer::KeyValueType: 415 OptionList->add_options() 416 (currentOption->getKeyAndShortForm().c_str(), 417 currentOption->hasDefaultValue() ? 418 (_DefaultAsImplicit ? 419 po::value < KeyValuePair >()->implicit_value(boost::lexical_cast< KeyValuePair >(currentOption->getDefaultValue().c_str())) : 420 po::value < KeyValuePair >()->default_value(boost::lexical_cast< KeyValuePair >(currentOption->getDefaultValue().c_str()))) : 421 po::value < KeyValuePair >(), 422 currentOption->getDescription().c_str()) 423 ; 424 break; 425 case TypeEnumContainer::ListOfKeyValuesType: 426 OptionList->add_options() 427 (currentOption->getKeyAndShortForm().c_str(), 428 // currentOption->hasDefaultValue() ? 429 // po::value < std::vector<KeyValuePair> >()->default_value(boost::lexical_cast< std::vector<KeyValuePair> >(currentOption->getDefaultValue().c_str())) : 430 po::value < std::vector<KeyValuePair> >()->multitoken(), 410 431 currentOption->getDescription().c_str()) 411 432 ; -
src/UIElements/CommandLineUI/CommandLineParser_validate.cpp
rdd6c07 r33e801 42 42 #include "Actions/Values.hpp" 43 43 #include "CommandLineParser_validate.hpp" 44 #include "Parameters/Specifics/KeyValuePair.hpp" 44 45 45 46 /** boost::program_options validator specialization for VectorValue. … … 157 158 void validate(boost::any& v, const std::vector<std::string>& values, boost::filesystem::path *, int) 158 159 { 159 boost::filesystem::path filename; 160 161 std::cerr << "boost::filesystem::path validator used." << std::endl; 160 // std::cerr << "boost::filesystem::path validator used." << std::endl; 161 162 // Make sure no previous assignment to 'a' was made. 163 boost::program_options::validators::check_first_occurrence(v); 164 // Extract the first string from 'values'. If there is more than 165 // one string, it's an error, and exception will be thrown. 166 const std::string& s = boost::program_options::validators::get_single_string(values); 167 168 v = boost::any(boost::filesystem::path(s)); 169 } 170 171 /** boost::program_options validator specialization for boost::filesystem::path. 172 * \param &v reference for return value 173 * \param &values string vector of scanned options 174 * \param * 175 * \param 176 * 177 */ 178 void validate(boost::any& v, const std::vector<std::string>& values, KeyValuePair *, int) 179 { 180 // std::cerr << "KeyValuePair validator used." << std::endl; 181 182 // Make sure no previous assignment to 'a' was made. 183 boost::program_options::validators::check_first_occurrence(v); 184 // Extract the first string from 'values'. If there is more than 185 // one string, it's an error, and exception will be thrown. 186 const std::string& s = boost::program_options::validators::get_single_string(values); 187 188 if (s.find("=") == std::string::npos) { 189 #if BOOST_VERSION < 104200 190 throw boost::program_options::validation_error("Invalid KeyValue given"); 191 #else 192 throw boost::program_options::validation_error( 193 boost::program_options::validation_error::invalid_option_value, 194 std::string("value"), 195 std::string("vector<KeyValuePair>") 196 ); 197 #endif 198 } 199 v = boost::any(KeyValuePair(s)); 200 } 201 202 /** boost::program_options validator specialization for boost::filesystem::path. 203 * \param &v reference for return value 204 * \param &values string vector of scanned options 205 * \param * 206 * \param 207 * 208 */ 209 void validate(boost::any& v, const std::vector<std::string>& values, std::vector<KeyValuePair> *, int) 210 { 211 // std::cerr << "vector<KeyValuePair> validator used." << std::endl; 162 212 163 213 // split comma-separated values 164 if (values.size() != 1) { 165 std::cerr << "Not one file but " << values.size() << " given " << std::endl; 214 if (values.size() > 1) { 166 215 #if BOOST_VERSION < 104200 167 216 throw boost::program_options::validation_error("Unequal to one file given"); … … 171 220 boost::program_options::validation_error::at_least_one_value_required, 172 221 std::string("value"), 173 std::string("boost::filesystem::path") 174 ); 175 } else { 176 throw boost::program_options::validation_error( 177 boost::program_options::validation_error::multiple_values_not_allowed, 178 std::string("value"), 179 std::string("boost::filesystem::path") 222 std::string("vector<KeyValuePair>") 180 223 ); 181 224 } 182 225 #endif 183 } 184 filename = values.at(0); 185 v = boost::any(boost::filesystem::path(filename)); 186 } 187 226 for (std::vector<std::string>::const_iterator iter = values.begin(); 227 iter != values.end();++iter) 228 if ((*iter).find("=") == std::string::npos) { 229 #if BOOST_VERSION < 104200 230 throw boost::program_options::validation_error("Invalid KeyValue given"); 231 #else 232 throw boost::program_options::validation_error( 233 boost::program_options::validation_error::invalid_option_value, 234 std::string("value"), 235 std::string("vector<KeyValuePair>") 236 ); 237 #endif 238 } 239 } 240 std::vector<KeyValuePair> temp; 241 for (std::vector<std::string>::const_iterator iter = values.begin(); 242 iter != values.end();++iter) 243 temp.push_back(KeyValuePair(*iter)); 244 v = boost::any(temp); 245 } -
src/UIElements/CommandLineUI/CommandLineParser_validate.hpp
rdd6c07 r33e801 22 22 #include <boost/lexical_cast.hpp> 23 23 24 struct KeyValuePair; 24 25 class RealSpaceMatrixValue; 25 26 class VectorValue; 26 27 28 void validate(boost::any& v, const std::vector<std::string>& values, KeyValuePair *, int); 29 void validate(boost::any& v, const std::vector<std::string>& values, std::vector<KeyValuePair> *, int); 27 30 void validate(boost::any& v, const std::vector<std::string>& values, VectorValue *, int); 28 31 void validate(boost::any& v, const std::vector<std::string>& values, RealSpaceMatrixValue *, int); -
src/UIElements/CommandLineUI/Query/CommandLineQuery.hpp
rdd6c07 r33e801 164 164 }; 165 165 166 class CommandLineDialog::KeyValuePairCommandLineQuery : public Dialog::TQuery<KeyValuePair> { 167 public: 168 KeyValuePairCommandLineQuery(Parameter<KeyValuePair> &_param, const std::string &_title, const std::string &_description = ""); 169 virtual ~KeyValuePairCommandLineQuery(); 170 virtual bool handle(); 171 }; 172 173 class CommandLineDialog::KeyValuePairsCommandLineQuery : public Dialog::TQuery<std::vector<KeyValuePair> > { 174 public: 175 KeyValuePairsCommandLineQuery(Parameter<std::vector<KeyValuePair> > &_param, const std::string &_title, const std::string &_description = ""); 176 virtual ~KeyValuePairsCommandLineQuery(); 177 virtual bool handle(); 178 }; 179 166 180 #endif /* COMMANDLINEQUERY_HPP_ */ -
src/UIElements/CommandLineUI/TypeEnumContainer.cpp
rdd6c07 r33e801 51 51 #include "Element/element.hpp" 52 52 #include "molecule.hpp" 53 #include "Parameters/Specifics/KeyValuePair.hpp" 53 54 #include "RandomNumbers/RandomNumberDistribution_Parameters.hpp" 54 55 … … 81 82 TypeEnumMap[&typeid(const element *)] = ElementType; 82 83 TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElementsType; 84 TypeEnumMap[&typeid(KeyValuePair)] = KeyValueType; 85 TypeEnumMap[&typeid(std::vector<KeyValuePair>)] = ListOfKeyValuesType; 83 86 84 87 // for debugging: list all stored types -
src/UIElements/CommandLineUI/TypeEnumContainer.hpp
rdd6c07 r33e801 46 46 ElementType, 47 47 ListOfElementsType, 48 RealSpaceMatrixType 48 RealSpaceMatrixType, 49 KeyValueType, 50 ListOfKeyValuesType 49 51 }; 50 52 -
src/UIElements/Dialog.cpp
rdd6c07 r33e801 235 235 } 236 236 237 template <> void Dialog::query< KeyValuePair >(Parameter<KeyValuePair> ¶m, const std::string title, const std::string description) 238 { 239 queryKeyValuePair(param, title, description); 240 } 241 242 template <> void Dialog::query< std::vector<KeyValuePair> >(Parameter< std::vector<KeyValuePair> > ¶m, const std::string title, const std::string description) 243 { 244 queryKeyValuePairs(param, title, description); 245 } 246 237 247 /************************** Query Infrastructure ************************/ 238 248 /* ---> shifted to folder Query */ -
src/UIElements/Dialog.hpp
rdd6c07 r33e801 23 23 #include "LinearAlgebra/Vector.hpp" 24 24 #include "Parameters/Parameter.hpp" 25 #include "Parameters/Specifics/KeyValuePair.hpp" 25 26 26 27 class atom; … … 28 29 class element; 29 30 class molecule; 30 31 31 32 32 /** Dialog is one of the two main classes of the UIFactory base class. … … 178 178 virtual void queryFile(Parameter<boost::filesystem::path> &, const std::string ="", const std::string = "")=0; 179 179 virtual void queryFiles(Parameter< std::vector<boost::filesystem::path> > &, const std::string ="", const std::string = "")=0; 180 virtual void queryKeyValuePair(Parameter<KeyValuePair> &, const std::string ="", const std::string = "")=0; 181 virtual void queryKeyValuePairs(Parameter< std::vector<KeyValuePair> > &, const std::string ="", const std::string = "")=0; 180 182 181 183 virtual bool display(); -
src/UIElements/Makefile.am
rdd6c07 r33e801 18 18 UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp \ 19 19 UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp \ 20 UIElements/CommandLineUI/Query/KeyValuePairCommandLineQuery.cpp \ 21 UIElements/CommandLineUI/Query/KeyValuePairsCommandLineQuery.cpp \ 20 22 UIElements/CommandLineUI/Query/RealSpaceMatrixCommandLineQuery.cpp \ 21 23 UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp \ … … 89 91 UIElements/TextUI/Query/MoleculesTextQuery.cpp \ 90 92 UIElements/TextUI/Query/MoleculeTextQuery.cpp \ 93 UIElements/TextUI/Query/KeyValuePairTextQuery.cpp \ 94 UIElements/TextUI/Query/KeyValuePairsTextQuery.cpp \ 91 95 UIElements/TextUI/Query/RealSpaceMatrixTextQuery.cpp \ 92 96 UIElements/TextUI/Query/StringTextQuery.cpp \ … … 154 158 UIElements/Qt4/Query/MoleculesQtQuery.cpp \ 155 159 UIElements/Qt4/Query/QtQueryList.cpp \ 160 UIElements/Qt4/Query/KeyValuePairQtQuery.cpp \ 161 UIElements/Qt4/Query/KeyValuePairsQtQuery.cpp \ 156 162 UIElements/Qt4/Query/RealSpaceMatrixQtQuery.cpp \ 157 163 UIElements/Qt4/Query/StringQtQuery.cpp \ -
src/UIElements/Qt4/QtDialog.cpp
rdd6c07 r33e801 197 197 } 198 198 199 void QtDialog::queryKeyValuePair(Parameter<KeyValuePair> ¶m, const std::string title, const std::string description) 200 { 201 registerQuery(new KeyValuePairQtQuery(param, title,description,inputLayout,this)); 202 } 203 204 void QtDialog::queryKeyValuePairs(Parameter< std::vector<KeyValuePair> > ¶m, const std::string title, const std::string description) 205 { 206 registerQuery(new KeyValuePairsQtQuery(param, title,description,inputLayout,this)); 207 } 208 199 209 /************************** Query Infrastructure ************************/ 200 210 /* ---> shifted to folder Query */ -
src/UIElements/Qt4/QtDialog.hpp
rdd6c07 r33e801 55 55 virtual void queryFile(Parameter<boost::filesystem::path> &, const std::string ="", const std::string = ""); 56 56 virtual void queryFiles(Parameter<std::vector< boost::filesystem::path> > &, const std::string ="", const std::string = ""); 57 virtual void queryKeyValuePair(Parameter<KeyValuePair> &, const std::string ="", const std::string = ""); 58 virtual void queryKeyValuePairs(Parameter< std::vector<KeyValuePair> > &, const std::string ="", const std::string = ""); 57 59 58 60 virtual bool display(); … … 74 76 class IntQtQuery; 75 77 class IntsQtQuery; 78 class KeyValuePairQtQuery; 79 class KeyValuePairsQtQuery; 76 80 class MoleculeQtQuery; 77 81 class MoleculesQtQuery; -
src/UIElements/Qt4/Query/QtQuery.hpp
rdd6c07 r33e801 17 17 #include <Qt/qwidget.h> 18 18 #include "Qt4/QtDialog.hpp" 19 #include "QtQueryList.hpp" 20 19 21 #include "Parameters/Parameter.hpp" 20 #include "QtQueryList.hpp"21 22 22 23 class QHBoxLayout; … … 300 301 }; 301 302 303 class QtDialog::KeyValuePairQtQuery : public QWidget, public QtQuery<KeyValuePair> { 304 Q_OBJECT 305 public: 306 KeyValuePairQtQuery(Parameter<KeyValuePair> &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); 307 virtual ~KeyValuePairQtQuery(); 308 309 public slots: 310 void onUpdate(const QString&); 311 void onUpdateCombo(int index); 312 313 private: 314 QBoxLayout *parent; 315 QBoxLayout *thisLayout; 316 QLabel *titleLabel; 317 QLineEdit *inputBox; 318 QComboBox *comboBox; 319 Dialog *dialog; 320 }; 321 322 class QtDialog::KeyValuePairsQtQuery : public QWidget, public QtQuery<std::vector<KeyValuePair> >, public QtQueryList<KeyValuePair> { 323 Q_OBJECT 324 public: 325 KeyValuePairsQtQuery(Parameter<std::vector<KeyValuePair> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); 326 virtual ~KeyValuePairsQtQuery(); 327 328 virtual void onSubUpdate(); 329 330 public slots: 331 void onAddElement(); 332 void onRemoveElement(); 333 void onElementSelected(); 334 335 private: 336 KeyValuePairQtQuery *subQuery; 337 }; 338 302 339 class QtDialog::StringQtQuery : public QWidget, public QtQuery<std::string> { 303 340 Q_OBJECT -
src/UIElements/Qt4/Query/QtQueryList.hpp
rdd6c07 r33e801 142 142 virtual void queryFile(Parameter<boost::filesystem::path> &, const std::string = "", const std::string = ""){} 143 143 virtual void queryFiles(Parameter<std::vector< boost::filesystem::path> > &, const std::string = "", const std::string = ""){} 144 virtual void queryKeyValuePair(Parameter<KeyValuePair> &, const std::string = "", const std::string = ""){} 145 virtual void queryKeyValuePairs(Parameter<std::vector<KeyValuePair> > &, const std::string = "", const std::string = ""){} 146 144 147 private: 145 148 QtQueryListUntyped *parent; -
src/UIElements/TextUI/Query/TextQuery.hpp
rdd6c07 r33e801 108 108 }; 109 109 110 class TextDialog::KeyValuePairTextQuery : public Dialog::TQuery<KeyValuePair> { 111 public: 112 KeyValuePairTextQuery(Parameter<KeyValuePair> &, const std::string &_title, const std::string &_description = NULL); 113 virtual ~KeyValuePairTextQuery(); 114 virtual bool handle(); 115 }; 116 117 class TextDialog::KeyValuePairsTextQuery : public Dialog::TQuery<std::vector<KeyValuePair> > { 118 public: 119 KeyValuePairsTextQuery(Parameter<std::vector<KeyValuePair> > &, const std::string &_title, const std::string &_description = NULL); 120 virtual ~KeyValuePairsTextQuery(); 121 virtual bool handle(); 122 }; 123 110 124 class TextDialog::MoleculeTextQuery : public Dialog::TQuery<const molecule *> { 111 125 public: -
src/UIElements/TextUI/TextDialog.cpp
rdd6c07 r33e801 134 134 } 135 135 136 void TextDialog::queryKeyValuePair(Parameter<KeyValuePair> ¶m, const std::string title, const std::string description) 137 { 138 registerQuery(new KeyValuePairTextQuery(param, title,description)); 139 } 140 141 void TextDialog::queryKeyValuePairs(Parameter< std::vector<KeyValuePair> > ¶m, const std::string title, const std::string description) 142 { 143 registerQuery(new KeyValuePairsTextQuery(param, title,description)); 144 } 145 136 146 /************************** Query Infrastructure ************************/ 137 147 /* ---> shifted to folder Query */ -
src/UIElements/TextUI/TextDialog.hpp
rdd6c07 r33e801 22 22 class element; 23 23 class molecule; 24 class KeyValuePair; 24 25 class RealSpaceMatrix; 25 26 class Vector; … … 52 53 virtual void queryFile(Parameter<boost::filesystem::path> &, const std::string ="", const std::string = ""); 53 54 virtual void queryFiles(Parameter<std::vector<boost::filesystem::path> > &, const std::string ="", const std::string = ""); 55 virtual void queryKeyValuePair(Parameter<KeyValuePair> &, const std::string ="", const std::string = ""); 56 virtual void queryKeyValuePairs(Parameter< std::vector<KeyValuePair> > &, const std::string ="", const std::string = ""); 54 57 55 58 protected: … … 69 72 class IntTextQuery; 70 73 class IntsTextQuery; 74 class KeyValuePairTextQuery; 75 class KeyValuePairsTextQuery; 71 76 class MoleculeTextQuery; 72 77 class MoleculesTextQuery;
Note:
See TracChangeset
for help on using the changeset viewer.