refactor the refactor

This commit is contained in:
Rasmus Karlsson 2018-01-12 23:33:04 +01:00
parent e0bb061c81
commit 7772f245f6
5 changed files with 15 additions and 45 deletions

View file

@ -1,5 +1,6 @@
#include "widgets/helper/settingsdialogtab.hpp"
#include "widgets/settingsdialog.hpp"
#include "widgets/settingspages/settingspage.hpp"
#include <QPainter>
#include <QStyleOption>

View file

@ -1,14 +1,6 @@
#include "widgets/settingsdialog.hpp"
#include "const.hpp"
#include "debug/log.hpp"
#include "singletons/accountmanager.hpp"
#include "singletons/commandmanager.hpp"
#include "singletons/windowmanager.hpp"
#include "twitch/twitchmessagebuilder.hpp"
#include "twitch/twitchuser.hpp"
#include "util/layoutcreator.hpp"
#include "widgets/helper/settingsdialogtab.hpp"
#include "widgets/logindialog.hpp"
#include "widgets/settingspages/aboutpage.hpp"
#include "widgets/settingspages/accountspage.hpp"
#include "widgets/settingspages/appearancepage.hpp"
@ -19,22 +11,7 @@
#include "widgets/settingspages/logspage.hpp"
#include "widgets/settingspages/moderationpage.hpp"
#include <QComboBox>
#include <QDebug>
#include <QFile>
#include <QFileDialog>
#include <QFont>
#include <QFontDialog>
#include <QFormLayout>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGroupBox>
#include <QLabel>
#include <QListWidget>
#include <QPalette>
#include <QResource>
#include <QTextEdit>
#include <QtSvg>
#include <QDialogButtonBox>
namespace chatterino {
namespace widgets {

View file

@ -1,41 +1,27 @@
#pragma once
#include "singletons/settingsmanager.hpp"
#include "widgets/accountswitchwidget.hpp"
#include "widgets/helper/settingsdialogtab.hpp"
#include "widgets/settingspages/appearancepage.hpp"
#include "basewidget.hpp"
#include <QButtonGroup>
#include <QCheckBox>
#include <QComboBox>
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QListView>
#include <QListWidget>
#include <QMainWindow>
#include <QPushButton>
#include <QStackedLayout>
#include <QTimer>
#include <QVBoxLayout>
#include <QWidget>
#include <pajlada/settings/setting.hpp>
#include "basewidget.hpp"
namespace chatterino {
namespace widgets {
namespace settingspages {
class SettingsPage;
}
class SettingsDialogTab;
class SettingsDialog : public BaseWidget
{
public:
SettingsDialog();
void select(SettingsDialogTab *tab);
friend class SettingsDialogTab;
public:
static SettingsDialog *getHandle(); // may be NULL
enum class PreferredTab {
@ -66,11 +52,15 @@ private:
void addTabs();
void addTab(settingspages::SettingsPage *page, Qt::Alignment alignment = Qt::AlignTop);
void select(SettingsDialogTab *tab);
SettingsDialogTab *selectedTab = nullptr;
void okButtonClicked();
void cancelButtonClicked();
friend class SettingsDialogTab;
// static void setChildrensFont(QLayout *object, QFont &font, int indent = 0);
};

View file

@ -73,6 +73,7 @@ QLineEdit *SettingsPage::createLineEdit(pajlada::Settings::Setting<QString> &set
return edit;
}
} // namespace settingspages
} // namespace widgets
} // namespace chatterino

View file

@ -32,6 +32,7 @@ protected:
pajlada::Signals::NoArgSignal onCancel;
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
};
} // namespace settingspages
} // namespace widgets
} // namespace chatterino