From 253541492367402d343a7e7fa233ecfbfd6f652d Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 5 Sep 2021 06:01:14 +0200 Subject: [PATCH] UI: Change YouTube Broadcast Dialog title Also uses cached username rather than making an API request. --- UI/data/locale/en-US.ini | 1 + UI/forms/OBSYoutubeActions.ui | 2 +- UI/window-youtube-actions.cpp | 17 ++++------------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini index 99dbf4736..e578d8d04 100644 --- a/UI/data/locale/en-US.ini +++ b/UI/data/locale/en-US.ini @@ -1193,6 +1193,7 @@ YouTube.Auth.WaitingAuth.Title="YouTube User Authorization" YouTube.Auth.WaitingAuth.Text="Please complete the authorization in your external browser.
If the external browser does not open, follow this link and complete the authorization:
%1" YouTube.AuthError.Text="Failed to get channel information: %1." +YouTube.Actions.WindowTitle="YouTube Broadcast Setup - Channel: %1" YouTube.Actions.CreateNewEvent="Create New Broadcast" YouTube.Actions.ChooseEvent="Select Existing Broadcast" YouTube.Actions.Title="Title*" diff --git a/UI/forms/OBSYoutubeActions.ui b/UI/forms/OBSYoutubeActions.ui index f0f4866dd..de6c04a4f 100644 --- a/UI/forms/OBSYoutubeActions.ui +++ b/UI/forms/OBSYoutubeActions.ui @@ -23,7 +23,7 @@ - YouTube Actions + YouTube.Actions.WindowTitle diff --git a/UI/window-youtube-actions.cpp b/UI/window-youtube-actions.cpp index 0e543f651..080e19b5f 100644 --- a/UI/window-youtube-actions.cpp +++ b/UI/window-youtube-actions.cpp @@ -96,19 +96,10 @@ OBSYoutubeActions::OBSYoutubeActions(QWidget *parent, Auth *auth, Cancel(); return; } - ChannelDescription channel; - if (!apiYouTube->GetChannelDescription(channel)) { - blog(LOG_DEBUG, "Could not get channel description."); - ShowErrorDialog( - parent, - apiYouTube->GetLastError().isEmpty() - ? QTStr("YouTube.Actions.Error.General") - : QTStr("YouTube.Actions.Error.Text") - .arg(apiYouTube->GetLastError())); - Cancel(); - return; - } - this->setWindowTitle(channel.title); + + const char *name = config_get_string(OBSBasic::Get()->Config(), + "YouTube", "ChannelName"); + this->setWindowTitle(QTStr("YouTube.Actions.WindowTitle").arg(name)); QVector category_list; if (!apiYouTube->GetVideoCategoriesList(category_list)) {