| 2211 | } |
| 2212 | |
| 2213 | void MainWindow::loadProject(const QString& filepath) |
| 2214 | { |
| 2215 | try { |
| 2216 | auto& p = getProject(); |
| 2217 | auto warnings = p.loadProject(filepath, ui->config_window); |
| 2218 | if (ui->projectExplorerDockWidget->isHidden()) { |
| 2219 | on_actionShow_project_explorer_triggered(); |
| 2220 | } |
| 2221 | if (!warnings.empty()) { |
| 2222 | QMessageBox::warning(this, "MiniZinc IDE", |
| 2223 | warnings.join("\n"), |
| 2224 | QMessageBox::Ok); |
| 2225 | } |
| 2226 | |
| 2227 | int openTab = p.openTab(); |
| 2228 | auto openFiles = p.openFiles(); |
| 2229 | for (int i = 0; i < openFiles.count(); i++) { |
| 2230 | openFile(openFiles[i], false, i == openTab); |
| 2231 | } |
| 2232 | p.activeSolverConfigChanged(getCurrentSolverConfig()); |
| 2233 | p.setModified(false); |
| 2234 | IDE::instance()->projects.insert(p.projectFile(), this); |
| 2235 | updateRecentProjects(p.projectFile()); |
| 2236 | } catch (Exception& e) { |
| 2237 | QMessageBox::warning(this, "MiniZinc IDE", |
| 2238 | e.message(), |
| 2239 | QMessageBox::Ok); |
| 2240 | } |
| 2241 | } |
| 2242 | |
| 2243 | void MainWindow::on_actionSave_project_triggered() |
| 2244 | { |
nothing calls this directly
no test coverage detected