2018-01-12 23:09:05 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QLineEdit>
|
2018-03-30 15:42:59 +02:00
|
|
|
#include <QSpinBox>
|
2018-01-12 23:09:05 +01:00
|
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
|
2018-06-28 19:46:45 +02:00
|
|
|
#include "singletons/Settings.hpp"
|
2018-01-12 23:09:05 +01:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class SettingsPage : public QWidget
|
|
|
|
{
|
|
|
|
public:
|
2018-01-13 00:18:18 +01:00
|
|
|
SettingsPage(const QString &name, const QString &iconResource);
|
2018-01-12 23:09:05 +01:00
|
|
|
|
|
|
|
const QString &getName();
|
2018-01-13 00:18:18 +01:00
|
|
|
const QString &getIconResource();
|
2018-01-12 23:09:05 +01:00
|
|
|
|
|
|
|
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);
|
2018-03-30 15:42:59 +02:00
|
|
|
QSpinBox *createSpinBox(pajlada::Settings::Setting<int> &setting, int min = 0, int max = 2500);
|
2018-01-12 23:09:05 +01:00
|
|
|
|
2018-05-12 20:34:13 +02:00
|
|
|
virtual void onShow()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-01-12 23:09:05 +01:00
|
|
|
protected:
|
|
|
|
QString name;
|
2018-01-13 00:18:18 +01:00
|
|
|
QString iconResource;
|
2018-01-12 23:09:05 +01:00
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal onCancel;
|
|
|
|
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
|
|
|
|
};
|
2018-01-12 23:33:04 +01:00
|
|
|
|
2018-01-12 23:09:05 +01:00
|
|
|
} // namespace chatterino
|