Phase 3 (make the Configure buttons actually work).
This commit is contained in:
@@ -110,7 +110,10 @@ SettingsDisplay::onCurrentMachineChanged(int machineId)
|
|||||||
void
|
void
|
||||||
SettingsDisplay::on_pushButtonConfigure_clicked()
|
SettingsDisplay::on_pushButtonConfigure_clicked()
|
||||||
{
|
{
|
||||||
auto *device = video_card_getdevice(ui->comboBoxVideo->currentData().toInt());
|
int videoCard = ui->comboBoxVideo->currentData().toInt();
|
||||||
|
auto *device = video_card_getdevice(videoCard);
|
||||||
|
if (videoCard == VID_INTERNAL)
|
||||||
|
device = machine_get_vid_device(machineId);
|
||||||
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings *>(Settings::settings));
|
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -193,23 +193,39 @@ SettingsNetwork::on_comboIndexChanged(int index)
|
|||||||
void
|
void
|
||||||
SettingsNetwork::on_pushButtonConf1_clicked()
|
SettingsNetwork::on_pushButtonConf1_clicked()
|
||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(network_card_getdevice(ui->comboBoxNIC1->currentData().toInt()), 1, qobject_cast<Settings *>(Settings::settings));
|
int netCard = ui->comboBoxNIC1->currentData().toInt();
|
||||||
|
auto *device = network_card_getdevice(netCard);
|
||||||
|
if (netCard == NET_INTERNAL)
|
||||||
|
device = machine_get_net_device(machineId);
|
||||||
|
DeviceConfig::ConfigureDevice(device, 1, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SettingsNetwork::on_pushButtonConf2_clicked()
|
SettingsNetwork::on_pushButtonConf2_clicked()
|
||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(network_card_getdevice(ui->comboBoxNIC2->currentData().toInt()), 2, qobject_cast<Settings *>(Settings::settings));
|
int netCard = ui->comboBoxNIC2->currentData().toInt();
|
||||||
|
auto *device = network_card_getdevice(netCard);
|
||||||
|
if (netCard == NET_INTERNAL)
|
||||||
|
device = machine_get_net_device(machineId);
|
||||||
|
DeviceConfig::ConfigureDevice(device, 2, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SettingsNetwork::on_pushButtonConf3_clicked()
|
SettingsNetwork::on_pushButtonConf3_clicked()
|
||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(network_card_getdevice(ui->comboBoxNIC3->currentData().toInt()), 3, qobject_cast<Settings *>(Settings::settings));
|
int netCard = ui->comboBoxNIC3->currentData().toInt();
|
||||||
|
auto *device = network_card_getdevice(netCard);
|
||||||
|
if (netCard == NET_INTERNAL)
|
||||||
|
device = machine_get_net_device(machineId);
|
||||||
|
DeviceConfig::ConfigureDevice(device, 3, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SettingsNetwork::on_pushButtonConf4_clicked()
|
SettingsNetwork::on_pushButtonConf4_clicked()
|
||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(network_card_getdevice(ui->comboBoxNIC4->currentData().toInt()), 4, qobject_cast<Settings *>(Settings::settings));
|
int netCard = ui->comboBoxNIC4->currentData().toInt();
|
||||||
|
auto *device = network_card_getdevice(netCard);
|
||||||
|
if (netCard == NET_INTERNAL)
|
||||||
|
device = machine_get_net_device(machineId);
|
||||||
|
DeviceConfig::ConfigureDevice(device, 4, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
@@ -203,7 +203,11 @@ SettingsSound::on_comboBoxSoundCard1_currentIndexChanged(int index)
|
|||||||
void
|
void
|
||||||
SettingsSound::on_pushButtonConfigureSoundCard1_clicked()
|
SettingsSound::on_pushButtonConfigureSoundCard1_clicked()
|
||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard1->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
|
int sndCard = ui->comboBoxSoundCard1->currentData().toInt();
|
||||||
|
auto *device = sound_card_getdevice(sndCard);
|
||||||
|
if (sndCard == SOUND_INTERNAL)
|
||||||
|
device = machine_get_snd_device(machineId);
|
||||||
|
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -223,7 +227,11 @@ SettingsSound::on_comboBoxSoundCard2_currentIndexChanged(int index)
|
|||||||
void
|
void
|
||||||
SettingsSound::on_pushButtonConfigureSoundCard2_clicked()
|
SettingsSound::on_pushButtonConfigureSoundCard2_clicked()
|
||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard2->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
|
int sndCard = ui->comboBoxSoundCard2->currentData().toInt();
|
||||||
|
auto *device = sound_card_getdevice(sndCard);
|
||||||
|
if (sndCard == SOUND_INTERNAL)
|
||||||
|
device = machine_get_snd_device(machineId);
|
||||||
|
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -243,7 +251,11 @@ SettingsSound::on_comboBoxSoundCard3_currentIndexChanged(int index)
|
|||||||
void
|
void
|
||||||
SettingsSound::on_pushButtonConfigureSoundCard3_clicked()
|
SettingsSound::on_pushButtonConfigureSoundCard3_clicked()
|
||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard3->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
|
int sndCard = ui->comboBoxSoundCard3->currentData().toInt();
|
||||||
|
auto *device = sound_card_getdevice(sndCard);
|
||||||
|
if (sndCard == SOUND_INTERNAL)
|
||||||
|
device = machine_get_snd_device(machineId);
|
||||||
|
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -263,7 +275,11 @@ SettingsSound::on_comboBoxSoundCard4_currentIndexChanged(int index)
|
|||||||
void
|
void
|
||||||
SettingsSound::on_pushButtonConfigureSoundCard4_clicked()
|
SettingsSound::on_pushButtonConfigureSoundCard4_clicked()
|
||||||
{
|
{
|
||||||
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard4->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
|
int sndCard = ui->comboBoxSoundCard4->currentData().toInt();
|
||||||
|
auto *device = sound_card_getdevice(sndCard);
|
||||||
|
if (sndCard == SOUND_INTERNAL)
|
||||||
|
device = machine_get_snd_device(machineId);
|
||||||
|
DeviceConfig::ConfigureDevice(device, 0, qobject_cast<Settings *>(Settings::settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user