UI: Ensure only one advanced audio settings window

Add a check to prevent that the advanced audio settings dialog is only
once. When the dialog is already present raise it to the top instead.
This commit is contained in:
fryshorts
2015-02-13 13:06:55 +01:00
parent c45e74039f
commit 90ccae6f4c
2 changed files with 14 additions and 0 deletions

View File

@@ -1651,9 +1651,17 @@ void OBSBasic::on_action_Settings_triggered()
void OBSBasic::on_actionAdvAudioProperties_triggered()
{
if (advAudioWindow != nullptr) {
advAudioWindow->raise();
return;
}
advAudioWindow = new OBSBasicAdvAudio(this);
advAudioWindow->show();
advAudioWindow->setAttribute(Qt::WA_DeleteOnClose, true);
connect(advAudioWindow, SIGNAL(destroyed()),
this, SLOT(on_advAudioProps_destroyed()));
}
void OBSBasic::on_advAudioProps_clicked()
@@ -1661,6 +1669,11 @@ void OBSBasic::on_advAudioProps_clicked()
on_actionAdvAudioProperties_triggered();
}
void OBSBasic::on_advAudioProps_destroyed()
{
advAudioWindow = nullptr;
}
void OBSBasic::on_scenes_currentItemChanged(QListWidgetItem *current,
QListWidgetItem *prev)
{