From 81ef3d0a8150fc90c35fd31b64fb58da7dc41090 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Sat, 20 Jun 2015 15:37:32 +0100 Subject: Factor out general, nexis, plugins tab code into individual classes Add some code and page to control what is/isn't significant in overwrite --- src/settings.h | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 2 deletions(-) (limited to 'src/settings.h') diff --git a/src/settings.h b/src/settings.h index 7e784a99..e7d0e3c4 100644 --- a/src/settings.h +++ b/src/settings.h @@ -33,6 +33,8 @@ namespace MOBase { class IPluginGame; } +class SettingsDialog; +class QCheckBox; /** * manages the settings for Mod Organizer. The settings are not cached @@ -301,8 +303,8 @@ public slots: private: - QString obfuscate(const QString &password) const; - QString deObfuscate(const QString &password) const; + static QString obfuscate(const QString &password); + static QString deObfuscate(const QString &password); void addLanguages(QComboBox *languageBox); void addStyles(QComboBox *styleBox); @@ -310,6 +312,84 @@ private: void writePluginBlacklist(); QString getConfigurablePath(const QString &key, const QString &def) const; + class GeneralTab + { + public: + GeneralTab(Settings *m_parent, SettingsDialog &m_dialog); + ~GeneralTab(); + + private: + Settings *m_parent; + QSettings &m_Settings; + SettingsDialog &m_dialog; + QComboBox *m_languageBox; + QComboBox *m_styleBox; + QComboBox *m_logLevelBox; + QLineEdit *m_downloadDirEdit; + QLineEdit *m_modDirEdit; + QLineEdit *m_cacheDirEdit; + QCheckBox *m_compactBox; + QCheckBox *m_showMetaBox; + }; + + class NexusTab + { + 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; + } + } +*/ + private: + Settings *m_parent; + QSettings &m_Settings; + SettingsDialog &m_dialog; + QCheckBox *m_loginCheckBox; + QLineEdit *m_usernameEdit; + QLineEdit *m_passwordEdit; + QCheckBox *m_offlineBox; + QCheckBox *m_proxyBox; + QListWidget *m_knownServersList; + QListWidget *m_preferredServersList; + }; + + class PluginsTab + { + public: + PluginsTab(Settings *m_parent, SettingsDialog &m_dialog); + /*: + m_parent(m_parent), + m_Settings(m_parent->m_Settings), + m_dialog(m_dialog) + { + } + */ + ~PluginsTab(); + /* + { + if (m_dialog.result() != QDialog::Accepted) { + return; + } + } +*/ + private: + Settings *m_parent; + QSettings &m_Settings; + SettingsDialog &m_dialog; + QListWidget *m_pluginsList; + QListWidget *m_pluginBlacklistList; + }; + private slots: void resetDialogs(); -- cgit v1.3.1 From 5ae279d8bb6601d6108cd51060c72c0636f38ba7 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Sun, 21 Jun 2015 07:51:05 +0100 Subject: More refactoring, slightly easier to use classes --- src/settings.cpp | 126 ++++++++++++++++++++------------------------------ src/settings.h | 83 +++++++++++++++++---------------- src/settingsdialog.ui | 2 +- 3 files changed, 92 insertions(+), 119 deletions(-) (limited to 'src/settings.h') diff --git a/src/settings.cpp b/src/settings.cpp index 8064a571..98e367fe 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -36,6 +36,8 @@ along with Mod Organizer. If not, see . #include #include +#include + using namespace MOBase; using namespace MOShared; @@ -539,14 +541,14 @@ void Settings::query(QWidget *parent) connect(&dialog, SIGNAL(resetDialogs()), this, SLOT(resetDialogs())); - GeneralTab general_tab(this, dialog); - NexusTab nexus_tab(this, dialog); - PluginsTab plugins_tab(this, dialog); -#if 0 - // plugins page - QListWidget *pluginsList = dialog.findChild("pluginsList"); - QListWidget *pluginBlacklistList = dialog.findChild("pluginBlacklist"); -#endif + std::vector> tabs; + //Don't you love C++? + //tabs.push_back(new GeneralTab(this, dialog)); + tabs.push_back(std::unique_ptr(new GeneralTab(this, dialog))); + tabs.push_back(std::unique_ptr(new NexusTab(this, dialog))); + tabs.push_back(std::unique_ptr(new SteamTab(this, dialog))); + tabs.push_back(std::unique_ptr(new PluginsTab(this, dialog))); + // workarounds page QCheckBox *forceEnableBox = dialog.findChild("forceEnableBox"); QComboBox *mechanismBox = dialog.findChild("mechanismBox"); @@ -554,11 +556,6 @@ void Settings::query(QWidget *parent) QLineEdit *nmmVersionEdit = dialog.findChild("nmmVersionEdit"); QCheckBox *hideUncheckedBox = dialog.findChild("hideUncheckedBox"); QCheckBox *displayForeignBox = dialog.findChild("displayForeignBox"); - - // steam login page - QLineEdit *steamUserEdit = dialog.findChild("steamUserEdit"); - QLineEdit *steamPassEdit = dialog.findChild("steamPassEdit"); - // // set up current settings // @@ -593,30 +590,12 @@ void Settings::query(QWidget *parent) forceEnableBox->setChecked(forceEnableCoreFiles()); appIDEdit->setText(getSteamAppID()); - if (m_Settings.contains("Settings/steam_username")) { - steamUserEdit->setText(m_Settings.value("Settings/steam_username", "").toString()); - if (m_Settings.contains("Settings/steam_password")) { - steamPassEdit->setText(deObfuscate(m_Settings.value("Settings/steam_password", "").toString())); - } - } nmmVersionEdit->setText(getNMMVersion()); -#if 0 - // display plugin settings - foreach (IPlugin *plugin, m_Plugins) { - QListWidgetItem *listItem = new QListWidgetItem(plugin->name(), pluginsList); - listItem->setData(Qt::UserRole, QVariant::fromValue((void*)plugin)); - listItem->setData(Qt::UserRole + 1, m_PluginSettings[plugin->name()]); - listItem->setData(Qt::UserRole + 2, m_PluginDescriptions[plugin->name()]); - pluginsList->addItem(listItem); - } - - // display plugin blacklist - foreach (const QString &pluginName, m_PluginBlacklist) { - pluginBlacklistList->addItem(pluginName); - } -#endif if (dialog.exec() == QDialog::Accepted) { + for (std::unique_ptr const &tab: tabs) { + tab->update(); + } // // transfer modified settings to configuration file // @@ -630,38 +609,25 @@ void Settings::query(QWidget *parent) } else { m_Settings.remove("Settings/app_id"); } - setSteamLogin(steamUserEdit->text(), steamPassEdit->text()); m_Settings.setValue("Settings/display_foreign", displayForeignBox->isChecked()); m_Settings.setValue("Settings/nmm_version", nmmVersionEdit->text()); -#if 0 - // transfer plugin settings to in-memory structure - for (int i = 0; i < pluginsList->count(); ++i) { - QListWidgetItem *item = pluginsList->item(i); - m_PluginSettings[item->text()] = item->data(Qt::UserRole + 1).toMap(); - } - // store plugin settings on disc - for (auto iterPlugins = m_PluginSettings.begin(); iterPlugins != m_PluginSettings.end(); ++iterPlugins) { - for (auto iterSettings = iterPlugins->begin(); iterSettings != iterPlugins->end(); ++iterSettings) { - m_Settings.setValue("Plugins/" + iterPlugins.key() + "/" + iterSettings.key(), iterSettings.value()); - } - } - - // store plugin blacklist - m_PluginBlacklist.clear(); - foreach (QListWidgetItem *item, pluginBlacklistList->findItems("*", Qt::MatchWildcard)) { - m_PluginBlacklist.insert(item->text()); - } - writePluginBlacklist(); -#endif } } -Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) : +Settings::SettingsTab::SettingsTab(Settings *m_parent, SettingsDialog &m_dialog) : m_parent(m_parent), m_Settings(m_parent->m_Settings), - m_dialog(m_dialog), + m_dialog(m_dialog) +{ +} + +Settings::SettingsTab::~SettingsTab() +{} + +Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) : + Settings::SettingsTab(m_parent, m_dialog), m_languageBox(m_dialog.findChild("languageBox")), m_styleBox(m_dialog.findChild("styleBox")), m_logLevelBox(m_dialog.findChild("logLevelBox")), @@ -671,7 +637,7 @@ Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) : m_compactBox(m_dialog.findChild("compactBox")), m_showMetaBox(m_dialog.findChild("showMetaBox")) { - //FIXME I think 'this function 'addLanguages' lives in here not in parent + //FIXME I think 'addLanguages' lives in here not in parent m_parent->addLanguages(m_languageBox); { QString languageCode = m_parent->language(); @@ -703,12 +669,8 @@ Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) : m_showMetaBox->setChecked(m_parent->metaDownloads()); } -Settings::GeneralTab::~GeneralTab() +void Settings::GeneralTab::update() { - if (m_dialog.result() != QDialog::Accepted) { - return; - } - QString oldLanguage = m_Settings.value("Settings/language", "en_US").toString(); QString newLanguage = m_languageBox->itemData(m_languageBox->currentIndex()).toString(); if (newLanguage != oldLanguage) { @@ -770,9 +732,7 @@ Settings::GeneralTab::~GeneralTab() } Settings::NexusTab::NexusTab(Settings *m_parent, SettingsDialog &m_dialog) : - m_parent(m_parent), - m_Settings(m_parent->m_Settings), - m_dialog(m_dialog), + Settings::SettingsTab(m_parent, m_dialog), m_loginCheckBox(m_dialog.findChild("loginCheckBox")), m_usernameEdit(m_dialog.findChild("usernameEdit")), m_passwordEdit(m_dialog.findChild("passwordEdit")), @@ -816,11 +776,8 @@ Settings::NexusTab::NexusTab(Settings *m_parent, SettingsDialog &m_dialog) : m_Settings.endGroup(); } -Settings::NexusTab::~NexusTab() +void Settings::NexusTab::update() { - if (m_dialog.result() != QDialog::Accepted) { - return; - } if (m_loginCheckBox->isChecked()) { m_Settings.setValue("Settings/nexus_login", true); m_Settings.setValue("Settings/nexus_username", m_usernameEdit->text()); @@ -851,10 +808,28 @@ Settings::NexusTab::~NexusTab() m_Settings.endGroup(); } + +Settings::SteamTab::SteamTab(Settings *m_parent, SettingsDialog &m_dialog) : + Settings::SettingsTab(m_parent, m_dialog), + m_steamUserEdit(m_dialog.findChild("steamUserEdit")), + m_steamPassEdit(m_dialog.findChild("steamPassEdit")) +{ + if (m_Settings.contains("Settings/steam_username")) { + m_steamUserEdit->setText(m_Settings.value("Settings/steam_username", "").toString()); + if (m_Settings.contains("Settings/steam_password")) { + m_steamPassEdit->setText(deObfuscate(m_Settings.value("Settings/steam_password", "").toString())); + } + } +} + +void Settings::SteamTab::update() +{ + //FIXME this should be inlined here? + m_parent->setSteamLogin(m_steamUserEdit->text(), m_steamPassEdit->text()); +} + Settings::PluginsTab::PluginsTab(Settings *m_parent, SettingsDialog &m_dialog) : - m_parent(m_parent), - m_Settings(m_parent->m_Settings), - m_dialog(m_dialog), + Settings::SettingsTab(m_parent, m_dialog), m_pluginsList(m_dialog.findChild("pluginsList")), m_pluginBlacklistList(m_dialog.findChild("pluginBlacklist")) { @@ -873,11 +848,8 @@ Settings::PluginsTab::PluginsTab(Settings *m_parent, SettingsDialog &m_dialog) : } } -Settings::PluginsTab:: ~PluginsTab() +void Settings::PluginsTab::update() { - if (m_dialog.result() != QDialog::Accepted) { - return; - } // transfer plugin settings to in-memory structure for (int i = 0; i < m_pluginsList->count(); ++i) { QListWidgetItem *item = m_pluginsList->item(i); 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(); diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index e947afdc..a7543a00 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -17,7 +17,7 @@ - 1 + 0 -- cgit v1.3.1 From 7602fef6e7ffe8afa531c5b0ef6205b05a8e33a5 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Sun, 21 Jun 2015 18:27:03 +0100 Subject: Finish refactoring all the tab code into classes --- src/settings.cpp | 126 +++++++++++++++++++++++++++---------------------------- src/settings.h | 16 +++++++ 2 files changed, 78 insertions(+), 64 deletions(-) (limited to 'src/settings.h') diff --git a/src/settings.cpp b/src/settings.cpp index 98e367fe..ade3f033 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -542,77 +542,18 @@ void Settings::query(QWidget *parent) connect(&dialog, SIGNAL(resetDialogs()), this, SLOT(resetDialogs())); std::vector> tabs; - //Don't you love C++? - //tabs.push_back(new GeneralTab(this, dialog)); + tabs.push_back(std::unique_ptr(new GeneralTab(this, dialog))); tabs.push_back(std::unique_ptr(new NexusTab(this, dialog))); tabs.push_back(std::unique_ptr(new SteamTab(this, dialog))); tabs.push_back(std::unique_ptr(new PluginsTab(this, dialog))); - - // workarounds page - QCheckBox *forceEnableBox = dialog.findChild("forceEnableBox"); - QComboBox *mechanismBox = dialog.findChild("mechanismBox"); - QLineEdit *appIDEdit = dialog.findChild("appIDEdit"); - QLineEdit *nmmVersionEdit = dialog.findChild("nmmVersionEdit"); - QCheckBox *hideUncheckedBox = dialog.findChild("hideUncheckedBox"); - QCheckBox *displayForeignBox = dialog.findChild("displayForeignBox"); - // - // set up current settings - // - LoadMechanism::EMechanism mechanismID = getLoadMechanism(); - int index = 0; - - if (m_LoadMechanism.isDirectLoadingSupported()) { - mechanismBox->addItem(QObject::tr("Mod Organizer"), LoadMechanism::LOAD_MODORGANIZER); - if (mechanismID == LoadMechanism::LOAD_MODORGANIZER) { - index = mechanismBox->count() - 1; - } - } - - if (m_LoadMechanism.isScriptExtenderSupported()) { - mechanismBox->addItem(QObject::tr("Script Extender"), LoadMechanism::LOAD_SCRIPTEXTENDER); - if (mechanismID == LoadMechanism::LOAD_SCRIPTEXTENDER) { - index = mechanismBox->count() - 1; - } - } - - if (m_LoadMechanism.isProxyDLLSupported()) { - mechanismBox->addItem(QObject::tr("Proxy DLL"), LoadMechanism::LOAD_PROXYDLL); - if (mechanismID == LoadMechanism::LOAD_PROXYDLL) { - index = mechanismBox->count() - 1; - } - } - - mechanismBox->setCurrentIndex(index); - - hideUncheckedBox->setChecked(hideUncheckedPlugins()); - displayForeignBox->setChecked(displayForeign()); - forceEnableBox->setChecked(forceEnableCoreFiles()); - - appIDEdit->setText(getSteamAppID()); - nmmVersionEdit->setText(getNMMVersion()); + tabs.push_back(std::unique_ptr(new WorkaroundsTab(this, dialog))); if (dialog.exec() == QDialog::Accepted) { + // transfer modified settings to configuration file for (std::unique_ptr const &tab: tabs) { tab->update(); } - // - // transfer modified settings to configuration file - // - - m_Settings.setValue("Settings/hide_unchecked_plugins", hideUncheckedBox->checkState() ? true : false); - m_Settings.setValue("Settings/force_enable_core_files", forceEnableBox->checkState() ? true : false); - m_Settings.setValue("Settings/load_mechanism", mechanismBox->itemData(mechanismBox->currentIndex()).toInt()); - - if (appIDEdit->text() != m_GamePlugin->steamAPPId()) { - m_Settings.setValue("Settings/app_id", appIDEdit->text()); - } else { - m_Settings.remove("Settings/app_id"); - } - m_Settings.setValue("Settings/display_foreign", displayForeignBox->isChecked()); - - m_Settings.setValue("Settings/nmm_version", nmmVersionEdit->text()); - } } @@ -620,8 +561,7 @@ Settings::SettingsTab::SettingsTab(Settings *m_parent, SettingsDialog &m_dialog) m_parent(m_parent), m_Settings(m_parent->m_Settings), m_dialog(m_dialog) -{ -} +{} Settings::SettingsTab::~SettingsTab() {} @@ -869,3 +809,61 @@ void Settings::PluginsTab::update() } m_parent->writePluginBlacklist(); } + +Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, SettingsDialog &m_dialog) : + Settings::SettingsTab(m_parent, m_dialog), + m_appIDEdit(m_dialog.findChild("appIDEdit")), + m_mechanismBox(m_dialog.findChild("mechanismBox")), + m_nmmVersionEdit(m_dialog.findChild("nmmVersionEdit")), + m_hideUncheckedBox(m_dialog.findChild("hideUncheckedBox")), + m_forceEnableBox(m_dialog.findChild("forceEnableBox")), + m_displayForeignBox(m_dialog.findChild("displayForeignBox")) +{ + m_appIDEdit->setText(m_parent->getSteamAppID()); + + LoadMechanism::EMechanism mechanismID = m_parent->getLoadMechanism(); + int index = 0; + + if (m_parent->m_LoadMechanism.isDirectLoadingSupported()) { + m_mechanismBox->addItem(QObject::tr("Mod Organizer"), LoadMechanism::LOAD_MODORGANIZER); + if (mechanismID == LoadMechanism::LOAD_MODORGANIZER) { + index = m_mechanismBox->count() - 1; + } + } + + if (m_parent->m_LoadMechanism.isScriptExtenderSupported()) { + m_mechanismBox->addItem(QObject::tr("Script Extender"), LoadMechanism::LOAD_SCRIPTEXTENDER); + if (mechanismID == LoadMechanism::LOAD_SCRIPTEXTENDER) { + index = m_mechanismBox->count() - 1; + } + } + + if (m_parent->m_LoadMechanism.isProxyDLLSupported()) { + m_mechanismBox->addItem(QObject::tr("Proxy DLL"), LoadMechanism::LOAD_PROXYDLL); + if (mechanismID == LoadMechanism::LOAD_PROXYDLL) { + index = m_mechanismBox->count() - 1; + } + } + + m_mechanismBox->setCurrentIndex(index); + + m_nmmVersionEdit->setText(m_parent->getNMMVersion()); + m_hideUncheckedBox->setChecked(m_parent->hideUncheckedPlugins()); + m_forceEnableBox->setChecked(m_parent->forceEnableCoreFiles()); + m_displayForeignBox->setChecked(m_parent->displayForeign()); + +} + +void Settings::WorkaroundsTab::update() +{ + if (m_appIDEdit->text() != m_parent->m_GamePlugin->steamAPPId()) { + m_Settings.setValue("Settings/app_id", m_appIDEdit->text()); + } else { + m_Settings.remove("Settings/app_id"); + } + m_Settings.setValue("Settings/load_mechanism", m_mechanismBox->itemData(m_mechanismBox->currentIndex()).toInt()); + m_Settings.setValue("Settings/nmm_version", m_nmmVersionEdit->text()); + m_Settings.setValue("Settings/hide_unchecked_plugins", m_hideUncheckedBox->isChecked()); + m_Settings.setValue("Settings/force_enable_core_files", m_forceEnableBox->isChecked()); + m_Settings.setValue("Settings/display_foreign", m_displayForeignBox->isChecked()); +} diff --git a/src/settings.h b/src/settings.h index bc21ca5b..7d6fe229 100644 --- a/src/settings.h +++ b/src/settings.h @@ -390,6 +390,22 @@ private: QListWidget *m_pluginBlacklistList; }; + /** Display/store the configuration in the 'workarounds' tab of the settings dialogue */ + class WorkaroundsTab : SettingsTab + { + public: + WorkaroundsTab(Settings *m_parent, SettingsDialog &m_dialog); + + void update(); + + private: + QLineEdit *m_appIDEdit; + QComboBox *m_mechanismBox; + QLineEdit *m_nmmVersionEdit; + QCheckBox *m_hideUncheckedBox; + QCheckBox *m_forceEnableBox; + QCheckBox *m_displayForeignBox; + }; private slots: -- cgit v1.3.1 From ca591dbd230bf49abad63bb13a30d04cc4725ff8 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Tue, 23 Jun 2015 20:27:38 +0100 Subject: and now I find out I don't need to do it at all --- src/settings.cpp | 4 +-- src/settings.h | 4 +-- src/settingsdialog.ui | 80 --------------------------------------------------- 3 files changed, 4 insertions(+), 84 deletions(-) (limited to 'src/settings.h') diff --git a/src/settings.cpp b/src/settings.cpp index ade3f033..4c2a34c8 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -330,12 +330,12 @@ void Settings::setupLoadMechanism() } -bool Settings::useProxy() +bool Settings::useProxy() const { return m_Settings.value("Settings/use_proxy", false).toBool(); } -bool Settings::displayForeign() +bool Settings::displayForeign() const { return m_Settings.value("Settings/display_foreign", true).toBool(); } diff --git a/src/settings.h b/src/settings.h index 7d6fe229..def1dc5c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -202,12 +202,12 @@ public: /** * @return true if the user configured the use of a network proxy */ - bool useProxy(); + bool useProxy() const; /** * @return true if the user wants to see non-official plugins installed outside MO in his mod list */ - bool displayForeign(); + bool displayForeign() const; /** * @brief sets the new motd hash diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index a7543a00..b88885dc 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -884,86 +884,6 @@ For the other games this is not a sufficient replacement for AI! - - - Overwrite - - - - - - - - - Ignore .log files (implies ignore empty directories) - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - The tab controls various customisations of the overwrite directory - - - - - - - - - - Ignore empty directories - - - - - -- cgit v1.3.1