A bit more clang-format
This commit is contained in:
@@ -28,15 +28,16 @@ extern "C" {
|
||||
#include "qt_deviceconfig.hpp"
|
||||
#include "qt_models_common.hpp"
|
||||
|
||||
SettingsOtherPeripherals::SettingsOtherPeripherals(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SettingsOtherPeripherals)
|
||||
SettingsOtherPeripherals::SettingsOtherPeripherals(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::SettingsOtherPeripherals)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
onCurrentMachineChanged(machine);
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::onCurrentMachineChanged(int machineId)
|
||||
void
|
||||
SettingsOtherPeripherals::onCurrentMachineChanged(int machineId)
|
||||
{
|
||||
this->machineId = machineId;
|
||||
|
||||
@@ -52,9 +53,9 @@ void SettingsOtherPeripherals::onCurrentMachineChanged(int machineId)
|
||||
ui->comboBoxCard4->clear();
|
||||
ui->comboBoxRTC->clear();
|
||||
|
||||
auto* model = ui->comboBoxRTC->model();
|
||||
int d = 0;
|
||||
int selectedRow = 0;
|
||||
auto *model = ui->comboBoxRTC->model();
|
||||
int d = 0;
|
||||
int selectedRow = 0;
|
||||
while (true) {
|
||||
QString name = DeviceConfig::DeviceName(isartc_get_device(d), isartc_get_internal_name(d), 0);
|
||||
if (name.isEmpty()) {
|
||||
@@ -74,9 +75,9 @@ void SettingsOtherPeripherals::onCurrentMachineChanged(int machineId)
|
||||
ui->comboBoxRTC->setCurrentIndex(selectedRow);
|
||||
|
||||
for (int c = 0; c < ISAMEM_MAX; c++) {
|
||||
auto* cbox = findChild<QComboBox*>(QString("comboBoxCard%1").arg(c + 1));
|
||||
model = cbox->model();
|
||||
d = 0;
|
||||
auto *cbox = findChild<QComboBox *>(QString("comboBoxCard%1").arg(c + 1));
|
||||
model = cbox->model();
|
||||
d = 0;
|
||||
selectedRow = 0;
|
||||
while (true) {
|
||||
QString name = DeviceConfig::DeviceName(isamem_get_device(d), isamem_get_internal_name(d), 0);
|
||||
@@ -97,7 +98,7 @@ void SettingsOtherPeripherals::onCurrentMachineChanged(int machineId)
|
||||
cbox->setCurrentIndex(-1);
|
||||
cbox->setCurrentIndex(selectedRow);
|
||||
cbox->setEnabled(machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
findChild<QPushButton*>(QString("pushButtonConfigureCard%1").arg(c + 1))->setEnabled(isamem_type[c] != 0 && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
findChild<QPushButton *>(QString("pushButtonConfigureCard%1").arg(c + 1))->setEnabled(isamem_type[c] != 0 && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,70 +107,92 @@ SettingsOtherPeripherals::~SettingsOtherPeripherals()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::save() {
|
||||
void
|
||||
SettingsOtherPeripherals::save()
|
||||
{
|
||||
/* Other peripherals category */
|
||||
bugger_enabled = ui->checkBoxISABugger->isChecked() ? 1 : 0;
|
||||
bugger_enabled = ui->checkBoxISABugger->isChecked() ? 1 : 0;
|
||||
postcard_enabled = ui->checkBoxPOSTCard->isChecked() ? 1 : 0;
|
||||
isartc_type = ui->comboBoxRTC->currentData().toInt();
|
||||
isartc_type = ui->comboBoxRTC->currentData().toInt();
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (int i = 0; i < ISAMEM_MAX; i++) {
|
||||
auto* cbox = findChild<QComboBox*>(QString("comboBoxCard%1").arg(i + 1));
|
||||
auto *cbox = findChild<QComboBox *>(QString("comboBoxCard%1").arg(i + 1));
|
||||
isamem_type[i] = cbox->currentData().toInt();
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_comboBoxRTC_currentIndexChanged(int index) {
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxRTC_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
ui->pushButtonConfigureRTC->setEnabled(index != 0 && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureRTC_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isartc_get_device(ui->comboBoxRTC->currentData().toInt()), 0, qobject_cast<Settings*>(Settings::settings));
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureRTC_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isartc_get_device(ui->comboBoxRTC->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_comboBoxCard1_currentIndexChanged(int index) {
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxCard1_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
ui->pushButtonConfigureCard1->setEnabled(index != 0 && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureCard1_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard1->currentData().toInt()), 1, qobject_cast<Settings*>(Settings::settings));
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureCard1_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard1->currentData().toInt()), 1, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_comboBoxCard2_currentIndexChanged(int index) {
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxCard2_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
ui->pushButtonConfigureCard2->setEnabled(index != 0 && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureCard2_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard2->currentData().toInt()), 2, qobject_cast<Settings*>(Settings::settings));
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureCard2_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard2->currentData().toInt()), 2, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_comboBoxCard3_currentIndexChanged(int index) {
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxCard3_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
ui->pushButtonConfigureCard3->setEnabled(index != 0 && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureCard3_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard3->currentData().toInt()), 3, qobject_cast<Settings*>(Settings::settings));
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureCard3_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard3->currentData().toInt()), 3, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_comboBoxCard4_currentIndexChanged(int index) {
|
||||
void
|
||||
SettingsOtherPeripherals::on_comboBoxCard4_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
ui->pushButtonConfigureCard4->setEnabled(index != 0 && machine_has_bus(machineId, MACHINE_BUS_ISA));
|
||||
}
|
||||
|
||||
void SettingsOtherPeripherals::on_pushButtonConfigureCard4_clicked() {
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard4->currentData().toInt()), 4, qobject_cast<Settings*>(Settings::settings));
|
||||
void
|
||||
SettingsOtherPeripherals::on_pushButtonConfigureCard4_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard4->currentData().toInt()), 4, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user