qt: Disable the cassette checkbox on machines without a cassette port

This commit is contained in:
Alexander Babikov
2023-06-29 04:05:17 +05:00
parent feb6a835d2
commit 4fbfefb881

View File

@@ -40,8 +40,6 @@ SettingsStorageControllers::SettingsStorageControllers(QWidget *parent)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->checkBoxCassette->setChecked(cassette_enable > 0);
onCurrentMachineChanged(machine); onCurrentMachineChanged(machine);
} }
@@ -198,6 +196,14 @@ SettingsStorageControllers::onCurrentMachineChanged(int machineId)
ui->checkBoxQuaternaryIDE->setEnabled(is_at > 0); ui->checkBoxQuaternaryIDE->setEnabled(is_at > 0);
ui->checkBoxTertiaryIDE->setChecked(ui->checkBoxTertiaryIDE->isEnabled() && ide_ter_enabled); ui->checkBoxTertiaryIDE->setChecked(ui->checkBoxTertiaryIDE->isEnabled() && ide_ter_enabled);
ui->checkBoxQuaternaryIDE->setChecked(ui->checkBoxQuaternaryIDE->isEnabled() && ide_qua_enabled); ui->checkBoxQuaternaryIDE->setChecked(ui->checkBoxQuaternaryIDE->isEnabled() && ide_qua_enabled);
if (machine_has_bus(machineId, MACHINE_BUS_CASSETTE)) {
ui->checkBoxCassette->setChecked(cassette_enable > 0);
ui->checkBoxCassette->setEnabled(true);
} else {
ui->checkBoxCassette->setChecked(false);
ui->checkBoxCassette->setEnabled(false);
}
} }
void void