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