Add brief description to Streamlink settings page

Add links to Streamlink website and download page to Streamlink settings page
Make streamlink custom path usage more explicit
Change how streamlink runs, it now works perfectly on Linux so that if you don't have a custom path set, it will try to just run "streamlink" in your PATH variable

This needs testing on Windows again
This commit is contained in:
Rasmus Karlsson
2018-05-06 16:33:00 +02:00
parent aba8e1a18f
commit 49458e4fac
3 changed files with 115 additions and 46 deletions
@@ -11,6 +11,15 @@ namespace chatterino {
namespace widgets {
namespace settingspages {
namespace {
QString CreateLink(const QString &url, const QString &name)
{
return QString("<a href=\"" + url + "\"><span style=\"color: white;\">" + name + "</span></a>");
}
} // namespace
ExternalToolsPage::ExternalToolsPage()
: SettingsPage("External tools", "")
{
@@ -22,13 +31,44 @@ ExternalToolsPage::ExternalToolsPage()
{
auto group = layout.emplace<QGroupBox>("Streamlink");
auto groupLayout = group.setLayoutType<QFormLayout>();
groupLayout->addRow("Streamlink path:",
this->createLineEdit(app->settings->streamlinkPath));
auto description =
new QLabel("Streamlink is a command-line utility that pipes video streams from various "
"services into a video player, such as VLC. Make sure to edit the "
"configuration file before you use it!");
description->setWordWrap(true);
description->setStyleSheet("color: #bbb");
auto links = new QLabel(
CreateLink("https://streamlink.github.io/", "Website") + " " +
CreateLink("https://github.com/streamlink/streamlink/releases/latest", "Download"));
links->setTextFormat(Qt::RichText);
links->setTextInteractionFlags(Qt::TextBrowserInteraction | Qt::LinksAccessibleByKeyboard |
Qt::LinksAccessibleByKeyboard);
links->setOpenExternalLinks(true);
groupLayout->setWidget(0, QFormLayout::SpanningRole, description);
groupLayout->setWidget(1, QFormLayout::SpanningRole, links);
auto customPathCb = this->createCheckBox(
"Use custom path (Enable if using non-standard streamlink installation path)",
app->settings->streamlinkUseCustomPath);
groupLayout->setWidget(2, QFormLayout::SpanningRole, customPathCb);
auto customPath = this->createLineEdit(app->settings->streamlinkPath);
customPath->setPlaceholderText("Path to folder where Streamlink executable can be found");
groupLayout->addRow("Custom streamlink path:", customPath);
groupLayout->addRow(
"Prefered quality:",
"Preferred quality:",
this->createComboBox({STREAMLINK_QUALITY}, app->settings->preferredQuality));
groupLayout->addRow("Additional options:",
this->createLineEdit(app->settings->streamlinkOpts));
app->settings->streamlinkUseCustomPath.connect(
[=](const auto &value, auto) {
customPath->setEnabled(value); //
},
this->managedConnections);
}
layout->addStretch(1);