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)
{

View file

@ -234,6 +234,7 @@ private slots:
void on_action_Settings_triggered();
void on_actionAdvAudioProperties_triggered();
void on_advAudioProps_clicked();
void on_advAudioProps_destroyed();
void on_actionShowLogs_triggered();
void on_actionUploadCurrentLog_triggered();
void on_actionUploadLastLog_triggered();