mirror-chatterino2/widgets/settingsdialog.h

59 lines
1.2 KiB
C
Raw Normal View History

2017-01-01 18:43:52 +01:00
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
2017-04-12 17:46:44 +02:00
#include "settingsmanager.h"
2017-01-24 19:51:57 +01:00
#include "settingssnapshot.h"
2017-01-18 21:30:23 +01:00
#include "widgets/settingsdialogtab.h"
2017-01-01 18:43:52 +01:00
2017-01-18 04:33:30 +01:00
#include <QButtonGroup>
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QListView>
#include <QMainWindow>
#include <QPushButton>
#include <QStackedLayout>
#include <QVBoxLayout>
#include <QWidget>
2017-04-14 17:52:22 +02:00
namespace chatterino {
namespace widgets {
2017-01-18 21:30:23 +01:00
2017-01-02 03:02:32 +01:00
class SettingsDialog : public QWidget
2017-01-01 18:43:52 +01:00
{
public:
SettingsDialog();
2017-01-11 18:52:09 +01:00
void select(SettingsDialogTab *tab);
2017-01-02 03:02:32 +01:00
static void showDialog();
2017-01-01 18:43:52 +01:00
private:
2017-04-12 17:46:44 +02:00
SettingsSnapshot _snapshot;
2017-01-24 19:51:57 +01:00
2017-04-12 17:46:44 +02:00
QVBoxLayout _tabs;
QVBoxLayout _vbox;
QHBoxLayout _hbox;
QStackedLayout _pageStack;
QDialogButtonBox _buttonBox;
QPushButton _okButton;
QPushButton _cancelButton;
2017-01-02 03:02:32 +01:00
2017-01-11 18:52:09 +01:00
void addTab(QLayout *layout, QString title, QString imageRes);
2017-01-02 03:02:32 +01:00
void addTabs();
2017-01-01 18:43:52 +01:00
2017-04-12 17:46:44 +02:00
SettingsDialogTab *_selectedTab = NULL;
2017-01-03 21:19:33 +01:00
/// Widget creation helpers
2017-01-24 19:51:57 +01:00
QCheckBox *createCheckbox(const QString &title, Setting<bool> &setting);
void okButtonClicked();
void cancelButtonClicked();
2017-01-01 18:43:52 +01:00
};
2017-04-14 17:52:22 +02:00
} // namespace widgets
} // namespace chatterino
2017-01-01 18:43:52 +01:00
2017-01-11 18:52:09 +01:00
#endif // SETTINGSDIALOG_H