Custom EDID UI
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "ui_qt_settingsdisplay.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFileDialog>
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
@@ -27,6 +28,7 @@ extern "C" {
|
||||
#include <86box/vid_8514a_device.h>
|
||||
#include <86box/vid_xga_device.h>
|
||||
#include <86box/vid_ps55da2.h>
|
||||
#include <86box/vid_ddc.h>
|
||||
}
|
||||
|
||||
#include "qt_deviceconfig.hpp"
|
||||
@@ -67,6 +69,9 @@ SettingsDisplay::save()
|
||||
ibm8514_standalone_enabled = ui->checkBox8514->isChecked() ? 1 : 0;
|
||||
xga_standalone_enabled = ui->checkBoxXga->isChecked() ? 1 : 0;
|
||||
da2_standalone_enabled = ui->checkBoxDa2->isChecked() ? 1 : 0;
|
||||
monitor_edid = ui->radioButtonCustom->isChecked() ? 1 : 0;
|
||||
|
||||
strncpy(monitor_edid_path, ui->lineEdit->fileName().toUtf8(), sizeof(monitor_edid_path) - 1);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -121,6 +126,11 @@ SettingsDisplay::onCurrentMachineChanged(int machineId)
|
||||
for (uint8_t i = 1; i < GFXCARD_MAX; i ++)
|
||||
if (gfxcard[i] == 0)
|
||||
ui->pushButtonConfigureVideoSecondary->setEnabled(false);
|
||||
|
||||
ui->radioButtonDefault->setChecked(monitor_edid == 0);
|
||||
ui->radioButtonCustom->setChecked(monitor_edid == 1);
|
||||
ui->lineEdit->setFileName(monitor_edid_path);
|
||||
ui->lineEdit->setEnabled(monitor_edid == 1);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -305,3 +315,33 @@ SettingsDisplay::on_pushButtonConfigureVideoSecondary_clicked()
|
||||
auto *device = video_card_getdevice(ui->comboBoxVideoSecondary->currentData().toInt());
|
||||
DeviceConfig::ConfigureDevice(device);
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_radioButtonDefault_clicked()
|
||||
{
|
||||
ui->radioButtonDefault->setChecked(true);
|
||||
ui->radioButtonCustom->setChecked(false);
|
||||
ui->lineEdit->setEnabled(false);
|
||||
}
|
||||
|
||||
|
||||
void SettingsDisplay::on_radioButtonCustom_clicked()
|
||||
{
|
||||
ui->radioButtonDefault->setChecked(false);
|
||||
ui->radioButtonCustom->setChecked(true);
|
||||
ui->lineEdit->setEnabled(true);
|
||||
}
|
||||
|
||||
void SettingsDisplay::on_pushButtonExportDefault_clicked()
|
||||
{
|
||||
auto str = QFileDialog::getSaveFileName(this, tr("Export"));
|
||||
if (!str.isEmpty()) {
|
||||
QFile file(str);
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
ssize_t size = 0;
|
||||
auto bytes = ddc_create_default_edid(&size);
|
||||
file.write((char*)bytes, size);
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,12 @@ private slots:
|
||||
void on_checkBoxDa2_stateChanged(int state);
|
||||
void on_pushButtonConfigureDa2_clicked();
|
||||
|
||||
void on_radioButtonDefault_clicked();
|
||||
|
||||
void on_radioButtonCustom_clicked();
|
||||
|
||||
void on_pushButtonExportDefault_clicked();
|
||||
|
||||
private:
|
||||
Ui::SettingsDisplay *ui;
|
||||
int machineId = 0;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<height>399</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -26,16 +26,52 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelVideo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigure8514">
|
||||
<property name="text">
|
||||
<string>Video:</string>
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureVoodoo">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureVideoSecondary">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBox8514">
|
||||
<property name="text">
|
||||
<string>IBM 8514/A Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QCheckBox" name="checkBoxDa2">
|
||||
<property name="text">
|
||||
<string>IBM PS/55 Display Adapter Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBoxXga">
|
||||
<property name="text">
|
||||
<string>XGA Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureDa2">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -52,19 +88,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureVideo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelVideoSecondary">
|
||||
<property name="sizePolicy">
|
||||
@@ -78,6 +101,33 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBoxVoodoo">
|
||||
<property name="text">
|
||||
<string>Voodoo 1 or 2 Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureXga">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureVideo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QComboBox" name="comboBoxVideoSecondary">
|
||||
<property name="sizePolicy">
|
||||
@@ -91,73 +141,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureVideoSecondary">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelVideo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
<string>Video:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBoxVoodoo">
|
||||
<property name="text">
|
||||
<string>Voodoo 1 or 2 Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureVoodoo">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBox8514">
|
||||
<property name="text">
|
||||
<string>IBM 8514/A Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigure8514">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBoxXga">
|
||||
<property name="text">
|
||||
<string>XGA Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureXga">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QCheckBox" name="checkBoxDa2">
|
||||
<property name="text">
|
||||
<string>IBM PS/55 Display Adapter Graphics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QPushButton" name="pushButtonConfigureDa2">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="3">
|
||||
<item row="9" column="0" colspan="3">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -167,8 +167,52 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Monitor EDID</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SizeConstraint::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radioButtonDefault">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButtonExportDefault">
|
||||
<property name="text">
|
||||
<string>Export...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radioButtonCustom">
|
||||
<property name="text">
|
||||
<string>Custom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="FileField" name="lineEdit" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>FileField</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qt_filefield.hpp</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user