| 82 | } |
| 83 | |
| 84 | void ConfigWindow::loadConfigs(void) |
| 85 | { |
| 86 | try { |
| 87 | QStringList files; |
| 88 | QStringList warnings; |
| 89 | for (auto config : configs) { |
| 90 | if (!config->paramFile.isEmpty()) { |
| 91 | files.append(config->paramFile); |
| 92 | } |
| 93 | delete config; |
| 94 | } |
| 95 | configs.clear(); |
| 96 | for (auto* solver : MznDriver::get().solvers()) { |
| 97 | if (solver->hasAllRequiredFlags()) { |
| 98 | configs.append(new SolverConfiguration(*solver, true)); |
| 99 | } |
| 100 | } |
| 101 | if (!files.empty()) { |
| 102 | for (auto fileName : files) { |
| 103 | configs.append(new (SolverConfiguration) (SolverConfiguration::loadJSON(fileName, warnings))); |
| 104 | } |
| 105 | } |
| 106 | populateComboBox(); |
| 107 | updateGUI(true); |
| 108 | if (!warnings.empty()) { |
| 109 | QMessageBox::warning(this, "MiniZinc IDE", warnings.join("\n"), QMessageBox::Ok); |
| 110 | } |
| 111 | } catch (Exception& e) { |
| 112 | QMessageBox::warning(this, "Parameter configuration error", e.message(), QMessageBox::Ok); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | bool ConfigWindow::addConfig(const QString &fileName) |
| 117 | { |
no test coverage detected