From f32082920ef8e6d7038ec7b67bf3ef8ac1ef1d8e Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Sun, 12 Jan 2020 13:30:06 -0600 Subject: [PATCH] UI: Fix audio restart message not hiding --- UI/window-basic-settings.cpp | 23 +++++++++++++++++++---- UI/window-basic-settings.hpp | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index 3809becb7..dcc3b66a1 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -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) { - 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); + } } } diff --git a/UI/window-basic-settings.hpp b/UI/window-basic-settings.hpp index 7521f70f6..7401d04e2 100644 --- a/UI/window-basic-settings.hpp +++ b/UI/window-basic-settings.hpp @@ -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;