0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

UI: Fix audio restart message not hiding

This commit is contained in:
Clayton Groeneveld 2020-01-12 13:30:06 -06:00
parent 861ebff4c9
commit f32082920e
2 changed files with 21 additions and 4 deletions

View File

@ -761,6 +761,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
UpdateAutomaticReplayBufferCheckboxes();
App()->DisableHotkeys();
channelIndex = ui->channelSetup->currentIndex();
sampleRateIndex = ui->sampleRate->currentIndex();
}
OBSBasicSettings::~OBSBasicSettings()
@ -3828,10 +3831,22 @@ void OBSBasicSettings::AudioChanged()
void OBSBasicSettings::AudioChangedRestart()
{
if (!loading) {
int currentChannelIndex = ui->channelSetup->currentIndex();
int currentSampleRateIndex = ui->sampleRate->currentIndex();
if (currentChannelIndex != channelIndex ||
currentSampleRateIndex != sampleRateIndex) {
audioChanged = true;
ui->audioMsg->setText(QTStr("Basic.Settings.ProgramRestart"));
ui->audioMsg->setText(
QTStr("Basic.Settings.ProgramRestart"));
sender()->setProperty("changed", QVariant(true));
EnableApplyButton(true);
} else {
audioChanged = false;
ui->audioMsg->setText("");
sender()->setProperty("changed", QVariant(false));
EnableApplyButton(false);
}
}
}

View File

@ -117,6 +117,8 @@ private:
bool loading = true;
bool forceAuthReload = false;
std::string savedTheme;
int sampleRateIndex = 0;
int channelIndex = 0;
int lastSimpleRecQualityIdx = 0;
int lastChannelSetupIdx = 0;