Changes in src/UIElements/Dialog.cpp [7d9416:2c5765]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Dialog.cpp
r7d9416 r2c5765 26 26 #include "CodePatterns/Verbose.hpp" 27 27 28 #include "Parameters/ParameterExceptions.hpp"29 30 28 class Atom; 29 class Box; 31 30 class element; 32 31 class RealSpaceMatrix; … … 66 65 bool retval = true; 67 66 for(iter=queries.begin(); iter!=queries.end(); iter++){ 68 try { 69 retval &= (*iter)->handle(); 70 } catch (ParameterException &e) { 71 if( const std::string *name=boost::get_error_info<ParameterName>(e) ) 72 ELOG(1, "The following parameter value is not valid: " << *name << "."); 73 retval = false; 74 break; 75 } 67 retval &= (*iter)->handle(); 76 68 // if any query fails (is canceled), we can end the handling process 77 69 if(!retval) { … … 86 78 list<Query*>::iterator iter; 87 79 for(iter=queries.begin(); iter!=queries.end(); iter++) { 88 try { 89 (*iter)->setResult(); 90 } catch (ParameterException &e) { 91 if( const std::string *name=boost::get_error_info<ParameterName>(e) ) 92 ELOG(1, "The following parameter value is not valid: " << *name << "."); 93 break; 94 } 80 (*iter)->setResult(); 95 81 } 96 82 } … … 100 86 } 101 87 102 template <> void Dialog::query<void *>( Parameter<void *> ¶m,const char *token, std::string description)88 template <> void Dialog::query<void *>(const char *token, std::string description) 103 89 { 104 90 queryEmpty(token, description); 105 91 } 106 92 107 template <> void Dialog::query<bool>(Parameter<bool> ¶m, const char *token, std::string description) 108 { 109 queryBoolean(param, token, description); 110 } 111 112 template <> void Dialog::query<int>(Parameter<int> ¶m, const char *token, std::string description) 113 { 114 queryInt(param, token, description); 115 } 116 117 template <> void Dialog::query< std::vector<int> >(Parameter<std::vector<int> > ¶m, const char *token, std::string description) 118 { 119 queryInts(param, token, description); 120 } 121 122 template <> void Dialog::query<unsigned int>(Parameter<unsigned int> ¶m, const char *token, std::string description) 123 { 124 queryUnsignedInt(param, token, description); 125 } 126 127 template <> void Dialog::query< std::vector<unsigned int> >(Parameter<std::vector<unsigned int> > ¶m, const char *token, std::string description) 128 { 129 queryUnsignedInts(param, token, description); 130 } 131 132 template <> void Dialog::query<double>(Parameter<double> ¶m, const char *token, std::string description) 133 { 134 queryDouble(param, token, description); 135 } 136 137 template <> void Dialog::query< std::vector<double> >(Parameter<std::vector<double> > ¶m, const char *token, std::string description) 138 { 139 queryDoubles(param, token, description); 140 } 141 142 template <> void Dialog::query<std::string>(Parameter<std::string> ¶m, const char *token, std::string description) 143 { 144 queryString(param, token, description); 145 } 146 147 template <> void Dialog::query< std::vector<std::string> >(Parameter<std::vector<std::string> > ¶m, const char *token, std::string description) 148 { 149 queryStrings(param, token, description); 150 } 151 152 template <> void Dialog::query<const atom *>(Parameter<const atom *> ¶m, const char *token, std::string description) 153 { 154 queryAtom(param, token, description); 155 } 156 157 template <> void Dialog::query< std::vector<const atom *> >(Parameter<std::vector<const atom *> > ¶m, const char *token, std::string description) 158 { 159 queryAtoms(param, token, description); 160 } 161 162 template <> void Dialog::query<const molecule *>(Parameter<const molecule *> ¶m, const char *token, std::string description) 163 { 164 queryMolecule(param, token, description); 165 } 166 167 template <> void Dialog::query< std::vector<const molecule *> >(Parameter<std::vector<const molecule *> > ¶m, const char *token, std::string description) 168 { 169 queryMolecules(param, token, description); 170 } 171 172 template <> void Dialog::query<Vector>(Parameter<Vector> ¶m, const char *token, std::string description) 173 { 174 queryVector(param, token, false, description); 175 } 176 177 template <> void Dialog::query< std::vector<Vector> >(Parameter<std::vector<Vector> > ¶m, const char *token, std::string description) 178 { 179 queryVectors(param, token, false, description); 180 } 181 182 template <> void Dialog::query<BoxVector>(Parameter<BoxVector> ¶m, const char *token, std::string description) 183 { 184 ASSERT(0, "TODO: query<BoxVector>"); 185 //queryVector(param, token, true, description); 186 } 187 188 template <> void Dialog::query< std::vector<BoxVector> >(Parameter<std::vector<BoxVector> > ¶m, const char *token, std::string description) 189 { 190 ASSERT(0, "TODO: query<vector<BoxVector> >"); 191 //queryVectors(param, token, true, description); 192 } 193 194 template <> void Dialog::query<RealSpaceMatrix>(Parameter<RealSpaceMatrix> ¶m, const char *token, std::string description) 195 { 196 queryRealSpaceMatrix(param, token, description); 197 } 198 199 template <> void Dialog::query<const element *>(Parameter<const element *> ¶m, const char *token, std::string description) 200 { 201 queryElement(param, token, description); 202 } 203 204 template <> void Dialog::query< std::vector<const element *> >(Parameter<std::vector<const element *> > ¶m, const char *token, std::string description) 205 { 206 queryElements(param, token, description); 207 } 208 209 template <> void Dialog::query< boost::filesystem::path >(Parameter<boost::filesystem::path> ¶m, const char *token, std::string description) 210 { 211 queryFile(param, token, description); 212 } 213 214 template <> void Dialog::query< RandomNumberDistribution_Parameters >(Parameter<RandomNumberDistribution_Parameters> ¶m, const char *token, std::string description) 215 { 216 queryRandomNumberDistribution_Parameters(param, token, description); 93 template <> void Dialog::query<bool>(const char *token, std::string description) 94 { 95 queryBoolean(token, description); 96 } 97 98 template <> void Dialog::query<int>(const char *token, std::string description) 99 { 100 queryInt(token, description); 101 } 102 103 template <> void Dialog::query< std::vector<int> >(const char *token, std::string description) 104 { 105 queryInts(token, description); 106 } 107 108 template <> void Dialog::query<unsigned int>(const char *token, std::string description) 109 { 110 queryUnsignedInt(token, description); 111 } 112 113 template <> void Dialog::query< std::vector<unsigned int> >(const char *token, std::string description) 114 { 115 queryUnsignedInts(token, description); 116 } 117 118 template <> void Dialog::query<double>(const char *token, std::string description) 119 { 120 queryDouble(token, description); 121 } 122 123 template <> void Dialog::query< std::vector<double> >(const char *token, std::string description) 124 { 125 queryDoubles(token, description); 126 } 127 128 template <> void Dialog::query<std::string>(const char *token, std::string description) 129 { 130 queryString(token, description); 131 } 132 133 template <> void Dialog::query< std::vector<std::string> >(const char *token, std::string description) 134 { 135 queryStrings(token, description); 136 } 137 138 template <> void Dialog::query<const atom *>(const char *token, std::string description) 139 { 140 queryAtom(token, description); 141 } 142 143 template <> void Dialog::query< std::vector<const atom *> >(const char *token, std::string description) 144 { 145 queryAtoms(token, description); 146 } 147 148 template <> void Dialog::query<const molecule *>(const char *token, std::string description) 149 { 150 queryMolecule(token, description); 151 } 152 153 template <> void Dialog::query< std::vector<const molecule *> >(const char *token, std::string description) 154 { 155 queryMolecules(token, description); 156 } 157 158 template <> void Dialog::query<Vector>(const char *token, std::string description) 159 { 160 queryVector(token, false, description); 161 } 162 163 template <> void Dialog::query< std::vector<Vector> >(const char *token, std::string description) 164 { 165 queryVectors(token, false, description); 166 } 167 168 template <> void Dialog::query<BoxVector>(const char *token, std::string description) 169 { 170 queryVector(token, true, description); 171 } 172 173 template <> void Dialog::query< std::vector<BoxVector> >(const char *token, std::string description) 174 { 175 queryVectors(token, true, description); 176 } 177 178 template <> void Dialog::query<Box>(const char *token, std::string description) 179 { 180 queryBox(token, description); 181 } 182 183 template <> void Dialog::query<const element *>(const char *token, std::string description) 184 { 185 queryElement(token, description); 186 } 187 188 template <> void Dialog::query< std::vector<const element *> >(const char *token, std::string description) 189 { 190 queryElements(token, description); 191 } 192 193 template <> void Dialog::query< boost::filesystem::path >(const char *token, std::string description) 194 { 195 queryFile(token, description); 196 } 197 198 template <> void Dialog::query< std::vector<boost::filesystem::path> >(const char *token, std::string description) 199 { 200 queryFiles(token, description); 201 } 202 203 template <> void Dialog::query< RandomNumberDistribution_Parameters >(const char *token, std::string description) 204 { 205 queryRandomNumberDistribution_Parameters(token, description); 217 206 } 218 207
Note:
See TracChangeset
for help on using the changeset viewer.