Changes in src/UIElements/Dialog.cpp [5605032:6d574a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Dialog.cpp
r5605032 r6d574a 6 6 */ 7 7 8 #include <cassert> 9 10 #include "UIElements/Dialog.hpp" 11 8 #include "Helpers/MemDebug.hpp" 9 10 #include "Dialog.hpp" 11 12 #include "atom.hpp" 13 #include "element.hpp" 14 #include "molecule.hpp" 12 15 #include "vector.hpp" 13 16 … … 36 39 retval &= (*iter)->handle(); 37 40 // if any query fails (is canceled), we can end the handling process 38 if(!retval) 41 if(!retval) { 42 DoeLog(1) && (eLog() << Verbose(1) << "The following query failed: " << (**iter).getTitle() << "." << endl); 39 43 break; 44 } 40 45 } 41 46 if (retval){ … … 51 56 52 57 // Base class 53 Dialog::Query::Query(string _title) : 54 title(_title) 58 Dialog::Query::Query(string _title, string _description) : 59 title(_title), 60 description(_description) 55 61 {} 56 62 … … 61 67 } 62 68 69 const std::string Dialog::Query::getDescription() const{ 70 return description; 71 } 72 // empty Queries 73 74 Dialog::EmptyQuery::EmptyQuery(string title, std::string description) : 75 Query(title, description) 76 {} 77 78 Dialog::EmptyQuery::~EmptyQuery() {} 79 80 void Dialog::EmptyQuery::setResult() { 81 } 82 63 83 // Int Queries 64 84 65 Dialog::IntQuery::IntQuery(string title,int *_target ) :66 Query(title ), target(_target)85 Dialog::IntQuery::IntQuery(string title,int *_target, std::string description) : 86 Query(title, description), target(_target) 67 87 {} 68 88 … … 73 93 } 74 94 95 // Int Queries 96 97 Dialog::BooleanQuery::BooleanQuery(string title,bool *_target, std::string description) : 98 Query(title, description), target(_target) 99 {} 100 101 Dialog::BooleanQuery::~BooleanQuery() {} 102 103 void Dialog::BooleanQuery::setResult() { 104 *target = tmp; 105 } 106 75 107 // String Queries 76 108 77 Dialog::StringQuery::StringQuery(string title,string *_target ) :78 Query(title ), target(_target)109 Dialog::StringQuery::StringQuery(string title,string *_target, std::string _description) : 110 Query(title, _description), target(_target) 79 111 {} 80 112 … … 87 119 // Double Queries 88 120 89 Dialog::DoubleQuery::DoubleQuery(string title,double *_target ) :90 Query(title ), target(_target)121 Dialog::DoubleQuery::DoubleQuery(string title,double *_target, std::string _description) : 122 Query(title, _description), target(_target) 91 123 {} 92 124 … … 98 130 99 131 132 // Atom Queries 133 134 Dialog::AtomQuery::AtomQuery(string title, atom **_target, std::string _description) : 135 Query(title, _description), 136 tmp(0), 137 target(_target) 138 139 {} 140 141 Dialog::AtomQuery::~AtomQuery() {} 142 143 void Dialog::AtomQuery::setResult() { 144 *target = tmp; 145 } 146 100 147 // Molecule Queries 101 148 102 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules) :103 Query(title ),149 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) : 150 Query(title, _description), 104 151 tmp(0), 105 molecules(_molecules),106 152 target(_target) 107 153 … … 116 162 // Vector Queries 117 163 118 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check ) :119 Query(title ),164 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description) : 165 Query(title, _description), 120 166 cellSize(_cellSize), 121 167 check(_check), 122 168 target(_target) 123 169 { 124 tmp = new Vector();170 tmp = new Vector(); 125 171 } 126 172 … … 134 180 } 135 181 182 // Box Queries 183 184 Dialog::BoxQuery::BoxQuery(std::string title, double ** const _cellSize, std::string _description) : 185 Query(title, _description), 186 target(_cellSize) 187 { 188 tmp = new double[6]; 189 } 190 191 Dialog::BoxQuery::~BoxQuery() 192 { 193 delete[] tmp; 194 } 195 196 void Dialog::BoxQuery::setResult() { 197 for (int i=0;i<6;i++) { 198 (*target)[i] = tmp[i]; 199 } 200 } 201 136 202 // Element Queries 137 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target) : 138 Query(title), 139 tmp(0), 203 Dialog::ElementQuery::ElementQuery(std::string title, std::vector<element *> *_target, std::string _description) : 204 Query(title, _description), 140 205 target(_target) 141 206 {} … … 144 209 145 210 void Dialog::ElementQuery::setResult(){ 146 *target= tmp;147 } 211 *target=elements; 212 }
Note:
See TracChangeset
for help on using the changeset viewer.