Просмотр исходного кода

UI: Change YouTube Broadcast Dialog title

Also uses cached username rather than making an API request.
derrod 4 лет назад
Родитель
Сommit
2535414923
3 измененных файлов с 6 добавлено и 14 удалено
  1. 1 0
      UI/data/locale/en-US.ini
  2. 1 1
      UI/forms/OBSYoutubeActions.ui
  3. 4 13
      UI/window-youtube-actions.cpp

+ 1 - 0
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.<br>If the external browser does not open, follow this link and complete the authorization:<br>%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*"

+ 1 - 1
UI/forms/OBSYoutubeActions.ui

@@ -23,7 +23,7 @@
    </size>
   </property>
   <property name="windowTitle">
-   <string>YouTube Actions</string>
+   <string>YouTube.Actions.WindowTitle</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>

+ 4 - 13
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<CategoryDescription> category_list;
 	if (!apiYouTube->GetVideoCategoriesList(category_list)) {