yuzu/configuration/configure_audio: Store power on query into a variable

Avoids using the system accessor more than necessary, and ensures that
both dialog boxes see the same power on state.
This commit is contained in:
Lioncash 2019-05-19 11:12:29 -04:00
parent d00ca5c6c8
commit 5f01ec338e

View File

@ -28,8 +28,9 @@ ConfigureAudio::ConfigureAudio(QWidget* parent)
connect(ui->output_sink_combo_box, qOverload<int>(&QComboBox::currentIndexChanged), this, connect(ui->output_sink_combo_box, qOverload<int>(&QComboBox::currentIndexChanged), this,
&ConfigureAudio::updateAudioDevices); &ConfigureAudio::updateAudioDevices);
ui->output_sink_combo_box->setEnabled(!Core::System::GetInstance().IsPoweredOn()); const bool is_powered_on = Core::System::GetInstance().IsPoweredOn();
ui->audio_device_combo_box->setEnabled(!Core::System::GetInstance().IsPoweredOn()); ui->output_sink_combo_box->setEnabled(!is_powered_on);
ui->audio_device_combo_box->setEnabled(!is_powered_on);
} }
ConfigureAudio::~ConfigureAudio() = default; ConfigureAudio::~ConfigureAudio() = default;