| 2478 | } |
| 2479 | |
| 2480 | void MainWindow::check_code() |
| 2481 | { |
| 2482 | auto sc = getCurrentSolverConfig(); |
| 2483 | if (!MznDriver::get().isValid() || !ui->actionRun->isEnabled() || |
| 2484 | !curEditor || (!curEditor->filepath.isEmpty() && !curEditor->filepath.endsWith(".mzn")) || |
| 2485 | !sc) { |
| 2486 | return; |
| 2487 | } |
| 2488 | auto contents = curEditor->document()->toPlainText(); |
| 2489 | auto wd = QFileInfo(curEditor->filepath).absolutePath(); |
| 2490 | code_checker->start(contents, *sc, wd); |
| 2491 | } |
| 2492 | |
| 2493 | void MainWindow::setTheme(const Theme& theme, bool dark) |
| 2494 | { |