diff options
| author | Tom Tanner <thosrtanner2@users.sourceforge.net> | 2015-06-21 07:51:05 +0100 |
|---|---|---|
| committer | Tom Tanner <thosrtanner2@users.sourceforge.net> | 2015-06-21 07:51:05 +0100 |
| commit | 5ae279d8bb6601d6108cd51060c72c0636f38ba7 (patch) | |
| tree | f6bf57c6d8764e3aeece56582481403d8e874dee /src/settings.h | |
| parent | 81ef3d0a8150fc90c35fd31b64fb58da7dc41090 (diff) | |
More refactoring, slightly easier to use classes
Diffstat (limited to 'src/settings.h')
| -rw-r--r-- | src/settings.h | 83 |
1 files changed, 42 insertions, 41 deletions
diff --git a/src/settings.h b/src/settings.h index e7d0e3c4..bc21ca5b 100644 --- a/src/settings.h +++ b/src/settings.h @@ -312,16 +312,30 @@ private: void writePluginBlacklist(); QString getConfigurablePath(const QString &key, const QString &def) const; - class GeneralTab + class SettingsTab { public: - GeneralTab(Settings *m_parent, SettingsDialog &m_dialog); - ~GeneralTab(); + SettingsTab(Settings *m_parent, SettingsDialog &m_dialog); + virtual ~SettingsTab(); - private: + 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 : SettingsTab + { + public: + GeneralTab(Settings *m_parent, SettingsDialog &m_dialog); + + void update(); + + private: QComboBox *m_languageBox; QComboBox *m_styleBox; QComboBox *m_logLevelBox; @@ -332,28 +346,15 @@ private: QCheckBox *m_showMetaBox; }; - class NexusTab + /** Display/store the configuration in the 'nexus' tab of the settings dialogue */ + class NexusTab : SettingsTab { public: NexusTab(Settings *m_parent, SettingsDialog &m_dialog); - /*: - m_parent(m_parent), - m_settings(m_parent->m_Settings), - m_dialog(m_dialog) - {} - */ - ~NexusTab(); - /* - { - if (m_dialog.result() != QDialog::Accepted) { - return; - } - } -*/ + + void update(); + private: - Settings *m_parent; - QSettings &m_Settings; - SettingsDialog &m_dialog; QCheckBox *m_loginCheckBox; QLineEdit *m_usernameEdit; QLineEdit *m_passwordEdit; @@ -363,33 +364,33 @@ private: QListWidget *m_preferredServersList; }; - class PluginsTab + /** Display/store the configuration in the 'steam' tab of the settings dialogue */ + class SteamTab : SettingsTab { public: - PluginsTab(Settings *m_parent, SettingsDialog &m_dialog); - /*: - m_parent(m_parent), - m_Settings(m_parent->m_Settings), - m_dialog(m_dialog) - { - } - */ - ~PluginsTab(); - /* + SteamTab(Settings *m_parent, SettingsDialog &m_dialog); + + void update(); + + private: + QLineEdit *m_steamUserEdit; + QLineEdit *m_steamPassEdit; + }; + + /** Display/store the configuration in the 'plugins' tab of the settings dialogue */ + class PluginsTab : SettingsTab { - if (m_dialog.result() != QDialog::Accepted) { - return; - } - } -*/ + public: + PluginsTab(Settings *m_parent, SettingsDialog &m_dialog); + + void update(); + private: - Settings *m_parent; - QSettings &m_Settings; - SettingsDialog &m_dialog; QListWidget *m_pluginsList; QListWidget *m_pluginBlacklistList; }; + private slots: void resetDialogs(); |
