mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Add additional options for streamlink, remove static from qualitypopup
Fixes #261
This commit is contained in:
parent
f474db9443
commit
a104e92ad5
|
@ -52,6 +52,7 @@ public:
|
||||||
FloatSetting mouseScrollMultiplier = {"/behaviour/mouseScrollMultiplier", 1.0};
|
FloatSetting mouseScrollMultiplier = {"/behaviour/mouseScrollMultiplier", 1.0};
|
||||||
QStringSetting streamlinkPath = {"/behaviour/streamlink/path", ""};
|
QStringSetting streamlinkPath = {"/behaviour/streamlink/path", ""};
|
||||||
QStringSetting preferredQuality = {"/behaviour/streamlink/quality", "Choose"};
|
QStringSetting preferredQuality = {"/behaviour/streamlink/quality", "Choose"};
|
||||||
|
QStringSetting streamlinkOpts = {"/behaviour/streamlink/options", ""};
|
||||||
BoolSetting pauseChatHover = {"/behaviour/pauseChatHover", false};
|
BoolSetting pauseChatHover = {"/behaviour/pauseChatHover", false};
|
||||||
|
|
||||||
/// Commands
|
/// Commands
|
||||||
|
|
|
@ -12,6 +12,7 @@ QualityPopup::QualityPopup(const QString &channel, const QString &path, QStringL
|
||||||
{
|
{
|
||||||
this->ui.okButton.setText("OK");
|
this->ui.okButton.setText("OK");
|
||||||
this->ui.cancelButton.setText("Cancel");
|
this->ui.cancelButton.setText("Cancel");
|
||||||
|
this->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
|
|
||||||
QObject::connect(&this->ui.okButton, &QPushButton::clicked, this,
|
QObject::connect(&this->ui.okButton, &QPushButton::clicked, this,
|
||||||
&QualityPopup::okButtonClicked);
|
&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)
|
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->show();
|
||||||
instance->activateWindow();
|
instance->activateWindow();
|
||||||
|
@ -43,8 +44,9 @@ void QualityPopup::showDialog(const QString &channel, const QString &path, QStri
|
||||||
|
|
||||||
void QualityPopup::okButtonClicked()
|
void QualityPopup::okButtonClicked()
|
||||||
{
|
{
|
||||||
|
singletons::SettingManager &settings = singletons::SettingManager::getInstance();
|
||||||
QProcess::startDetached(this->path,
|
QProcess::startDetached(this->path,
|
||||||
{"twitch.tv/" + this->channel, this->ui.selector.currentText()});
|
{"twitch.tv/" + this->channel, this->ui.selector.currentText(), settings.streamlinkOpts});
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "basewindow.hpp"
|
#include "basewindow.hpp"
|
||||||
|
#include "singletons/settingsmanager.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ BehaviourPage::BehaviourPage()
|
||||||
groupLayout->addRow("Streamlink path:", this->createLineEdit(settings.streamlinkPath));
|
groupLayout->addRow("Streamlink path:", this->createLineEdit(settings.streamlinkPath));
|
||||||
groupLayout->addRow("Prefered quality:",
|
groupLayout->addRow("Prefered quality:",
|
||||||
this->createComboBox({STREAMLINK_QUALITY}, settings.preferredQuality));
|
this->createComboBox({STREAMLINK_QUALITY}, settings.preferredQuality));
|
||||||
|
groupLayout->addRow("Additional options:", this->createLineEdit(settings.streamlinkOpts));
|
||||||
}
|
}
|
||||||
|
|
||||||
layout->addStretch(1);
|
layout->addStretch(1);
|
||||||
|
|
|
@ -422,6 +422,7 @@ void Split::doOpenStreamlink()
|
||||||
args << quality;
|
args << quality;
|
||||||
if (exclude != "")
|
if (exclude != "")
|
||||||
args << "--stream-sorting-excludes" << exclude;
|
args << "--stream-sorting-excludes" << exclude;
|
||||||
|
args << settings.streamlinkOpts;
|
||||||
QProcess::startDetached(path, args);
|
QProcess::startDetached(path, args);
|
||||||
} else {
|
} else {
|
||||||
QProcess *p = new QProcess();
|
QProcess *p = new QProcess();
|
||||||
|
|
Loading…
Reference in a new issue