UI: Fix YouTubeAppDock crash

Apparently the YouTube app dock thing didn't take into consideration the
fact that the user may have the browser source available, but may not
have browser docks available (via the `cef` global). This is because
certain system configurations do not support browser widgets, such as
Wayland on Linux.

(Lain note: There's multiple things I'm unhappy about here. I'm mostly
going to blame myself for multiple reasons.)
This commit is contained in:
Lain
2023-08-03 18:21:01 -07:00
parent 9d2715fe72
commit 0c6fa0a2ba
5 changed files with 34 additions and 13 deletions

View File

@@ -4245,18 +4245,9 @@ void OBSBasicSettings::on_listWidget_itemSelectionChanged()
pageIndex = row;
}
void OBSBasicSettings::on_buttonBox_clicked(QAbstractButton *button)
void OBSBasicSettings::UpdateYouTubeAppDockSettings()
{
QDialogButtonBox::ButtonRole val = ui->buttonBox->buttonRole(button);
if (val == QDialogButtonBox::ApplyRole ||
val == QDialogButtonBox::AcceptRole) {
if (!QueryAllowedToClose())
return;
SaveSettings();
#ifdef YOUTUBE_ENABLED
if (cef) {
std::string service = ui->service->currentText().toStdString();
if (IsYouTubeService(service)) {
if (!main->GetYouTubeAppDock()) {
@@ -4270,6 +4261,22 @@ void OBSBasicSettings::on_buttonBox_clicked(QAbstractButton *button)
}
main->DeleteYouTubeAppDock();
}
}
}
void OBSBasicSettings::on_buttonBox_clicked(QAbstractButton *button)
{
QDialogButtonBox::ButtonRole val = ui->buttonBox->buttonRole(button);
if (val == QDialogButtonBox::ApplyRole ||
val == QDialogButtonBox::AcceptRole) {
if (!QueryAllowedToClose())
return;
SaveSettings();
#ifdef YOUTUBE_ENABLED
UpdateYouTubeAppDockSettings();
#endif
ClearChanged();
}