diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini index c37557ed8..f9ead1ef2 100644 --- a/UI/data/locale/en-US.ini +++ b/UI/data/locale/en-US.ini @@ -1236,7 +1236,8 @@ YouTube.Actions.Stream.YTStudio="Automatically created by YouTube Studio" YouTube.Actions.Notify.Title="YouTube" YouTube.Actions.Notify.CreatingBroadcast="Creating a new Live Broadcast, please wait..." -YouTube.Actions.AutoStartStreamingWarning="Auto start is disabled for this stream, you should click \"GO LIVE\"." +YouTube.Actions.AutoStartStreamingWarning.Title="Manual start required" +YouTube.Actions.AutoStartStreamingWarning="Auto start is disabled for this stream, click the \"GO LIVE\" button to publish your broadcast on YouTube." YouTube.Actions.AutoStopStreamingWarning="You will not be able to reconnect.
Your stream will stop and you will no longer be live." # YouTube API errors in format "YouTube.Errors." diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 3c891647e..35f686e55 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -6136,6 +6136,37 @@ void OBSBasic::YoutubeStreamCheck(const std::string &key) youtubeStreamCheckThread->deleteLater(); } + +void OBSBasic::ShowYouTubeAutoStartWarning() +{ + auto msgBox = []() { + QMessageBox msgbox(App()->GetMainWindow()); + msgbox.setWindowTitle(QTStr( + "YouTube.Actions.AutoStartStreamingWarning.Title")); + msgbox.setText( + QTStr("YouTube.Actions.AutoStartStreamingWarning")); + msgbox.setIcon(QMessageBox::Icon::Information); + msgbox.addButton(QMessageBox::Ok); + + QCheckBox *cb = new QCheckBox(QTStr("DoNotShowAgain")); + msgbox.setCheckBox(cb); + + msgbox.exec(); + + if (cb->isChecked()) { + config_set_bool(App()->GlobalConfig(), "General", + "WarnedAboutYouTubeAutoStart", true); + config_save_safe(App()->GlobalConfig(), "tmp", nullptr); + } + }; + + bool warned = config_get_bool(App()->GlobalConfig(), "General", + "WarnedAboutYouTubeAutoStart"); + if (!warned) { + QMetaObject::invokeMethod(App(), "Exec", Qt::QueuedConnection, + Q_ARG(VoidFunc, msgBox)); + } +} #endif void OBSBasic::StartStreaming() @@ -6235,12 +6266,8 @@ void OBSBasic::StartStreaming() if (replayBufferWhileStreaming) StartReplayBuffer(); - if (!autoStartBroadcast) { - OBSMessageBox::warning( - this, "Warning", - QTStr("YouTube.Actions.AutoStartStreamingWarning"), - false); - } + if (!autoStartBroadcast) + OBSBasic::ShowYouTubeAutoStartWarning(); } void OBSBasic::BroadcastButtonClicked() diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp index 348c7f8cb..69c217aec 100644 --- a/UI/window-basic-main.hpp +++ b/UI/window-basic-main.hpp @@ -564,6 +564,7 @@ private: QPointer youtubeStreamCheckThread; #if YOUTUBE_ENABLED void YoutubeStreamCheck(const std::string &key); + void ShowYouTubeAutoStartWarning(); void YouTubeActionDialogOk(const QString &id, const QString &key, bool autostart, bool autostop); #endif