Clean QT Display UI
This commit is contained in:
@@ -51,22 +51,29 @@ SettingsDisplay::~SettingsDisplay()
|
|||||||
void
|
void
|
||||||
SettingsDisplay::save()
|
SettingsDisplay::save()
|
||||||
{
|
{
|
||||||
gfxcard[0] = ui->comboBoxVideo->currentData().toInt();
|
|
||||||
// TODO
|
// TODO
|
||||||
|
#if 0
|
||||||
|
for (uint8_t i = 0; i < GFXCARD_MAX; ++i) {
|
||||||
|
QComboBox *cbox = findChild<QComboBox *>(QString("comboBoxVideo%1").arg(i + 1));
|
||||||
|
gfxcard[i] = cbox->currentData().toInt();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
gfxcard[0] = ui->comboBoxVideo->currentData().toInt();
|
||||||
for (uint8_t i = 1; i < GFXCARD_MAX; i ++)
|
for (uint8_t i = 1; i < GFXCARD_MAX; i ++)
|
||||||
gfxcard[i] = ui->comboBoxVideoSecondary->currentData().toInt();
|
gfxcard[i] = ui->comboBoxVideoSecondary->currentData().toInt();
|
||||||
|
#endif
|
||||||
|
|
||||||
voodoo_enabled = ui->checkBoxVoodoo->isChecked() ? 1 : 0;
|
voodoo_enabled = ui->checkBoxVoodoo->isChecked() ? 1 : 0;
|
||||||
ibm8514_standalone_enabled = ui->checkBox8514->isChecked() ? 1 : 0;
|
ibm8514_standalone_enabled = ui->checkBox8514->isChecked() ? 1 : 0;
|
||||||
xga_standalone_enabled = ui->checkBoxXga->isChecked() ? 1 : 0;
|
xga_standalone_enabled = ui->checkBoxXga->isChecked() ? 1 : 0;
|
||||||
da2_standalone_enabled = ui->checkBoxDa2->isChecked() ? 1 : 0;
|
da2_standalone_enabled = ui->checkBoxDa2->isChecked() ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SettingsDisplay::onCurrentMachineChanged(int machineId)
|
SettingsDisplay::onCurrentMachineChanged(int machineId)
|
||||||
{
|
{
|
||||||
// win_settings_video_proc, WM_INITDIALOG
|
// win_settings_video_proc, WM_INITDIALOG
|
||||||
this->machineId = machineId;
|
this->machineId = machineId;
|
||||||
auto curVideoCard = videoCard[0];
|
auto curVideoCard = videoCard[0];
|
||||||
|
|
||||||
auto *model = ui->comboBoxVideo->model();
|
auto *model = ui->comboBoxVideo->model();
|
||||||
@@ -98,25 +105,26 @@ SettingsDisplay::onCurrentMachineChanged(int machineId)
|
|||||||
}
|
}
|
||||||
model->removeRows(0, removeRows);
|
model->removeRows(0, removeRows);
|
||||||
|
|
||||||
|
// TODO
|
||||||
if (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0) {
|
if (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0) {
|
||||||
ui->comboBoxVideo->setEnabled(false);
|
ui->comboBoxVideo->setEnabled(false);
|
||||||
ui->comboBoxVideoSecondary->setEnabled(false);
|
ui->comboBoxVideoSecondary->setEnabled(false);
|
||||||
ui->pushButtonConfigureSecondary->setEnabled(false);
|
ui->pushButtonConfigureVideoSecondary->setEnabled(false);
|
||||||
selectedRow = 1;
|
selectedRow = 1;
|
||||||
} else {
|
} else {
|
||||||
ui->comboBoxVideo->setEnabled(true);
|
ui->comboBoxVideo->setEnabled(true);
|
||||||
ui->comboBoxVideoSecondary->setEnabled(true);
|
ui->comboBoxVideoSecondary->setEnabled(true);
|
||||||
ui->pushButtonConfigureSecondary->setEnabled(true);
|
ui->pushButtonConfigureVideoSecondary->setEnabled(true);
|
||||||
}
|
}
|
||||||
ui->comboBoxVideo->setCurrentIndex(selectedRow);
|
ui->comboBoxVideo->setCurrentIndex(selectedRow);
|
||||||
// TODO
|
// TODO
|
||||||
for (uint8_t i = 1; i < GFXCARD_MAX; i ++)
|
for (uint8_t i = 1; i < GFXCARD_MAX; i ++)
|
||||||
if (gfxcard[i] == 0)
|
if (gfxcard[i] == 0)
|
||||||
ui->pushButtonConfigureSecondary->setEnabled(false);
|
ui->pushButtonConfigureVideoSecondary->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SettingsDisplay::on_pushButtonConfigure_clicked()
|
SettingsDisplay::on_pushButtonConfigureVideo_clicked()
|
||||||
{
|
{
|
||||||
int videoCard = ui->comboBoxVideo->currentData().toInt();
|
int videoCard = ui->comboBoxVideo->currentData().toInt();
|
||||||
auto *device = video_card_getdevice(videoCard);
|
auto *device = video_card_getdevice(videoCard);
|
||||||
@@ -160,17 +168,17 @@ SettingsDisplay::on_pushButtonConfigureDa2_clicked()
|
|||||||
void
|
void
|
||||||
SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index)
|
SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (index < 0) {
|
if (index < 0)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
static QRegularExpression voodooRegex("3dfx|voodoo|banshee", QRegularExpression::CaseInsensitiveOption);
|
static QRegularExpression voodooRegex("3dfx|voodoo|banshee", QRegularExpression::CaseInsensitiveOption);
|
||||||
auto curVideoCard_2 = videoCard[1];
|
auto curVideoCard_2 = videoCard[1];
|
||||||
videoCard[0] = ui->comboBoxVideo->currentData().toInt();
|
videoCard[0] = ui->comboBoxVideo->currentData().toInt();
|
||||||
if (videoCard[0] == VID_INTERNAL)
|
if (videoCard[0] == VID_INTERNAL)
|
||||||
ui->pushButtonConfigure->setEnabled(machine_has_flags(machineId, MACHINE_VIDEO) &&
|
ui->pushButtonConfigureVideo->setEnabled(machine_has_flags(machineId, MACHINE_VIDEO) &&
|
||||||
device_has_config(machine_get_vid_device(machineId)));
|
device_has_config(machine_get_vid_device(machineId)));
|
||||||
else
|
else
|
||||||
ui->pushButtonConfigure->setEnabled(video_card_has_config(videoCard[0]) > 0);
|
ui->pushButtonConfigureVideo->setEnabled(video_card_has_config(videoCard[0]) > 0);
|
||||||
bool machineHasPci = machine_has_bus(machineId, MACHINE_BUS_PCI) > 0;
|
bool machineHasPci = machine_has_bus(machineId, MACHINE_BUS_PCI) > 0;
|
||||||
ui->pushButtonConfigureVoodoo->setEnabled(machineHasPci && ui->checkBoxVoodoo->isChecked());
|
ui->pushButtonConfigureVoodoo->setEnabled(machineHasPci && ui->checkBoxVoodoo->isChecked());
|
||||||
|
|
||||||
@@ -233,7 +241,7 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index)
|
|||||||
|
|
||||||
if ((videoCard[1] == 0) || (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0)) {
|
if ((videoCard[1] == 0) || (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0)) {
|
||||||
ui->comboBoxVideoSecondary->setCurrentIndex(0);
|
ui->comboBoxVideoSecondary->setCurrentIndex(0);
|
||||||
ui->pushButtonConfigureSecondary->setEnabled(false);
|
ui->pushButtonConfigureVideoSecondary->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is the currently selected video card a voodoo?
|
// Is the currently selected video card a voodoo?
|
||||||
@@ -287,15 +295,15 @@ void
|
|||||||
SettingsDisplay::on_comboBoxVideoSecondary_currentIndexChanged(int index)
|
SettingsDisplay::on_comboBoxVideoSecondary_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
ui->pushButtonConfigureSecondary->setEnabled(false);
|
ui->pushButtonConfigureVideoSecondary->setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
videoCard[1] = ui->comboBoxVideoSecondary->currentData().toInt();
|
videoCard[1] = ui->comboBoxVideoSecondary->currentData().toInt();
|
||||||
ui->pushButtonConfigureSecondary->setEnabled(index != 0 && video_card_has_config(videoCard[1]) > 0);
|
ui->pushButtonConfigureVideoSecondary->setEnabled(index != 0 && video_card_has_config(videoCard[1]) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SettingsDisplay::on_pushButtonConfigureSecondary_clicked()
|
SettingsDisplay::on_pushButtonConfigureVideoSecondary_clicked()
|
||||||
{
|
{
|
||||||
auto *device = video_card_getdevice(ui->comboBoxVideoSecondary->currentData().toInt());
|
auto *device = video_card_getdevice(ui->comboBoxVideoSecondary->currentData().toInt());
|
||||||
DeviceConfig::ConfigureDevice(device);
|
DeviceConfig::ConfigureDevice(device);
|
||||||
|
|||||||
@@ -22,22 +22,23 @@ public slots:
|
|||||||
void onCurrentMachineChanged(int machineId);
|
void onCurrentMachineChanged(int machineId);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_pushButtonConfigureSecondary_clicked();
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void on_comboBoxVideoSecondary_currentIndexChanged(int index);
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void on_checkBoxVoodoo_stateChanged(int state);
|
|
||||||
void on_checkBox8514_stateChanged(int state);
|
|
||||||
void on_checkBoxXga_stateChanged(int state);
|
|
||||||
void on_checkBoxDa2_stateChanged(int state);
|
|
||||||
void on_comboBoxVideo_currentIndexChanged(int index);
|
void on_comboBoxVideo_currentIndexChanged(int index);
|
||||||
|
void on_pushButtonConfigureVideo_clicked();
|
||||||
|
|
||||||
|
void on_comboBoxVideoSecondary_currentIndexChanged(int index);
|
||||||
|
void on_pushButtonConfigureVideoSecondary_clicked();
|
||||||
|
|
||||||
|
void on_checkBoxVoodoo_stateChanged(int state);
|
||||||
void on_pushButtonConfigureVoodoo_clicked();
|
void on_pushButtonConfigureVoodoo_clicked();
|
||||||
|
|
||||||
|
void on_checkBox8514_stateChanged(int state);
|
||||||
void on_pushButtonConfigure8514_clicked();
|
void on_pushButtonConfigure8514_clicked();
|
||||||
|
|
||||||
|
void on_checkBoxXga_stateChanged(int state);
|
||||||
void on_pushButtonConfigureXga_clicked();
|
void on_pushButtonConfigureXga_clicked();
|
||||||
|
|
||||||
|
void on_checkBoxDa2_stateChanged(int state);
|
||||||
void on_pushButtonConfigureDa2_clicked();
|
void on_pushButtonConfigureDa2_clicked();
|
||||||
void on_pushButtonConfigure_clicked();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SettingsDisplay *ui;
|
Ui::SettingsDisplay *ui;
|
||||||
|
|||||||
@@ -26,28 +26,8 @@
|
|||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QPushButton" name="pushButtonConfigure">
|
|
||||||
<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="6" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="checkBoxXga">
|
|
||||||
<property name="text">
|
|
||||||
<string>XGA Graphics</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="labelVideo">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -72,15 +52,21 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QPushButton" name="pushButtonConfigureVoodoo">
|
<widget class="QPushButton" name="pushButtonConfigureVideo">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Configure</string>
|
<string>Configure</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="labelVideoSecondary">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -92,10 +78,23 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="checkBox8514">
|
<widget class="QComboBox" name="comboBoxVideoSecondary">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maxVisibleItems">
|
||||||
|
<number>30</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QPushButton" name="pushButtonConfigureVideoSecondary">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>IBM 8514/A Graphics</string>
|
<string>Configure</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -106,6 +105,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<item row="5" column="2">
|
||||||
<widget class="QPushButton" name="pushButtonConfigure8514">
|
<widget class="QPushButton" name="pushButtonConfigure8514">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -113,6 +126,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<item row="6" column="2">
|
||||||
<widget class="QPushButton" name="pushButtonConfigureXga">
|
<widget class="QPushButton" name="pushButtonConfigureXga">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -134,26 +154,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
|
||||||
<widget class="QPushButton" name="pushButtonConfigureSecondary">
|
|
||||||
<property name="text">
|
|
||||||
<string>Configure</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2">
|
|
||||||
<widget class="QComboBox" name="comboBoxVideoSecondary">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maxVisibleItems">
|
|
||||||
<number>30</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0" colspan="3">
|
<item row="8" column="0" colspan="3">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|||||||
Reference in New Issue
Block a user