Skip to content

Commit

Permalink
Clarify "Custom stream player" functionality (Chatterino#1889)
Browse files Browse the repository at this point in the history
* Clarify "Custom stream player" functionality

* Remove idiotic idiot proofing
  • Loading branch information
pajlada authored Aug 22, 2020
1 parent 7d0602d commit b98c0c2
Showing 3 changed files with 12 additions and 7 deletions.
14 changes: 9 additions & 5 deletions src/widgets/settingspages/ExternalToolsPage.cpp
Original file line number Diff line number Diff line change
@@ -77,20 +77,24 @@ ExternalToolsPage::ExternalToolsPage()
}

{
auto group = layout.emplace<QGroupBox>("Custom URI Scheme");
auto group = layout.emplace<QGroupBox>("Custom stream player");
auto groupLayout = group.setLayoutType<QFormLayout>();

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);
}

{
3 changes: 2 additions & 1 deletion src/widgets/splits/Split.cpp
Original file line number Diff line number Diff line change
@@ -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<TwitchChannel *>(channel))
2 changes: 1 addition & 1 deletion src/widgets/splits/SplitHeader.cpp
Original file line number Diff line number Diff line change
@@ -311,7 +311,7 @@ std::unique_ptr<QMenu> 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();

0 comments on commit b98c0c2

Please sign in to comment.