| 850 | } |
| 851 | |
| 852 | void MainWindow::runModalTask(Task* task) |
| 853 | { |
| 854 | connect(task, &Task::failed, |
| 855 | [this](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show(); }); |
| 856 | connect(task, &Task::succeeded, [this, task]() { |
| 857 | QStringList warnings = task->warnings(); |
| 858 | if (warnings.count()) { |
| 859 | CustomMessageBox::selectable(this, tr("Warnings"), warnings.join('\n'), QMessageBox::Warning)->show(); |
| 860 | } |
| 861 | }); |
| 862 | connect(task, &Task::aborted, [this] { |
| 863 | CustomMessageBox::selectable(this, tr("Task aborted"), tr("The task has been aborted by the user."), QMessageBox::Information) |
| 864 | ->show(); |
| 865 | }); |
| 866 | ProgressDialog loadDialog(this); |
| 867 | loadDialog.setSkipButton(true, tr("Abort")); |
| 868 | loadDialog.execWithTask(task); |
| 869 | } |
| 870 | |
| 871 | void MainWindow::instanceFromInstanceTask(InstanceTask* rawTask) |
| 872 | { |
nothing calls this directly
no test coverage detected