MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / loadProject

Method loadProject

MiniZincIDE/mainwindow.cpp:2213–2241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2211}
2212
2213void 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
2243void MainWindow::on_actionSave_project_triggered()
2244{

Callers

nothing calls this directly

Calls 6

isHiddenMethod · 0.80
openTabMethod · 0.80
countMethod · 0.80
setModifiedMethod · 0.80
projectFileMethod · 0.80

Tested by

no test coverage detected