From b98c0c2a44fb99978d399d6a8436e45766a786fc Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 22 Aug 2020 09:01:16 -0400 Subject: [PATCH] Clarify "Custom stream player" functionality (#1889) * Clarify "Custom stream player" functionality * Remove idiotic idiot proofing --- src/widgets/settingspages/ExternalToolsPage.cpp | 14 +++++++++----- src/widgets/splits/Split.cpp | 3 ++- src/widgets/splits/SplitHeader.cpp | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/widgets/settingspages/ExternalToolsPage.cpp b/src/widgets/settingspages/ExternalToolsPage.cpp index ef81766bb..7ea3678c9 100644 --- a/src/widgets/settingspages/ExternalToolsPage.cpp +++ b/src/widgets/settingspages/ExternalToolsPage.cpp @@ -77,20 +77,24 @@ ExternalToolsPage::ExternalToolsPage() } { - auto group = layout.emplace("Custom URI Scheme"); + auto group = layout.emplace("Custom stream player"); auto groupLayout = group.setLayoutType(); const auto description = new QLabel( - "You can open video streams directly in any video player that " + "You can open Twitch streams directly in any video player that " "has built-in Twitch support and has own URI Scheme.\nE.g.: " - "IINA for macOS and Potplayer (with extension) for Windows."); + "IINA for macOS and Potplayer (with extension) for " + "Windows.\n\nWith this value set, you will get the option to " + "\"Open in custom player\" when " + "right-clicking a channel header."); description->setWordWrap(true); description->setStyleSheet("color: #bbb"); groupLayout->setWidget(0, QFormLayout::SpanningRole, description); - groupLayout->addRow("URI Scheme:", this->createLineEdit( - getSettings()->customURIScheme)); + auto lineEdit = this->createLineEdit(getSettings()->customURIScheme); + lineEdit->setPlaceholderText("custom-player-scheme://"); + groupLayout->addRow("Custom stream player URI Scheme:", lineEdit); } { diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 4d9562f42..08f1538a2 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -575,11 +575,12 @@ void Split::openInStreamlink() void Split::openWithCustomScheme() { - const auto scheme = getSettings()->customURIScheme.getValue(); + QString scheme = getSettings()->customURIScheme.getValue(); if (scheme.isEmpty()) { return; } + const auto channel = this->getChannel().get(); if (const auto twitchChannel = dynamic_cast(channel)) diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 84c66bd31..1237f4f00 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -311,7 +311,7 @@ std::unique_ptr SplitHeader::createMainMenu() if (!getSettings()->customURIScheme.getValue().isEmpty()) { - menu->addAction("Open with URI Scheme", this->split_, + menu->addAction("Open in custom player", this->split_, &Split::openWithCustomScheme); } menu->addSeparator();