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

Method setInputOutputCombo_

src/openms_gui/source/VISUAL/DIALOGS/ToolsDialog.cpp:161–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159 }
160
161 void ToolsDialog::setInputOutputCombo_(const Param &p)
162 {
163 String str;
164 QStringList input_list("<select>");
165 QStringList output_list("<select>");
166 bool outRequired = false;
167 for (Param::ParamIterator iter = p.begin(); iter != p.end(); ++iter)
168 {
169 // iter.getName() is either of form "ToolName:1:ItemName" or "ToolName:1:NodeName:[...]:ItemName".
170 // Cut off "ToolName:1:"
171 str = iter.getName().substr(iter.getName().rfind("1:") + 2, iter.getName().size());
172 // Only add items and no nodes
173 if (!str.empty() && str.find(":") == String::npos)
174 {
175 // Only add to input list if item has "input file" tag.
176 if (iter->tags.find("input file") != iter->tags.end())
177 {
178 input_list << QStringList(str.c_str());
179 }
180 // Only add to output list if item has "output file" tag.
181 else if (iter->tags.find("output file") != iter->tags.end())
182 {
183 output_list << QStringList(str.c_str());
184 // Check whether the item has a required tag i.e. is mandatory.
185 outRequired = (outRequired) || (iter->tags.find("required") != iter->tags.end());
186 }
187 }
188 }
189 // Clear and set input combo box
190 input_combo_->clear();
191 output_combo_->clear();
192 input_combo_->addItems(input_list);
193 Int pos = input_list.indexOf("in");
194 if (pos != -1)
195 {
196 input_combo_->setCurrentIndex(pos);
197 }
198 // Clear and set output combo box
199 output_combo_->addItems(output_list);
200 pos = output_list.indexOf("out");
201 if (pos != -1 && getTool() != "FileInfo" && outRequired)
202 {
203 output_combo_->setCurrentIndex(pos);
204 }
205 }
206
207 QStringList ToolsDialog::createToolsList_()
208 {

Callers

nothing calls this directly

Calls 10

substrMethod · 0.80
setCurrentIndexMethod · 0.80
QStringListClass · 0.50
beginMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected