bf0b5d08d8
Simplify authorized network requests for Twitch V5 api add onShow virtual function to settings pages if they need to be refreshed when shown Actually ignoring messages from ignored users is still not implemented Working on #247
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <QCheckBox>
|
|
#include <QComboBox>
|
|
#include <QLineEdit>
|
|
#include <QSpinBox>
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
#include "singletons/settingsmanager.hpp"
|
|
|
|
namespace chatterino {
|
|
namespace widgets {
|
|
namespace settingspages {
|
|
|
|
class SettingsPage : public QWidget
|
|
{
|
|
public:
|
|
SettingsPage(const QString &name, const QString &iconResource);
|
|
|
|
const QString &getName();
|
|
const QString &getIconResource();
|
|
|
|
void cancel();
|
|
|
|
QCheckBox *createCheckBox(const QString &text, pajlada::Settings::Setting<bool> &setting);
|
|
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);
|
|
|
|
virtual void onShow()
|
|
{
|
|
}
|
|
|
|
protected:
|
|
QString name;
|
|
QString iconResource;
|
|
|
|
pajlada::Signals::NoArgSignal onCancel;
|
|
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
|
|
};
|
|
|
|
} // namespace settingspages
|
|
} // namespace widgets
|
|
} // namespace chatterino
|