diff --git a/UI/forms/AutoConfigStreamPage.ui b/UI/forms/AutoConfigStreamPage.ui index c52e3797928f25..7eec15fa9e9e3d 100644 --- a/UI/forms/AutoConfigStreamPage.ui +++ b/UI/forms/AutoConfigStreamPage.ui @@ -6,8 +6,8 @@ 0 0 - 566 - 335 + 692 + 407 @@ -44,6 +44,9 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + 12 + @@ -73,6 +76,19 @@ + + + + Qt::Vertical + + + + 12 + 12 + + + + @@ -279,6 +295,13 @@ + + + + Basic.AutoConfig.StreamPage.GetStreamKey + + + @@ -321,22 +344,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 87 - 17 - - - - @@ -347,7 +354,7 @@ - + BandwidthTest.Region @@ -384,26 +391,46 @@ - + Basic.AutoConfig.StreamPage.ConnectAccount - + Basic.AutoConfig.StreamPage.DisconnectAccount + + + + Qt::Vertical + + + + 6 + 6 + + + + + + + UrlPushButton + QPushButton +
url-push-button.hpp
+
+
diff --git a/UI/window-basic-auto-config.cpp b/UI/window-basic-auto-config.cpp index 36a97600fca868..6ab7af3505810f 100644 --- a/UI/window-basic-auto-config.cpp +++ b/UI/window-basic-auto-config.cpp @@ -1,13 +1,14 @@ -#include "window-basic-auto-config.hpp" -#include "window-basic-main.hpp" -#include "qt-wrappers.hpp" -#include "obs-app.hpp" - #include #include #include +#include "window-basic-auto-config.hpp" +#include "window-basic-main.hpp" +#include "qt-wrappers.hpp" +#include "obs-app.hpp" +#include "url-push-button.hpp" + #include "ui_AutoConfigStartPage.h" #include "ui_AutoConfigVideoPage.h" #include "ui_AutoConfigStreamPage.h" @@ -289,7 +290,7 @@ int AutoConfigStreamPage::nextId() const return AutoConfig::TestPage; } -inline bool AutoConfigStreamPage::IsCustom() const +inline bool AutoConfigStreamPage::IsCustomService() const { return ui->service->currentData().toInt() == (int)ListOpt::Custom; } @@ -299,7 +300,7 @@ bool AutoConfigStreamPage::validatePage() OBSData service_settings = obs_data_create(); obs_data_release(service_settings); - wiz->customServer = IsCustom(); + wiz->customServer = IsCustomService(); const char *serverType = wiz->customServer ? "rtmp_custom" : "rtmp_common"; @@ -480,7 +481,7 @@ void AutoConfigStreamPage::ServiceChanged() std::string service = QT_TO_UTF8(ui->service->currentText()); bool regionBased = service == "Twitch" || service == "Smashcast"; bool testBandwidth = ui->doBandwidthTest->isChecked(); - bool custom = IsCustom(); + bool custom = IsCustomService(); ui->disconnectAccount->setVisible(false); @@ -553,51 +554,39 @@ void AutoConfigStreamPage::ServiceChanged() void AutoConfigStreamPage::UpdateKeyLink() { - bool custom = IsCustom(); + if (IsCustomService()) { + ui->doBandwidthTest->setEnabled(true); + return; + } + QString serviceName = ui->service->currentText(); bool isYoutube = false; + QString streamKeyLink; - if (custom) - serviceName = ""; - - QString text = QTStr("Basic.AutoConfig.StreamPage.StreamKey"); if (serviceName == "Twitch") { - text += " "; - text += QTStr( - "Basic.AutoConfig.StreamPage.StreamKey.LinkToSite"); - text += ""; + streamKeyLink = QTStr( + "https://www.twitch.tv/broadcast/dashboard/streamkey"); } else if (serviceName == "YouTube / YouTube Gaming") { - text += " "; - text += QTStr( - "Basic.AutoConfig.StreamPage.StreamKey.LinkToSite"); - text += ""; - + streamKeyLink = QTStr("https://www.youtube.com/live_dashboard"); isYoutube = true; } else if (serviceName.startsWith("Restream.io")) { - text += " "; - text += QTStr( - "Basic.AutoConfig.StreamPage.StreamKey.LinkToSite"); - text += ""; - } else if (serviceName == "YouStreamer") { - text += " "; - text += QTStr( - "Basic.AutoConfig.StreamPage.StreamKey.LinkToSite"); - text += ""; + streamKeyLink = QTStr( + "https://restream.io/settings/streaming-setup?from=OBS"); } else if (serviceName == "Facebook Live") { - text += " "; - text += QTStr( - "Basic.AutoConfig.StreamPage.StreamKey.LinkToSite"); - text += ""; + streamKeyLink += + QTStr("https://www.facebook.com/live/create?ref=OBS"); + } else if (serviceName.startsWith("Twitter")) { + streamKeyLink = QTStr("https://www.pscp.tv/account/producer"); + } else if (serviceName.startsWith("YouStreamer")) { + streamKeyLink = + QTStr("https://www.app.youstreamer.com/stream/"); + } + + if (QString(streamKeyLink).isNull()) { + ui->streamKeyButton->hide(); + } else { + ui->streamKeyButton->setTargetUrl(QUrl(streamKeyLink)); + ui->streamKeyButton->show(); } if (isYoutube) { @@ -606,8 +595,6 @@ void AutoConfigStreamPage::UpdateKeyLink() } else { ui->doBandwidthTest->setEnabled(true); } - - ui->streamKeyLabel->setText(text); } void AutoConfigStreamPage::LoadServices(bool showAll) @@ -704,7 +691,7 @@ void AutoConfigStreamPage::UpdateCompleted() (ui->key->text().isEmpty() && !auth)) { ready = false; } else { - bool custom = IsCustom(); + bool custom = IsCustomService(); if (custom) { ready = !ui->customServer->text().isEmpty(); } else { diff --git a/UI/window-basic-auto-config.hpp b/UI/window-basic-auto-config.hpp index 97e4df380c482f..874bacb43a4928 100644 --- a/UI/window-basic-auto-config.hpp +++ b/UI/window-basic-auto-config.hpp @@ -173,7 +173,7 @@ class AutoConfigStreamPage : public QWizardPage { bool ready = false; void LoadServices(bool showAll); - inline bool IsCustom() const; + inline bool IsCustomService() const; public: AutoConfigStreamPage(QWidget *parent = nullptr); diff --git a/UI/window-basic-settings-stream.cpp b/UI/window-basic-settings-stream.cpp index 3c741196e3d5f7..e3c3f16caa3446 100644 --- a/UI/window-basic-settings-stream.cpp +++ b/UI/window-basic-settings-stream.cpp @@ -228,6 +228,9 @@ void OBSBasicSettings::UpdateKeyLink() QTStr("https://www.facebook.com/live/create?ref=OBS"); } else if (serviceName.startsWith("Twitter")) { streamKeyLink = QTStr("https://www.pscp.tv/account/producer"); + } else if (serviceName.startsWith("YouStreamer")) { + streamKeyLink = + QTStr("https://www.app.youstreamer.com/stream/"); } if (QString(streamKeyLink).isNull()) {