mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 21:43:16 -07:00
A bit more clang-format
This commit is contained in:
@@ -30,9 +30,9 @@ extern "C" {
|
||||
#include "qt_deviceconfig.hpp"
|
||||
#include "qt_models_common.hpp"
|
||||
|
||||
SettingsDisplay::SettingsDisplay(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SettingsDisplay)
|
||||
SettingsDisplay::SettingsDisplay(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::SettingsDisplay)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -44,22 +44,26 @@ SettingsDisplay::~SettingsDisplay()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SettingsDisplay::save() {
|
||||
gfxcard = ui->comboBoxVideo->currentData().toInt();
|
||||
gfxcard_2 = ui->comboBoxVideoSecondary->currentData().toInt();
|
||||
voodoo_enabled = ui->checkBoxVoodoo->isChecked() ? 1 : 0;
|
||||
void
|
||||
SettingsDisplay::save()
|
||||
{
|
||||
gfxcard = ui->comboBoxVideo->currentData().toInt();
|
||||
gfxcard_2 = ui->comboBoxVideoSecondary->currentData().toInt();
|
||||
voodoo_enabled = ui->checkBoxVoodoo->isChecked() ? 1 : 0;
|
||||
ibm8514_enabled = ui->checkBox8514->isChecked() ? 1 : 0;
|
||||
xga_enabled = ui->checkBoxXga->isChecked() ? 1 : 0;
|
||||
xga_enabled = ui->checkBoxXga->isChecked() ? 1 : 0;
|
||||
}
|
||||
|
||||
void SettingsDisplay::onCurrentMachineChanged(int machineId) {
|
||||
void
|
||||
SettingsDisplay::onCurrentMachineChanged(int machineId)
|
||||
{
|
||||
// win_settings_video_proc, WM_INITDIALOG
|
||||
this->machineId = machineId;
|
||||
|
||||
auto* model = ui->comboBoxVideo->model();
|
||||
auto removeRows = model->rowCount();
|
||||
auto *model = ui->comboBoxVideo->model();
|
||||
auto removeRows = model->rowCount();
|
||||
|
||||
int c = 0;
|
||||
int c = 0;
|
||||
int selectedRow = 0;
|
||||
while (true) {
|
||||
/* Skip "internal" if machine doesn't have it. */
|
||||
@@ -68,14 +72,13 @@ void SettingsDisplay::onCurrentMachineChanged(int machineId) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const device_t* video_dev = video_card_getdevice(c);
|
||||
QString name = DeviceConfig::DeviceName(video_dev, video_get_internal_name(c), 1);
|
||||
const device_t *video_dev = video_card_getdevice(c);
|
||||
QString name = DeviceConfig::DeviceName(video_dev, video_get_internal_name(c), 1);
|
||||
if (name.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (video_card_available(c) &&
|
||||
device_is_valid(video_dev, machineId)) {
|
||||
if (video_card_available(c) && device_is_valid(video_dev, machineId)) {
|
||||
int row = Models::AddEntry(model, name, c);
|
||||
if (c == gfxcard) {
|
||||
selectedRow = row - removeRows;
|
||||
@@ -97,27 +100,36 @@ void SettingsDisplay::onCurrentMachineChanged(int machineId) {
|
||||
ui->pushButtonConfigureSecondary->setEnabled(true);
|
||||
}
|
||||
ui->comboBoxVideo->setCurrentIndex(selectedRow);
|
||||
if (gfxcard_2 == 0) ui->pushButtonConfigureSecondary->setEnabled(false);
|
||||
if (gfxcard_2 == 0)
|
||||
ui->pushButtonConfigureSecondary->setEnabled(false);
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_pushButtonConfigure_clicked() {
|
||||
auto* device = video_card_getdevice(ui->comboBoxVideo->currentData().toInt());
|
||||
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings*>(Settings::settings));
|
||||
void
|
||||
SettingsDisplay::on_pushButtonConfigure_clicked()
|
||||
{
|
||||
auto *device = video_card_getdevice(ui->comboBoxVideo->currentData().toInt());
|
||||
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_pushButtonConfigureVoodoo_clicked() {
|
||||
DeviceConfig::ConfigureDevice(&voodoo_device, 0, qobject_cast<Settings*>(Settings::settings));
|
||||
void
|
||||
SettingsDisplay::on_pushButtonConfigureVoodoo_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(&voodoo_device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_pushButtonConfigureXga_clicked() {
|
||||
void
|
||||
SettingsDisplay::on_pushButtonConfigureXga_clicked()
|
||||
{
|
||||
if (machine_has_bus(machineId, MACHINE_BUS_MCA) > 0) {
|
||||
DeviceConfig::ConfigureDevice(&xga_device, 0, qobject_cast<Settings*>(Settings::settings));
|
||||
DeviceConfig::ConfigureDevice(&xga_device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||
} else {
|
||||
DeviceConfig::ConfigureDevice(&xga_isa_device, 0, qobject_cast<Settings*>(Settings::settings));
|
||||
DeviceConfig::ConfigureDevice(&xga_isa_device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) {
|
||||
void
|
||||
SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
@@ -132,7 +144,7 @@ void SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) {
|
||||
ui->pushButtonConfigureVoodoo->setEnabled(machineHasPci && ui->checkBoxVoodoo->isChecked());
|
||||
|
||||
bool hasIsa16 = machine_has_bus(machineId, MACHINE_BUS_ISA16) > 0;
|
||||
bool has_MCA = machine_has_bus(machineId, MACHINE_BUS_MCA) > 0;
|
||||
bool has_MCA = machine_has_bus(machineId, MACHINE_BUS_MCA) > 0;
|
||||
ui->checkBox8514->setEnabled(hasIsa16 || has_MCA);
|
||||
if (hasIsa16 || has_MCA) {
|
||||
ui->checkBox8514->setChecked(ibm8514_enabled);
|
||||
@@ -156,39 +168,41 @@ void SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) {
|
||||
return;
|
||||
}
|
||||
while (true) {
|
||||
const device_t* video_dev = video_card_getdevice(c);
|
||||
QString name = DeviceConfig::DeviceName(video_dev, video_get_internal_name(c), 1);
|
||||
const device_t *video_dev = video_card_getdevice(c);
|
||||
QString name = DeviceConfig::DeviceName(video_dev, video_get_internal_name(c), 1);
|
||||
if (name.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (video_card_available(c) &&
|
||||
device_is_valid(video_dev, machineId) &&
|
||||
!(video_card_get_flags(c) == video_card_get_flags(videoCard))) {
|
||||
ui->comboBoxVideoSecondary->addItem(name, c);
|
||||
if (c == gfxcard_2)
|
||||
ui->comboBoxVideoSecondary->setCurrentIndex(ui->comboBoxVideoSecondary->count() - 1);
|
||||
if (video_card_available(c) && device_is_valid(video_dev, machineId) && !(video_card_get_flags(c) == video_card_get_flags(videoCard))) {
|
||||
ui->comboBoxVideoSecondary->addItem(name, c);
|
||||
if (c == gfxcard_2)
|
||||
ui->comboBoxVideoSecondary->setCurrentIndex(ui->comboBoxVideoSecondary->count() - 1);
|
||||
}
|
||||
|
||||
c++;
|
||||
}
|
||||
|
||||
if (gfxcard_2 == 0 || (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0))
|
||||
{
|
||||
if (gfxcard_2 == 0 || (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0)) {
|
||||
ui->comboBoxVideoSecondary->setCurrentIndex(0);
|
||||
ui->pushButtonConfigureSecondary->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_checkBoxVoodoo_stateChanged(int state) {
|
||||
void
|
||||
SettingsDisplay::on_checkBoxVoodoo_stateChanged(int state)
|
||||
{
|
||||
ui->pushButtonConfigureVoodoo->setEnabled(state == Qt::Checked);
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_checkBoxXga_stateChanged(int state) {
|
||||
void
|
||||
SettingsDisplay::on_checkBoxXga_stateChanged(int state)
|
||||
{
|
||||
ui->pushButtonConfigureXga->setEnabled(state == Qt::Checked);
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_comboBoxVideoSecondary_currentIndexChanged(int index)
|
||||
void
|
||||
SettingsDisplay::on_comboBoxVideoSecondary_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 0) {
|
||||
ui->pushButtonConfigureSecondary->setEnabled(false);
|
||||
@@ -198,10 +212,9 @@ void SettingsDisplay::on_comboBoxVideoSecondary_currentIndexChanged(int index)
|
||||
ui->pushButtonConfigureSecondary->setEnabled(index != 0 && video_card_has_config(videoCard) > 0);
|
||||
}
|
||||
|
||||
|
||||
void SettingsDisplay::on_pushButtonConfigureSecondary_clicked()
|
||||
void
|
||||
SettingsDisplay::on_pushButtonConfigureSecondary_clicked()
|
||||
{
|
||||
auto* device = video_card_getdevice(ui->comboBoxVideoSecondary->currentData().toInt());
|
||||
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings*>(Settings::settings));
|
||||
auto *device = video_card_getdevice(ui->comboBoxVideoSecondary->currentData().toInt());
|
||||
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user