Add additional options for streamlink, remove static from qualitypopup

Fixes #261
This commit is contained in:
confuseh 2018-01-28 14:10:12 +00:00
parent f474db9443
commit a104e92ad5
5 changed files with 8 additions and 2 deletions

View file

@ -52,6 +52,7 @@ public:
FloatSetting mouseScrollMultiplier = {"/behaviour/mouseScrollMultiplier", 1.0};
QStringSetting streamlinkPath = {"/behaviour/streamlink/path", ""};
QStringSetting preferredQuality = {"/behaviour/streamlink/quality", "Choose"};
QStringSetting streamlinkOpts = {"/behaviour/streamlink/options", ""};
BoolSetting pauseChatHover = {"/behaviour/pauseChatHover", false};
/// Commands

View file

@ -12,6 +12,7 @@ QualityPopup::QualityPopup(const QString &channel, const QString &path, QStringL
{
this->ui.okButton.setText("OK");
this->ui.cancelButton.setText("Cancel");
this->setAttribute(Qt::WA_DeleteOnClose, true);
QObject::connect(&this->ui.okButton, &QPushButton::clicked, this,
&QualityPopup::okButtonClicked);
@ -33,7 +34,7 @@ QualityPopup::QualityPopup(const QString &channel, const QString &path, QStringL
void QualityPopup::showDialog(const QString &channel, const QString &path, QStringList options)
{
static QualityPopup *instance = new QualityPopup(channel, path, options);
QualityPopup *instance = new QualityPopup(channel, path, options);
instance->show();
instance->activateWindow();
@ -43,8 +44,9 @@ void QualityPopup::showDialog(const QString &channel, const QString &path, QStri
void QualityPopup::okButtonClicked()
{
singletons::SettingManager &settings = singletons::SettingManager::getInstance();
QProcess::startDetached(this->path,
{"twitch.tv/" + this->channel, this->ui.selector.currentText()});
{"twitch.tv/" + this->channel, this->ui.selector.currentText(), settings.streamlinkOpts});
this->close();
}

View file

@ -9,6 +9,7 @@
#include <QWidget>
#include "basewindow.hpp"
#include "singletons/settingsmanager.hpp"
namespace chatterino {

View file

@ -45,6 +45,7 @@ BehaviourPage::BehaviourPage()
groupLayout->addRow("Streamlink path:", this->createLineEdit(settings.streamlinkPath));
groupLayout->addRow("Prefered quality:",
this->createComboBox({STREAMLINK_QUALITY}, settings.preferredQuality));
groupLayout->addRow("Additional options:", this->createLineEdit(settings.streamlinkOpts));
}
layout->addStretch(1);

View file

@ -422,6 +422,7 @@ void Split::doOpenStreamlink()
args << quality;
if (exclude != "")
args << "--stream-sorting-excludes" << exclude;
args << settings.streamlinkOpts;
QProcess::startDetached(path, args);
} else {
QProcess *p = new QProcess();