summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-07-20 08:43:46 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-08-02 03:06:58 -0400
commit6b5c9675ae1e8b343dcbc9192d43c63e482a30bd (patch)
treedc5a770496ff081dd68ec8f75e29603a33f58474 /src/settings.h
parentcff526415d781cb8a7761961ae2bd1fb6775c376 (diff)
moved SettingsTab out of Settings
split general tab
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h65
1 files changed, 24 insertions, 41 deletions
diff --git a/src/settings.h b/src/settings.h
index c66eb94c..e88080ba 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -55,8 +55,30 @@ namespace MOBase {
class IPluginGame;
}
+namespace Ui {
+ class SettingsDialog;
+}
+
class SettingsDialog;
class PluginContainer;
+class Settings;
+
+class SettingsTab
+{
+public:
+ SettingsTab(Settings *m_parent, SettingsDialog &m_dialog);
+ virtual ~SettingsTab();
+
+ virtual void update() = 0;
+
+protected:
+ Settings *m_parent;
+ QSettings &m_Settings;
+ SettingsDialog &m_dialog;
+ Ui::SettingsDialog* ui;
+
+ QWidget* parentWidget();
+};
/**
* manages the settings for Mod Organizer. The settings are not cached
@@ -404,6 +426,8 @@ public:
*/
bool colorSeparatorScrollbar() const;
+ QSettings& settingsRef() { return m_Settings; }
+
public slots:
void managedGameChanged(MOBase::IPluginGame const *gamePlugin);
@@ -414,49 +438,10 @@ private:
static bool obfuscate(const QString key, const QString data);
static QString deObfuscate(const QString key);
- void addLanguages(QComboBox *languageBox);
- void addStyles(QComboBox *styleBox);
void readPluginBlacklist();
void writePluginBlacklist();
QString getConfigurablePath(const QString &key, const QString &def, bool resolve) const;
- class SettingsTab
- {
- public:
- SettingsTab(Settings *m_parent, SettingsDialog &m_dialog);
- virtual ~SettingsTab();
-
- virtual void update() = 0;
-
- protected:
- Settings *m_parent;
- QSettings &m_Settings;
- SettingsDialog &m_dialog;
-
- };
-
- /** Display/store the configuration in the 'general' tab of the settings dialogue */
- class GeneralTab : public SettingsTab
- {
- public:
- GeneralTab(Settings *m_parent, SettingsDialog &m_dialog);
-
- void update();
-
- private:
- QComboBox *m_languageBox;
- QComboBox *m_styleBox;
- QCheckBox *m_compactBox;
- QCheckBox *m_showMetaBox;
- QCheckBox *m_usePrereleaseBox;
- QPushButton *m_overwritingBtn;
- QPushButton *m_overwrittenBtn;
- QPushButton *m_overwritingArchiveBtn;
- QPushButton *m_overwrittenArchiveBtn;
- QPushButton *m_containsBtn;
- QPushButton *m_containedBtn;
- QCheckBox *m_colorSeparatorsBox;
- };
class PathsTab : public SettingsTab
{
@@ -554,8 +539,6 @@ private:
private slots:
- void resetDialogs();
-
signals:
void languageChanged(const QString &newLanguage);