2018-01-12 23:09:05 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#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 &resourceName);
|
|
|
|
|
|
|
|
const QString &getName();
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
QString name;
|
|
|
|
QString resourceName;
|
|
|
|
|
|
|
|
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 settingspages
|
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|