mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
parent
c0a3613ae0
commit
655831d154
|
@ -59,6 +59,15 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection
|
|||
};
|
||||
|
||||
auto doRefreshChatters = [=]() {
|
||||
const auto streamStatus = this->GetStreamStatus();
|
||||
|
||||
auto &settingManager = singletons::SettingManager::getInstance();
|
||||
if (settingManager.onlyFetchChattersForSmallerStreamers) {
|
||||
if (streamStatus.live && streamStatus.viewerCount > settingManager.smallStreamerLimit) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
util::twitch::get("https://tmi.twitch.tv/group/user/" + this->name + "/chatters",
|
||||
QThread::currentThread(), refreshChatters);
|
||||
};
|
||||
|
|
|
@ -50,6 +50,13 @@ public:
|
|||
BoolSetting allowDuplicateMessages = {"/behaviour/allowDuplicateMessages", true};
|
||||
BoolSetting mentionUsersWithAt = {"/behaviour/mentionUsersWithAt", false};
|
||||
FloatSetting mouseScrollMultiplier = {"/behaviour/mouseScrollMultiplier", 1.0};
|
||||
|
||||
// Auto-completion
|
||||
BoolSetting onlyFetchChattersForSmallerStreamers = {
|
||||
"/behaviour/autocompletion/onlyFetchChattersForSmallerStreamers", true};
|
||||
IntSetting smallStreamerLimit = {"/behaviour/autocompletion/smallStreamerLimit", 1000};
|
||||
|
||||
// Streamlink
|
||||
QStringSetting streamlinkPath = {"/behaviour/streamlink/path", ""};
|
||||
QStringSetting preferredQuality = {"/behaviour/streamlink/quality", "Choose"};
|
||||
QStringSetting streamlinkOpts = {"/behaviour/streamlink/options", ""};
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#define LAST_MSG "Show last read message indicator (marks the spot where you left the window)"
|
||||
#define PAUSE_HOVERING "When hovering"
|
||||
|
||||
#define LIMIT_CHATTERS_FOR_SMALLER_STREAMERS "Only fetch chatters list for viewers under X viewers"
|
||||
|
||||
#define STREAMLINK_QUALITY "Choose", "Source", "High", "Medium", "Low", "Audio only"
|
||||
|
||||
namespace chatterino {
|
||||
|
@ -39,8 +41,19 @@ BehaviourPage::BehaviourPage()
|
|||
|
||||
layout->addSpacing(16);
|
||||
|
||||
auto group = layout.emplace<QGroupBox>("Streamlink");
|
||||
{
|
||||
auto group = layout.emplace<QGroupBox>("Auto-completion");
|
||||
auto groupLayout = group.setLayoutType<QFormLayout>();
|
||||
groupLayout->addRow(
|
||||
LIMIT_CHATTERS_FOR_SMALLER_STREAMERS,
|
||||
this->createCheckBox("", settings.onlyFetchChattersForSmallerStreamers));
|
||||
|
||||
groupLayout->addRow("What viewer count counts as a \"smaller streamer\"",
|
||||
this->createSpinBox(settings.smallStreamerLimit, 10, 50000));
|
||||
}
|
||||
|
||||
{
|
||||
auto group = layout.emplace<QGroupBox>("Streamlink");
|
||||
auto groupLayout = group.setLayoutType<QFormLayout>();
|
||||
groupLayout->addRow("Streamlink path:", this->createLineEdit(settings.streamlinkPath));
|
||||
groupLayout->addRow("Prefered quality:",
|
||||
|
@ -53,7 +66,7 @@ BehaviourPage::BehaviourPage()
|
|||
|
||||
QSlider *BehaviourPage::createMouseScrollSlider()
|
||||
{
|
||||
QSlider *slider = new QSlider(Qt::Horizontal);
|
||||
auto slider = new QSlider(Qt::Horizontal);
|
||||
|
||||
float currentValue = singletons::SettingManager::getInstance().mouseScrollMultiplier;
|
||||
int sliderValue = ((currentValue - 0.1f) / 2.f) * 99.f;
|
||||
|
|
|
@ -79,6 +79,20 @@ QLineEdit *SettingsPage::createLineEdit(pajlada::Settings::Setting<QString> &set
|
|||
return edit;
|
||||
}
|
||||
|
||||
QSpinBox *SettingsPage::createSpinBox(pajlada::Settings::Setting<int> &setting, int min, int max)
|
||||
{
|
||||
QSpinBox *w = new QSpinBox;
|
||||
|
||||
w->setMinimum(min);
|
||||
w->setMaximum(max);
|
||||
|
||||
setting.connect([w](const int &value, auto) { w->setValue(value); });
|
||||
QObject::connect(w, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
[&setting](int value) { setting.setValue(value); });
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
#include "singletons/settingsmanager.hpp"
|
||||
|
@ -25,6 +26,7 @@ public:
|
|||
QComboBox *createComboBox(const QStringList &items,
|
||||
pajlada::Settings::Setting<QString> &setting);
|
||||
QLineEdit *createLineEdit(pajlada::Settings::Setting<QString> &setting);
|
||||
QSpinBox *createSpinBox(pajlada::Settings::Setting<int> &setting, int min = 0, int max = 2500);
|
||||
|
||||
protected:
|
||||
QString name;
|
||||
|
|
Loading…
Reference in a new issue