| 186 | } |
| 187 | |
| 188 | void TOPPASToolVertex::editParam() |
| 189 | { |
| 190 | // use a copy for editing |
| 191 | Param edit_param(param_); |
| 192 | |
| 193 | QVector<String> hidden_entries; |
| 194 | // remove entries that are handled by edges already, user should not see them |
| 195 | QVector<IOInfo> input_infos; |
| 196 | getInputParameters(input_infos); |
| 197 | for (ConstEdgeIterator it = inEdgesBegin(); it != inEdgesEnd(); ++it) |
| 198 | { |
| 199 | int index = (*it)->getTargetInParam(); |
| 200 | if (index < 0) |
| 201 | { |
| 202 | continue; |
| 203 | } |
| 204 | |
| 205 | const String& name = input_infos[index].param_name; |
| 206 | if (edit_param.exists(name)) |
| 207 | { |
| 208 | hidden_entries.push_back(name); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | QVector<IOInfo> output_infos; |
| 213 | getOutputParameters(output_infos); |
| 214 | for (ConstEdgeIterator it = outEdgesBegin(); it != outEdgesEnd(); ++it) |
| 215 | { |
| 216 | int index = (*it)->getSourceOutParam(); |
| 217 | if (index < 0) |
| 218 | { |
| 219 | continue; |
| 220 | } |
| 221 | |
| 222 | const String& name = output_infos[index].param_name; |
| 223 | if (edit_param.exists(name)) |
| 224 | { |
| 225 | hidden_entries.push_back(name); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | // remove entries explained by edges |
| 230 | foreach(const String &name, hidden_entries) |
| 231 | { |
| 232 | edit_param.remove(name); |
| 233 | } |
| 234 | |
| 235 | // edit_param no longer contains tool description, take it from the node tooltip |
| 236 | QWidget* parent_widget = qobject_cast<QWidget*>(scene()->parent()); |
| 237 | String default_dir; |
| 238 | TOPPASToolConfigDialog dialog(parent_widget, edit_param, default_dir, name_, type_, toolTip(), hidden_entries); |
| 239 | if (dialog.exec()) |
| 240 | { |
| 241 | // take new values |
| 242 | param_.update(edit_param); |
| 243 | reset(true); |
| 244 | emit parameterChanged(doesParamChangeInvalidate_()); |
| 245 | } |
no test coverage detected