| 297 | } |
| 298 | |
| 299 | void MainWindow::updateUiProcessRunning(bool pr) |
| 300 | { |
| 301 | processRunning = pr; |
| 302 | |
| 303 | if (processRunning) { |
| 304 | fakeRunAction->setEnabled(true); |
| 305 | ui->actionRun->setEnabled(false); |
| 306 | ui->actionProfile_compilation->setEnabled(false); |
| 307 | ui->actionProfile_search->setEnabled(false); |
| 308 | fakeCompileAction->setEnabled(true); |
| 309 | ui->actionCompile->setEnabled(false); |
| 310 | fakeStopAction->setEnabled(false); |
| 311 | ui->actionStop->setEnabled(true); |
| 312 | runButton->removeAction(ui->actionRun); |
| 313 | runButton->setDefaultAction(ui->actionStop); |
| 314 | ui->actionSubmit_to_MOOC->setEnabled(false); |
| 315 | } else { |
| 316 | bool isPlayground = false; |
| 317 | bool isMzn = false; |
| 318 | bool isFzn = false; |
| 319 | bool isData = false; |
| 320 | if (curEditor) { |
| 321 | isPlayground = curEditor->filepath==""; |
| 322 | isMzn = (isPlayground && !curEditor->filename.endsWith(".fzn")) || QFileInfo(curEditor->filepath).suffix()=="mzn"; |
| 323 | isFzn = QFileInfo(curEditor->filepath).suffix()=="fzn" || curEditor->filename.endsWith(".fzn"); |
| 324 | isData = QFileInfo(curEditor->filepath).suffix()=="dzn" || QFileInfo(curEditor->filepath).suffix()=="json"; |
| 325 | } |
| 326 | fakeRunAction->setEnabled(! (isMzn || isFzn || isData)); |
| 327 | ui->actionRun->setEnabled(isMzn || isFzn || isData); |
| 328 | ui->actionProfile_compilation->setEnabled(isMzn || isData); |
| 329 | ui->actionProfile_search->setEnabled(isMzn || isFzn || isData); |
| 330 | fakeCompileAction->setEnabled(!(isMzn||isData)); |
| 331 | ui->actionCompile->setEnabled(isMzn||isData); |
| 332 | fakeStopAction->setEnabled(true); |
| 333 | ui->actionStop->setEnabled(false); |
| 334 | runButton->removeAction(ui->actionStop); |
| 335 | runButton->setDefaultAction(ui->actionRun); |
| 336 | ui->actionSubmit_to_MOOC->setEnabled(true); |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | MainWindow::~MainWindow() |
| 341 | { |
nothing calls this directly
no outgoing calls
no test coverage detected