Merge pull request #2312 from cg2121/fix-audio-message

UI: Fix audio restart message not hiding
This commit is contained in:
Jim
2020-01-13 02:02:25 -08:00
committed by GitHub
2 changed files with 21 additions and 4 deletions

View File

@@ -763,6 +763,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
on_baseResolution_editTextChanged(ui->baseResolution->currentText());
App()->DisableHotkeys();
channelIndex = ui->channelSetup->currentIndex();
sampleRateIndex = ui->sampleRate->currentIndex();
}
OBSBasicSettings::~OBSBasicSettings()
@@ -3867,10 +3870,22 @@ void OBSBasicSettings::AudioChanged()
void OBSBasicSettings::AudioChangedRestart()
{
if (!loading) {
audioChanged = true;
ui->audioMsg->setText(QTStr("Basic.Settings.ProgramRestart"));
sender()->setProperty("changed", QVariant(true));
EnableApplyButton(true);
int currentChannelIndex = ui->channelSetup->currentIndex();
int currentSampleRateIndex = ui->sampleRate->currentIndex();
if (currentChannelIndex != channelIndex ||
currentSampleRateIndex != sampleRateIndex) {
audioChanged = true;
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);
}
}
}