mirror-chatterino2/src/widgets/settingspages/settingspage.hpp
2018-01-13 00:18:18 +01:00

40 lines
1 KiB
C++

#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 &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);
protected:
QString name;
QString iconResource;
pajlada::Signals::NoArgSignal onCancel;
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
};
} // namespace settingspages
} // namespace widgets
} // namespace chatterino