| 330 | } |
| 331 | |
| 332 | void OutputSettings::showEvent(QShowEvent *) |
| 333 | { |
| 334 | auto config = Config::Current(); |
| 335 | |
| 336 | // Enable Output (Main & Preview) settings as long as Main Output can be supported. |
| 337 | |
| 338 | if (main_output_is_supported()) { |
| 339 | ui->mainOutputGroupBox->setEnabled(true); |
| 340 | ui->previewOutputGroupBox->setEnabled(true); |
| 341 | } else { |
| 342 | ui->mainOutputGroupBox->setEnabled(false); |
| 343 | ui->previewOutputGroupBox->setEnabled(false); |
| 344 | } |
| 345 | |
| 346 | ui->mainOutputGroupBox->setChecked(config->OutputEnabled); |
| 347 | ui->mainOutputName->setText(config->OutputName); |
| 348 | ui->mainOutputGroups->setText(config->OutputGroups); |
| 349 | |
| 350 | auto lastError = main_output_last_error(); |
| 351 | ui->mainOutputLastError->setText(lastError); |
| 352 | if (lastError.isEmpty()) { |
| 353 | ui->mainOutputLastError->setFixedHeight(0); // don't waste dialog space if error is no longer valid. |
| 354 | } else { |
| 355 | ui->mainOutputLastError->setFixedHeight(ui->mainOutputLastError->sizeHint().height()); |
| 356 | } |
| 357 | |
| 358 | ui->previewOutputGroupBox->setChecked(config->PreviewOutputEnabled); |
| 359 | ui->previewOutputName->setText(config->PreviewOutputName); |
| 360 | ui->previewOutputGroups->setText(config->PreviewOutputGroups); |
| 361 | |
| 362 | ui->tallyProgramCheckBox->setChecked(config->TallyProgramEnabled); |
| 363 | ui->tallyPreviewCheckBox->setChecked(config->TallyPreviewEnabled); |
| 364 | |
| 365 | ui->checkBoxAutoCheckForUpdates->setChecked(config->AutoCheckForUpdates()); |
| 366 | } |
| 367 | |
| 368 | void OutputSettings::toggleShowHide() |
| 369 | { |
nothing calls this directly
no test coverage detected