MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / add_

Method add_

src/openms_gui/source/VISUAL/VISUALIZER/MetaInfoVisualizer.cpp:180–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 void MetaInfoVisualizer::add_()
181 {
182 String name(newkey_->text());
183 String description(newdescription_->text());
184 String value(newvalue_->text());
185
186
187 if (name.trim().length() == 0) //Must have a name
188 {
189 return;
190 }
191
192 //Register new entry and update metainfointerface object
193 UInt newindex = temp_.metaRegistry().registerName(name, description, "");
194
195 //Store new data in temporary metainfo object
196 temp_.setMetaValue(newindex, value);
197 temp_.getKeys(keys_);
198
199
200 //Update viewlayout_
201 try
202 {
203 //check whether there is already an entry in GUI for added metainfo.
204 //If index already exists, return and do nothing.
205 if (buttongroup_->button(newindex) != nullptr)
206 {
207 return;
208 }
209
210 loadData_(newindex);
211
212 }
213 catch (exception & e)
214 {
215 std::cout << "Error while trying to create new meta info data. " << e.what() << endl;
216 }
217 }
218
219 void MetaInfoVisualizer::clear_()
220 {

Callers

nothing calls this directly

Calls 3

registerNameMethod · 0.80
setMetaValueMethod · 0.45
getKeysMethod · 0.45

Tested by

no test coverage detected