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

Method loadINI_

src/openms_gui/source/VISUAL/DIALOGS/TOPPASToolConfigDialog.cpp:97–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 void TOPPASToolConfigDialog::loadINI_()
98 {
99 QString string;
100 filename_ = QFileDialog::getOpenFileName(this, tr("Open ini file"), default_dir_.c_str(), tr("ini files (*.ini);; all files (*.*)"));
101 //no file selected
102 if (filename_.isEmpty())
103 {
104 return;
105 }
106 if (!arg_param_.empty())
107 {
108 arg_param_.clear();
109 param_->clear();
110 editor_->clear();
111 }
112 try
113 {
114 ParamXMLFile paramFile;
115 paramFile.load(filename_.toStdString(), arg_param_);
116 }
117 catch (Exception::BaseException& e)
118 {
119 QMessageBox::critical(this, "Error", (String("Error loading INI file: ") + e.what()).c_str());
120 arg_param_.clear();
121 return;
122 }
123 //Extract the required parameters
124 *param_ = arg_param_.copy(tool_name_ + ":1:", true);
125 //param_->remove("log");
126 //param_->remove("no_progress");
127 //param_->remove("debug");
128
129 //remove parameters already explained by edges and the "type" parameter
130 foreach(const String &name, hidden_entries_)
131 {
132 param_->remove(name);
133 }
134
135 //load data into editor
136 editor_->load(*param_);
137 editor_->setModified(true);
138 }
139
140 void TOPPASToolConfigDialog::storeINI_()
141 {

Callers

nothing calls this directly

Calls 7

setModifiedMethod · 0.80
StringClass · 0.50
isEmptyMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45
loadMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected