| 410 | } |
| 411 | |
| 412 | bool MainWindow::closeProjectConfig() |
| 413 | { |
| 414 | if (_projectConfig) { |
| 415 | // Ask the question only if projet is currently open |
| 416 | QMessageBox::StandardButton userReply; |
| 417 | userReply = QMessageBox::question( |
| 418 | this, "Close Project", "Do you want to close current project?", QMessageBox::Yes | QMessageBox::No); |
| 419 | if (userReply == QMessageBox::No) { |
| 420 | return false; |
| 421 | } |
| 422 | |
| 423 | _ui->actionStop->trigger(); |
| 424 | |
| 425 | _projectConfig->clearGraphView(); |
| 426 | if (_projectConfig.get()->isVisible()) { |
| 427 | _projectConfig.get()->parentWidget()->close(); |
| 428 | } |
| 429 | _projectConfig.reset(); |
| 430 | _projectFile.clear(); |
| 431 | _projectName.clear(); |
| 432 | |
| 433 | _ui->actionClose->setDisabled(true); |
| 434 | _ui->actionStart->setDisabled(true); |
| 435 | _ui->actionSave->setDisabled(true); |
| 436 | _ui->actionSaveAs->setDisabled(true); |
| 437 | _ui->actionStop->setDisabled(true); |
| 438 | _ui->actionSimulation->setDisabled(true); |
| 439 | _toolBar->toolClose->setDisabled(true); |
| 440 | _toolBar->toolStart->setDisabled(true); |
| 441 | _toolBar->toolSave->setDisabled(true); |
| 442 | _toolBar->toolSaveAs->setDisabled(true); |
| 443 | _toolBar->toolSimulation->setDisabled(true); |
| 444 | _toolBar->toolStop->setDisabled(true); |
| 445 | |
| 446 | _ui->mdiArea->hide(); |
| 447 | refreshRecentProjects(); |
| 448 | _ui->startScreenWidget->show(); |
| 449 | } |
| 450 | |
| 451 | return true; |
| 452 | } |
| 453 | |
| 454 | bool MainWindow::createProjectConfig(const QString& name) |
| 455 | { |
nothing calls this directly
no test coverage detected