From d0796b4ab23122d5f01378743d93f8c75b19c35c Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Fri, 29 Jan 2021 19:43:24 +0100 Subject: Move settings around. Remove unused settings. --- src/organizercore.cpp | 5 +- src/pluginlist.cpp | 20 +- src/pluginlist.h | 6 +- src/profile.cpp | 5 - src/profile.h | 6 - src/settings.cpp | 56 - src/settings.h | 16 - src/settingsdialog.ui | 2174 +++++++++++++++++++------------------ src/settingsdialogworkarounds.cpp | 17 - 9 files changed, 1125 insertions(+), 1180 deletions(-) (limited to 'src') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index df4cfe5e..e5aa6ed5 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1863,9 +1863,7 @@ void OrganizerCore::savePluginList() }); return; } - m_PluginList.saveTo(m_CurrentProfile->getLockedOrderFileName(), - m_CurrentProfile->getDeleterFileName(), - m_Settings.game().hideUncheckedPlugins()); + m_PluginList.saveTo(m_CurrentProfile->getLockedOrderFileName()); m_PluginList.saveLoadOrder(*m_DirectoryStructure); } @@ -1878,7 +1876,6 @@ void OrganizerCore::saveCurrentProfile() m_CurrentProfile->writeModlist(); m_CurrentProfile->createTweakedIniFile(); saveCurrentLists(); - m_Settings.game().loadMechanism().activate(m_Settings.game().loadMechanismType()); storeSettings(); } diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 1c86a4a7..9733d4f3 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -583,9 +583,7 @@ void PluginList::writeLockedOrder(const QString &fileName) const file.commit(); } -void PluginList::saveTo(const QString &lockedOrderFileName - , const QString& deleterFileName - , bool hideUnchecked) const +void PluginList::saveTo(const QString &lockedOrderFileName) const { GamePlugins *gamePlugins = m_GamePlugin->feature(); if (gamePlugins) { @@ -593,22 +591,6 @@ void PluginList::saveTo(const QString &lockedOrderFileName } writeLockedOrder(lockedOrderFileName); - - if (hideUnchecked) { - SafeWriteFile deleterFile(deleterFileName); - deleterFile->write(QString("# This file was automatically generated by Mod Organizer.\r\n").toUtf8()); - - for (size_t i = 0; i < m_ESPs.size(); ++i) { - int priority = m_ESPsByPriority[i]; - if (!m_ESPs[priority].enabled) { - deleterFile->write(m_ESPs[priority].name.toUtf8()); - deleterFile->write("\r\n"); - } - } - deleterFile.commitIfDifferent(m_LastSaveHash[deleterFileName]); - } else if (QFile::exists(deleterFileName)) { - shellDelete(QStringList() << deleterFileName); - } } diff --git a/src/pluginlist.h b/src/pluginlist.h index c16bfc98..e12a8798 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -180,12 +180,8 @@ public: * @brief save the plugin status to the specified file * * @param lockedOrderFileName path of the lockedorder.txt to write to - * @param deleterFileName file to receive a list of files to hide from the virtual data tree. This is used to hide unchecked plugins if "hideUnchecked" is true - * @param hideUnchecked if true, plugins that aren't enabled will be hidden from the virtual data directory **/ - void saveTo(const QString &lockedOrderFileName - , const QString &deleterFileName - , bool hideUnchecked) const; + void saveTo(const QString &lockedOrderFileName) const; /** * @brief save the current load order diff --git a/src/profile.cpp b/src/profile.cpp index 2546661b..f43ac3a1 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -934,11 +934,6 @@ QString Profile::getArchivesFileName() const return QDir::cleanPath(m_Directory.absoluteFilePath("archives.txt")); } -QString Profile::getDeleterFileName() const -{ - return QDir::cleanPath(m_Directory.absoluteFilePath("hide_plugins.txt")); -} - QString Profile::getIniFileName() const { auto iniFiles = m_GamePlugin->iniFiles(); diff --git a/src/profile.h b/src/profile.h index 672a2c13..457d8015 100644 --- a/src/profile.h +++ b/src/profile.h @@ -189,12 +189,6 @@ public: */ QString getArchivesFileName() const; - /** - * @return the path of the delete file in this profile - * @note the deleter file lists plugins that should be hidden from the game and other tools - **/ - QString getDeleterFileName() const; - /** * @return the path of the ini file in this profile * @todo since the game can contain multiple ini files (i.e. skyrim.ini skyrimprefs.ini) diff --git a/src/settings.cpp b/src/settings.cpp index 142d3f39..20745873 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -612,62 +612,6 @@ void GameSettings::setSelectedProfileName(const QString& name) set(m_Settings, "General", "selected_profile", name.toUtf8()); } -LoadMechanism::EMechanism GameSettings::loadMechanismType() const -{ - const auto def = LoadMechanism::LOAD_MODORGANIZER; - - const auto i = get(m_Settings, - "Settings", "load_mechanism", def); - - switch (i) - { - // ok - case LoadMechanism::LOAD_MODORGANIZER: // fall-through - { - break; - } - - default: - { - log::error( - "invalid load mechanism {}, reverting to {}", - static_cast(i), toString(def)); - - set(m_Settings, "Settings", "load_mechanism", def); - - return def; - } - } - - return i; -} - -void GameSettings::setLoadMechanism(LoadMechanism::EMechanism m) -{ - set(m_Settings, "Settings", "load_mechanism", m); -} - -const LoadMechanism& GameSettings::loadMechanism() const -{ - return m_LoadMechanism; -} - -LoadMechanism& GameSettings::loadMechanism() -{ - return m_LoadMechanism; -} - -bool GameSettings::hideUncheckedPlugins() const -{ - return get(m_Settings, "Settings", "hide_unchecked_plugins", false); -} - -void GameSettings::setHideUncheckedPlugins(bool b) -{ - set(m_Settings, "Settings", "hide_unchecked_plugins", b); -} - - GeometrySettings::GeometrySettings(QSettings& s) : m_Settings(s), m_Reset(false) { diff --git a/src/settings.h b/src/settings.h index 96290f55..602ba4dd 100644 --- a/src/settings.h +++ b/src/settings.h @@ -83,22 +83,6 @@ public: std::optional selectedProfileName() const; void setSelectedProfileName(const QString& name); - // load mechanism type - // - LoadMechanism::EMechanism loadMechanismType() const; - void setLoadMechanism(LoadMechanism::EMechanism m); - - // load mechanism object - // - const LoadMechanism& loadMechanism() const; - LoadMechanism& loadMechanism(); - - // whether the user wants unchecked plugins (esp, esm) to be hidden from - // the virtual data directory - // - bool hideUncheckedPlugins() const; - void setHideUncheckedPlugins(bool b); - private: QSettings& m_Settings; const MOBase::IPluginGame* m_GamePlugin; diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index a223d628..3ea7b735 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -23,36 +23,29 @@ General - + - - + + + Qt::Vertical + + - 16777215 - 16777215 + 0 + 0 - - Reset all choices made in dialogs. - - - Reset all choices made in dialogs. - - - Reset Dialog Choices - - + - - - Show confirmation when changing instance + + + + 0 + 200 + - - - - - + 0 @@ -65,38 +58,238 @@ 0 - - - - Language + + + + Download List + + + + + Show meta information instead of file names in the download list. + + + Show meta information instead of file names in the download list. + + + Show meta information + + + + + + + Make the download list more compact. + + + Make the download list more compact. + + + Compact list + + + + + + + Automatically hide downloads after successful installation. + + + Automatically hide downloads after successful installation. + + + Hide downloads after installation + + + + - - - - Style + + + + Updates + + + + + + Check for Mod Organizer updates on Github on startup. + + + Check for Mod Organizer updates on Github on startup. + + + Check for updates + + + + + + + Update to non-stable releases. + + + Update to non-stable releases. + + + Update to beta versions + + + + + + + + + + Miscellaneous + + + 9 + + + 9 + + + 9 + + + 9 + + + + + Dialogs will always be centered on the main window, but will remember their size. + + + Dialogs will always be centered on the main window, but will remember their size. + + + Always center dialogs + + + + + + + Show confirmation when changing instance + + + + + + + Whether double-clicking on a file opens the preview window or launches the program associated with it. This applies to the Data tab as well as the Conflicts and Filetree tabs in the mod info window. + + + Open previews on double-click + + + + - - + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 16777215 + 16777215 + + - Visual theme of the user interface. + Reset all choices made in dialogs. - Visual theme of the user interface. + Reset all choices made in dialogs. + + + Reset Dialog Choices - - + + + + Modify the categories available to arrange your mods. + + + Modify the categories available to arrange your mods. + - Explore... + Configure Mod Categories - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Language + + + + 9 + + + 9 + + + 9 + + + 9 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + The language of the user interface. @@ -106,13 +299,13 @@ - + - https://www.transifex.com/mod-organizer-2-team/mod-organizer-2/ + https://discord.gg/NRGqdt5suP - <a href="https://www.transifex.com/mod-organizer-2-team/mod-organizer-2/">Help translate Mod Organizer</a> + <a href="https://discord.gg/NRGqdt5suP">Help translate Mod Organizer on Discord</a> true @@ -122,506 +315,344 @@ - - - - Modify the categories available to arrange your mods. - - - Modify the categories available to arrange your mods. - - - Configure Mod Categories - - - - - - - Dialogs will always be centered on the main window, but will remember their size. - - - Dialogs will always be centered on the main window, but will remember their size. - - - Always center dialogs - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - Whether double-clicking on a file opens the preview window or launches the program associated with it. This applies to the Data tab as well as the Conflicts and Filetree tabs in the mod info window. - - - Open previews on double-click - - - - - + + + + + Theme + + + + - Updates + Style - + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + - + - Check for Mod Organizer updates on Github on startup. + Visual theme of the user interface. - Check for Mod Organizer updates on Github on startup. + Visual theme of the user interface. + + + + - Check for updates + Explore... - - - Update to non-stable releases. + + + Qt::Horizontal - - Update to non-stable releases. - - - Install Pre-releases (Betas) + + + 40 + 20 + - + - - - - - - - - User Interface - - - - - 0 - + - - - - 0 - 0 - - + - Mod List + Colors - + - - - Colors set on separators will also be shown in the mod list scrollbar at the location of the separator. This can be useful for quickly navigating to a specific separator. - - - Colors set on separators will also be shown in the mod list scrollbar at the location of the separator. This can be useful for quickly navigating to a specific separator. - - - Show mod list separator colors on the scrollbar + + + QAbstractItemView::NoEditTriggers - - true + + QAbstractItemView::SingleSelection - - - - - - Disable this to no longer display mods installed outside MO in the mod list (left pane). Assets from those mods will then be treated as having lowest mod priority together with the original game content. + + QAbstractItemView::SelectRows - - By default Mod Organizer will display esp+bsa bundles installed with foreign tools as mods (left pane). This allows you to control their priority in relation to other mods. This is particularly useful if you also use Steam Workshop to install mods. -However, if you installed loose file mods outside MO which conflict with BSAs also installed outside MO those conflicts can't be resolved correctly. - -If you disable this feature, MO will only display official DLCs this way. Please note that plugins (esps, esms, and esls) displayed in the right pane are completely unaffected by this feature. + + QAbstractItemView::ScrollPerPixel - - Display mods installed outside MO + + false - + + false + + + false + + true - + + + false + - - - Save the current filters when closing MO2 and restore them on startup. - - - Save the current filters when closing MO2 and restore them on startup. - - - Remember selected filters after restarting MO - + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Reset all colors to their default value. + + + Reset all colors to their default value. + + + Reset Colors + + + + - - + + + + + + + + + + + + + Mod List + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Colors set on separators will also be shown in the mod list scrollbar at the location of the separator. This can be useful for quickly navigating to a specific separator. + + + Colors set on separators will also be shown in the mod list scrollbar at the location of the separator. This can be useful for quickly navigating to a specific separator. + + + Show mod list separator colors on the scrollbar + + + true + + + + + + + Disable this to no longer display mods installed outside MO in the mod list (left pane). Assets from those mods will then be treated as having lowest mod priority together with the original game content. + + + By default Mod Organizer will display esp+bsa bundles installed with foreign tools as mods (left pane). This allows you to control their priority in relation to other mods. This is particularly useful if you also use Steam Workshop to install mods. +However, if you installed loose file mods outside MO which conflict with BSAs also installed outside MO those conflicts can't be resolved correctly. + +If you disable this feature, MO will only display official DLCs this way. Please note that plugins (esps, esms, and esls) displayed in the right pane are completely unaffected by this feature. + + + Display mods installed outside MO + + + true + + + + + + + Save the current filters when closing MO2 and restore them on startup. + + + Save the current filters when closing MO2 and restore them on startup. + + + Remember selected filters after restarting MO + + + + + + + Check if updates are available for mods after installing them. + + + Check if updates are available for mods after installing them. + + + Check for updates when installing mods + + + true + + + + + + + Automatically collapse separators, categories or nexus ids after a delay when hovering them during drag. + + + Automatically collapse separators, categories or nexus ids after a delay when hovering them during drag. + + + Automatically collapse items during drag on hover + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Collapsible Separators + + + false + + + false + + + false + + + + + + 9 + + + - Check if updates are available for mods after installing them. + Highlight collapsed separators based on conflicts and plugins from mods inside them. - Check if updates are available for mods after installing them. + Highlight collapsed separators based on conflicts and plugins from mods inside them. - Check for updates when installing mods + on separators true - - - - Automatically collapse separators, categories or nexus ids after a delay when hovering them during drag. - - - Automatically collapse separators, categories or nexus ids after a delay when hovering them during drag. - + + - Automatically collapse items during drag on hover + Enable when sorting by - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 0 - 5 - - - - - - - - Collapsible Separators - - - false - - - false - - - false + + + + Show conflicts and plugins - - - - - - 0 - 50 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 9 - - - - - When sorting by - - - - - - - Show icons on separators - - - - - - - flags - - - true - - - - - - - Show conflicts and plugins - - - - - - - conflicts - - - true - - - - - - - content - - - true - - - - - - - version - - - true - - - - - - - ascending priority - - - true - - - - - - - descending priority - - - - - - - Highlight collapsed separators based on conflicts and plugins from mods inside them. - - - Highlight collapsed separators based on conflicts and plugins from mods inside them. - - - on separators - - - true - - - - - - - When selecting a collapsed separator, highlight conflicting mods and plugins from mods inside the separator. - - - When selecting a collapsed separator, highlight conflicting mods and plugins from mods inside the separator. - - - from separators - - - true - - - - - - - Do not share the collapse/expanded state of separators between profiles. - - - Do not share the collapse/expanded state of separators between profiles. - - - Profile-specific collapse states for separators - - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 0 - 0 - - - - - - - - - - - Download List - - - - + + - Show meta information instead of file names in the download list. + When selecting a collapsed separator, highlight conflicting mods and plugins from mods inside the separator. - Show meta information instead of file names in the download list. + When selecting a collapsed separator, highlight conflicting mods and plugins from mods inside the separator. - Show Meta Information + from separators + + + true - - - - Make the download list more compact. - - - Make the download list more compact. - + + - Compact List + ascending priority + + + true - - - - Automatically hide downloads after successful installation. - - - Automatically hide downloads after successful installation. - + + - Hide downloads after installation + descending priority - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - - - - - - - - Colors - - - - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - QAbstractItemView::ScrollPerPixel - - - false + + + + Show icons on separators - - false - - - false - - - true - - - false - - - - + + + 0 @@ -635,25 +666,78 @@ If you disable this feature, MO will only display official DLCs this way. Please 0 - - - Reset all colors to their default value. + + + conflicts - - Reset all colors to their default value. + + true + + + + - Reset Colors + flags + + + true + + + + + + + content + + + true + + + + + + + version + + + true + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - + + + + + Do not share the collapse/expanded state of separators between profiles. + + + Do not share the collapse/expanded state of separators between profiles. + + + Profile-specific collapse states for separators + + + + + @@ -874,7 +958,7 @@ If you disable this feature, MO will only display official DLCs this way. Please - Important: All directories have to be writable! + All directories must be writable. @@ -884,7 +968,7 @@ If you disable this feature, MO will only display official DLCs this way. Please Nexus - + @@ -922,7 +1006,7 @@ If you disable this feature, MO will only display official DLCs this way. Please - id + id @@ -936,7 +1020,7 @@ If you disable this feature, MO will only display official DLCs this way. Please - name + name @@ -950,7 +1034,7 @@ If you disable this feature, MO will only display official DLCs this way. Please - account + account @@ -976,7 +1060,7 @@ If you disable this feature, MO will only display official DLCs this way. Please - daily requests + daily requests @@ -990,7 +1074,7 @@ If you disable this feature, MO will only display official DLCs this way. Please - hourly requests + hourly requests @@ -1097,282 +1181,176 @@ If you disable this feature, MO will only display official DLCs this way. Please - - + + + Options + + - 0 + 9 - 0 + 9 - 0 + 9 - 0 + 9 - - - - - - - - - Use a proxy for network connections. - - - Use a proxy for network connections. This uses the system-wide settings which can be configured in Internet Explorer. Please note that MO will start up a few seconds slower on some systems when using a proxy. - - - Use HTTP Proxy (Uses System Settings) - - - - - - - Tracked Integration - - - true - - - - - - - Endorsement Integration - - - true - - - - - - - Disable automatic internet features - - - Disable automatic internet features. This does not affect features that are explicitly invoked by the user (like checking mods for updates, endorsing, opening the web browser) - - - Offline Mode - - - - - - - <html><head/><body><p>By default, a counter is displayed in the bottom right corner. This informs the user of their remaining API requests. The Nexus API becomes unusable once these API requests run out. Checking this option will hide that counter.</p></body></html> - - - <html><head/><body><p>By default, a counter is displayed in the bottom right corner. This informs the user of their remaining API requests. The Nexus API becomes unusable once these API requests run out. Checking this option will hide that counter.</p></body></html> - - - Hide API Request Counter - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Use "%1" as a placeholder for the URL. - - - Use "%1" as a placeholder for the URL. - - - Use "%1" as a placeholder for the URL. - - - Custom browser - - - - - - - Use "%1" as a placeholder for the URL. - - - Use "%1" as a placeholder for the URL. - - - Use "%1" as a placeholder for the URL. - - - - - - - ... - - - - - - - - - - - - - - Associate with "Download with manager" links - - - - - - - Remove cache and cookies. - - - Clear Cache - - - - :/MO/gui/edit_clear:/MO/gui/edit_clear - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 4 - - - - - - - Known Servers (updated on download) - - - - - - - QAbstractItemView::DragDrop - - - Qt::MoveAction + + + + + 0 - - - - - - - - - - Preferred Servers (Drag & Drop) + + 0 - - - - - - QAbstractItemView::DragDrop + + 0 - - Qt::MoveAction + + 0 - - - - - - - - - - - Steam - - - - - - Username - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 232 - - - - - - - - - - - <html><head/><body><p>If you save your steam user ID and password here, they will be used when logging into steam.</p></body></html> - - - true - - - - - - - Password - + + + + Endorsement Integration + + + true + + + + + + + Tracked Integration + + + true + + + + + + + <html><head/><body><p>By default, a counter is displayed in the bottom right corner. This informs the user of their remaining API requests. The Nexus API becomes unusable once these API requests run out. Checking this option will hide that counter.</p></body></html> + + + <html><head/><body><p>By default, a counter is displayed in the bottom right corner. This informs the user of their remaining API requests. The Nexus API becomes unusable once these API requests run out. Checking this option will hide that counter.</p></body></html> + + + Hide API Request Counter + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Associate with "Download with manager" links + + + + + + + Remove cache and cookies. + + + Clear Cache + + + + + + + - - - - QLineEdit::Password + + + + Servers + + + 4 + + + 9 + + + 9 + + + 9 + + + 9 + + + + + + + Known Servers (updated on download) + + + + + + + QAbstractItemView::DragDrop + + + Qt::MoveAction + + + + + + + + + + + Preferred Servers (Drag & Drop) + + + + + + + QAbstractItemView::DragDrop + + + Qt::MoveAction + + + + + + @@ -1624,34 +1602,119 @@ If you disable this feature, MO will only display official DLCs this way. Please - - - - - Steam App ID - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - The Steam AppID for your game - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + Options + + + + 9 + + + 9 + + + 9 + + + 9 + + + + + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) + + + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) +Uncheck this if you want to use Mod Organizer with total conversions (like Nehrim) but be aware that the game will crash if required files are not enabled. + + + Force-enable game files + + + true + + + + + + + Enable parsing of Archives. This is an Experimental Feature. Has negative effects on performance and known incorrectness. + + + <html><head/><body><p>By default, MO will parse archive files (BSA, BA2) to calculate conflicts between the contents of the archive files and other loose files. This process has a noticeable cost in performance.</p><p>This feature should not be confused with the archive management feature offered by MO1. MO2 will only show conflicts with archives and will NOT load them into the game or program.</p><p>If you disable this feature, MO will only display conflicts between loose files.</p></body></html> + + + Enable archives parsing (experimental) + + + true + + + + + + + Disable this to prevent the GUI from being locked when running an executable. This may result in abnormal behavior. + + + Disable this to prevent the GUI from being locked when running an executable. This may result in abnormal behavior. + + + Lock GUI when running executable + + + true + + + + + + + + + + Steam + + + + + + + + + Password + + + + + + + QLineEdit::Password + + + + + + + Username + + + + + + + Steam App ID + + + + + + + The Steam AppID for your game + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> @@ -1663,180 +1726,188 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">3. right-click on the newly created shortcut on your desktop and select </span><span style=" font-size:8pt; font-weight:600;">Properties</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">4. in the URL-field you should see something like this: </span><span style=" font-size:8pt; font-style:italic;">steam://rungameid/22380</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">22380 is the id you're looking for.</span></p></body></html> - - - - - - - - - 7 - - - - - - 16777215 - 16777215 - - - - Load Mechanism - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Select loading mechanism. See help for details. - - - Mod Organizer needs a dll to be injected into the game so all mods are visible to it. -There are several means to do this: -*Mod Organizer* (default) In this mode the Mod Organizer itself injects the dll. The disadvantage is that you always have to start the game through MO or a link created by it. -*Script Extender* In this mode, MO is installed as a Script Extender (obse, fose, nvse, skse) plugin. -*Proxy DLL* In this mode, MO replaces one of the game's dlls with one that loads MO (and the original dll of course). This will ONLY work with Steam games and it has only been tested with Skyrim. Please use this only if the other mechanisms don't work. - -If you use the Steam version of Oblivion the default will NOT work. In this case, please install obse and use "Script Extender" as the load mechanism. Also you can then not start Oblivion from MO. Instead, use MO only to set up your mods, then quit and start Oblivion through Steam. - - - - - - - - - - - false - - - Enforces that inactive ESPs and ESMs are never loaded. - - - It seems that the Games occasionally load ESP or ESM files even if they haven't been activated as plugins. -I don't yet know what the circumstances are, but user reports imply it is in some cases unwanted. If this is checked, ESPs and ESMs not checked in the List are invisible to the game and can not be loaded. - - - Hide inactive ESPs/ESMs - - - - - - - If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) - - - If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) -Uncheck this if you want to use Mod Organizer with total conversions (like Nehrim) but be aware that the game will crash if required files are not enabled. - - - Force-enable game files - - - true - - - - - - - Disable this to prevent the GUI from being locked when running an executable. This may result in abnormal behavior. - - - Disable this to prevent the GUI from being locked when running an executable. This may result in abnormal behavior. - - - Lock GUI when running executable - - - true - - - - - - - Enable parsing of Archives. This is an Experimental Feature. Has negative effects on performance and known incorrectness. - - - <html><head/><body><p>By default, MO will parse archive files (BSA, BA2) to calculate conflicts between the contents of the archive files and other loose files. This process has a noticeable cost in performance.</p><p>This feature should not be confused with the archive management feature offered by MO1. MO2 will only show conflicts with archives and will NOT load them into the game or program.</p><p>If you disable this feature, MO will only display conflicts between loose files.</p></body></html> - - - Enable parsing of Archives (Experimental Feature) - - - true - - - - + + + + + - - - For Skyrim, this can be used instead of Archive Invalidation. It should make AI redundant for all Profiles. -For the other games this is not a sufficient replacement for AI! - - - For Skyrim, this can be used instead of Archive Invalidation. It should make AI redundant for all Profiles. -For the other games this is not a sufficient replacement for AI! - - - Back-date BSAs + + + + 0 + 100 + - - - :/MO/gui/resources/emblem-readonly.png:/MO/gui/resources/emblem-readonly.png + + Network + + + + + Disable automatic internet features + + + Disable automatic internet features. This does not affect features that are explicitly invoked by the user (like checking mods for updates, endorsing, opening the web browser) + + + Offline Mode + + + + + + + Use a proxy for network connections. + + + Use a proxy for network connections. This uses the system-wide settings which can be configured in Internet Explorer. Please note that MO will start up a few seconds slower on some systems when using a proxy. + + + Use System HTTP Proxy + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Use "%1" as a placeholder for the URL. + + + Use "%1" as a placeholder for the URL. + + + Use "%1" as a placeholder for the URL. + + + Custom browser + + + + + + + Use "%1" as a placeholder for the URL. + + + Use "%1" as a placeholder for the URL. + + + Use "%1" as a placeholder for the URL. + + + + + + + ... + + + + + + + - - - Add executables to the blacklist to prevent them from + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Resets the window geometries for all windows. This can be useful if a window becomes too small or too large, if a column becomes too thin or too wide, and in similar situations. + + + Resets the window geometries for all windows. This can be useful if a window becomes too small or too large, if a column becomes too thin or too wide, and in similar situations. + + + Reset Window Geometries + + + + + + + Add executables to the blacklist to prevent them from accessing the virtual file system. This is useful to prevent unintended programs from being hooked. Hooking unintended programs may affect the execution of these programs or the programs you are intentionally running. - - - Add executables to the blacklist to prevent them from accessing the virtual file system. This is useful to prevent unintended programs from being hooked. Hooking unintended programs may affect the execution of these programs or the programs you are intentionally running. - - - Configure Executables Blacklist - - - false - - - - - - - Resets the window geometries for all windows. This can be useful if a window becomes too small or too large, if a column becomes too thin or too wide, and in similar situations. - - - Resets the window geometries for all windows. This can be useful if a window becomes too small or too large, if a column becomes too thin or too wide, and in similar situations. - - - Reset Window Geometries - + + + Add executables to the blacklist to prevent them from accessing the virtual file system. This is useful to prevent unintended programs from being hooked. Hooking unintended programs may affect the execution of these programs or the programs you are intentionally running. + + + Executables Blacklist + + + false + + + + + + + For Skyrim, this can be used instead of Archive Invalidation. It should make AI redundant for all Profiles. +For the other games this is not a sufficient replacement for AI! + + + For Skyrim, this can be used instead of Archive Invalidation. It should make AI redundant for all Profiles. +For the other games this is not a sufficient replacement for AI! + + + Back-date BSAs + + + + :/MO/gui/resources/emblem-readonly.png:/MO/gui/resources/emblem-readonly.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -1868,24 +1939,108 @@ programs you are intentionally running. Diagnostics - - - - - Qt::Vertical - - - QSizePolicy::Expanding + + + 12 + + + + + Logs and Crashes - - - 20 - 232 - + + + QFormLayout::FieldsStayAtSizeHint + + + + + Log Level + + + + + + + Decides the amount of data printed to "ModOrganizer.log" + + + + Decides the amount of data printed to "ModOrganizer.log". + "Debug" produces very useful information for finding problems. There is usually no noteworthy performance impact but the file may become rather large. If this is a problem you may prefer the "Info" level for regular use. On the "Error" level the log file usually remains empty. + + + + + + + + Crash Dumps + + + + + + + Decides which type of crash dumps are collected when injected processes crash. + + + + Decides which type of crash dumps are collected when injected processes crash. + "None" Disables the generation of crash dumps by MO. + "Mini" Default level which generates small dumps (only stack traces). + "Data" Much larger dumps with additional information which may be need (also data segments). + "Full" Even larger dumps with a full memory dump of the process. + + + + + + + + Max Dumps To Keep + + + + + + + Maximum number of crash dumps to keep on disk. Use 0 for unlimited. + + + + Maximum number of crash dumps to keep on disk. Use 0 for unlimited. + Set "Crash Dumps" above to None to disable crash dump collection. + + + + + + + + + + + Integrated LOOT - + + + QFormLayout::FieldsStayAtSizeHint + + + + + LOOT Log Level + + + + + + + + - + Hint: right click link and copy link location @@ -1906,88 +2061,21 @@ programs you are intentionally running. - - - - QFormLayout::ExpandingFieldsGrow + + + + Qt::Vertical - - 12 + + QSizePolicy::Expanding - - - - Log Level - - - - - - - Decides the amount of data printed to "ModOrganizer.log" - - - - Decides the amount of data printed to "ModOrganizer.log". - "Debug" produces very useful information for finding problems. There is usually no noteworthy performance impact but the file may become rather large. If this is a problem you may prefer the "Info" level for regular use. On the "Error" level the log file usually remains empty. - - - - - - - - Crash Dumps - - - - - - - Decides which type of crash dumps are collected when injected processes crash. - - - - Decides which type of crash dumps are collected when injected processes crash. - "None" Disables the generation of crash dumps by MO. - "Mini" Default level which generates small dumps (only stack traces). - "Data" Much larger dumps with additional information which may be need (also data segments). - "Full" Even larger dumps with a full memory dump of the process. - - - - - - - - Max Dumps To Keep - - - - - - - Maximum number of crash dumps to keep on disk. Use 0 for unlimited. - - - - Maximum number of crash dumps to keep on disk. Use 0 for unlimited. - Set "Crash Dumps" above to None to disable crash dump collection. - - - - - - - - LOOT Log Level - - - - - - - + + + 20 + 232 + + + @@ -2018,9 +2106,7 @@ programs you are intentionally running. - tabWidget languageBox - styleBox usePrereleaseBox baseDirEdit browseBaseDirBtn @@ -2040,26 +2126,10 @@ programs you are intentionally running. nexusManualKey nexusDisconnect nexusLog - offlineBox - endorsementBox - trackedBox - proxyBox - hideAPICounterBox - associateButton - clearCacheButton knownServersList preferredServersList - steamUserEdit - steamPassEdit pluginSettingsList - appIDEdit - mechanismBox - hideUncheckedBox - forceEnableBox lockGUIBox - bsaDateBtn - execBlacklistBtn - resetGeometryBtn diff --git a/src/settingsdialogworkarounds.cpp b/src/settingsdialogworkarounds.cpp index c050c722..5a4b15ca 100644 --- a/src/settingsdialogworkarounds.cpp +++ b/src/settingsdialogworkarounds.cpp @@ -10,19 +10,6 @@ WorkaroundsSettingsTab::WorkaroundsSettingsTab(Settings& s, SettingsDialog& d) { ui->appIDEdit->setText(settings().steam().appID()); - LoadMechanism::EMechanism mechanismID = settings().game().loadMechanismType(); - int index = 0; - - if (settings().game().loadMechanism().isDirectLoadingSupported()) { - ui->mechanismBox->addItem(QObject::tr("Mod Organizer"), LoadMechanism::LOAD_MODORGANIZER); - if (mechanismID == LoadMechanism::LOAD_MODORGANIZER) { - index = ui->mechanismBox->count() - 1; - } - } - - ui->mechanismBox->setCurrentIndex(index); - - ui->hideUncheckedBox->setChecked(settings().game().hideUncheckedPlugins()); ui->forceEnableBox->setChecked(settings().game().forceEnableCoreFiles()); ui->lockGUIBox->setChecked(settings().interface().lockGUI()); ui->enableArchiveParsingBox->setChecked(settings().archiveParsing()); @@ -42,10 +29,6 @@ void WorkaroundsSettingsTab::update() settings().steam().setAppID(""); } - settings().game().setLoadMechanism(static_cast( - ui->mechanismBox->itemData(ui->mechanismBox->currentIndex()).toInt())); - - settings().game().setHideUncheckedPlugins(ui->hideUncheckedBox->isChecked()); settings().game().setForceEnableCoreFiles(ui->forceEnableBox->isChecked()); settings().interface().setLockGUI(ui->lockGUIBox->isChecked()); settings().setArchiveParsing(ui->enableArchiveParsingBox->isChecked()); -- cgit v1.3.1 From 7610e3139408a8947795140a14a6bd396d4e0f71 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Fri, 29 Jan 2021 20:03:47 +0100 Subject: Reorganize settingsdialog classes to match UI. --- src/CMakeLists.txt | 4 +- src/settingsdialog.cpp | 8 ++-- src/settingsdialoggeneral.cpp | 74 ++++++++---------------------- src/settingsdialoggeneral.h | 4 -- src/settingsdialogmodlist.cpp | 71 +++++++++++++++++++++++++++++ src/settingsdialogmodlist.h | 27 +++++++++++ src/settingsdialognexus.cpp | 8 ---- src/settingsdialogsteam.cpp | 17 ------- src/settingsdialogsteam.h | 14 ------ src/settingsdialogtheme.cpp | 82 +++++++++++++++++++++++++++++++++ src/settingsdialogtheme.h | 24 ++++++++++ src/settingsdialoguserinterface.cpp | 91 ------------------------------------- src/settingsdialoguserinterface.h | 27 ----------- src/settingsdialogworkarounds.cpp | 35 ++++++++++++-- 14 files changed, 259 insertions(+), 227 deletions(-) create mode 100644 src/settingsdialogmodlist.cpp create mode 100644 src/settingsdialogmodlist.h delete mode 100644 src/settingsdialogsteam.cpp delete mode 100644 src/settingsdialogsteam.h create mode 100644 src/settingsdialogtheme.cpp create mode 100644 src/settingsdialogtheme.h delete mode 100644 src/settingsdialoguserinterface.cpp delete mode 100644 src/settingsdialoguserinterface.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8c52721..393ee79a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -202,9 +202,9 @@ add_filter(NAME src/settingsdialog GROUPS settingsdialognexus settingsdialogpaths settingsdialogplugins - settingsdialogsteam settingsdialogworkarounds - settingsdialoguserinterface + settingsdialogmodlist + settingsdialogtheme disableproxyplugindialog ) diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index d6b7ceec..b14deafa 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -24,8 +24,8 @@ along with Mod Organizer. If not, see . #include "settingsdialognexus.h" #include "settingsdialogpaths.h" #include "settingsdialogplugins.h" -#include "settingsdialogsteam.h" -#include "settingsdialoguserinterface.h" +#include "settingsdialogmodlist.h" +#include "settingsdialogtheme.h" #include "settingsdialogworkarounds.h" using namespace MOBase; @@ -40,11 +40,11 @@ SettingsDialog::SettingsDialog(PluginContainer *pluginContainer, Settings& setti ui->setupUi(this); m_tabs.push_back(std::unique_ptr(new GeneralSettingsTab(settings, *this))); - m_tabs.push_back(std::unique_ptr(new UserInterfaceSettingsTab(settings, *this))); + m_tabs.push_back(std::unique_ptr(new ThemeSettingsTab(settings, *this))); + m_tabs.push_back(std::unique_ptr(new ModListSettingsTab(settings, *this))); m_tabs.push_back(std::unique_ptr(new PathsSettingsTab(settings, *this))); m_tabs.push_back(std::unique_ptr(new DiagnosticsSettingsTab(settings, *this))); m_tabs.push_back(std::unique_ptr(new NexusSettingsTab(settings, *this))); - m_tabs.push_back(std::unique_ptr(new SteamSettingsTab(settings, *this))); m_tabs.push_back(std::unique_ptr(new PluginsSettingsTab(settings, m_pluginContainer, *this))); m_tabs.push_back(std::unique_ptr(new WorkaroundsSettingsTab(settings, *this))); } diff --git a/src/settingsdialoggeneral.cpp b/src/settingsdialoggeneral.cpp index 11294d2a..30039575 100644 --- a/src/settingsdialoggeneral.cpp +++ b/src/settingsdialoggeneral.cpp @@ -11,19 +11,23 @@ using namespace MOBase; GeneralSettingsTab::GeneralSettingsTab(Settings& s, SettingsDialog& d) : SettingsTab(s, d) { + // language addLanguages(); selectLanguage(); - addStyles(); - selectStyle(); + // download list + ui->compactBox->setChecked(settings().interface().compactDownloads()); + ui->showMetaBox->setChecked(settings().interface().metaDownloads()); + ui->hideDownloadInstallBox->setChecked(settings().interface().hideDownloadsAfterInstallation()); - ui->centerDialogs->setChecked(settings().geometry().centerDialogs()); - ui->changeGameConfirmation->setChecked(settings().interface().showChangeGameConfirmation()); - ui->doubleClickPreviews->setChecked(settings().interface().doubleClicksOpenPreviews()); + // updates ui->checkForUpdates->setChecked(settings().checkForUpdates()); ui->usePrereleaseBox->setChecked(settings().usePrereleases()); - QObject::connect(ui->exploreStyles, &QPushButton::clicked, [&]{ onExploreStyles(); }); + // miscellaneous + ui->centerDialogs->setChecked(settings().geometry().centerDialogs()); + ui->changeGameConfirmation->setChecked(settings().interface().showChangeGameConfirmation()); + ui->doubleClickPreviews->setChecked(settings().interface().doubleClicksOpenPreviews()); QObject::connect( ui->categoriesBtn, &QPushButton::clicked, [&]{ onEditCategories(); }); @@ -34,6 +38,7 @@ GeneralSettingsTab::GeneralSettingsTab(Settings& s, SettingsDialog& d) void GeneralSettingsTab::update() { + // language const QString oldLanguage = settings().interface().language(); const QString newLanguage = ui->languageBox->itemData( ui->languageBox->currentIndex()).toString(); @@ -43,20 +48,19 @@ void GeneralSettingsTab::update() emit settings().languageChanged(newLanguage); } - const QString oldStyle = settings().interface().styleName().value_or(""); - const QString newStyle = ui->styleBox->itemData( - ui->styleBox->currentIndex()).toString(); + // download list + settings().interface().setCompactDownloads(ui->compactBox->isChecked()); + settings().interface().setMetaDownloads(ui->showMetaBox->isChecked()); + settings().interface().setHideDownloadsAfterInstallation(ui->hideDownloadInstallBox->isChecked()); - if (oldStyle != newStyle) { - settings().interface().setStyleName(newStyle); - emit settings().styleChanged(newStyle); - } + // updates + settings().setCheckForUpdates(ui->checkForUpdates->isChecked()); + settings().setUsePrereleases(ui->usePrereleaseBox->isChecked()); + // miscellaneous settings().geometry().setCenterDialogs(ui->centerDialogs->isChecked()); settings().interface().setShowChangeGameConfirmation(ui->changeGameConfirmation->isChecked()); settings().interface().setDoubleClicksOpenPreviews(ui->doubleClickPreviews->isChecked()); - settings().setCheckForUpdates(ui->checkForUpdates->isChecked()); - settings().setUsePrereleases(ui->usePrereleaseBox->isChecked()); } void GeneralSettingsTab::addLanguages() @@ -127,52 +131,12 @@ void GeneralSettingsTab::selectLanguage() } } -void GeneralSettingsTab::addStyles() -{ - ui->styleBox->addItem("None", ""); - for (auto&& key : QStyleFactory::keys()) { - ui->styleBox->addItem(key, key); - } - - ui->styleBox->insertSeparator(ui->styleBox->count()); - - QDirIterator iter( - QCoreApplication::applicationDirPath() + "/" + - QString::fromStdWString(AppConfig::stylesheetsPath()), - QStringList("*.qss"), - QDir::Files); - - while (iter.hasNext()) { - iter.next(); - - ui->styleBox->addItem( - iter.fileInfo().completeBaseName(), - iter.fileName()); - } -} - -void GeneralSettingsTab::selectStyle() -{ - const int currentID = ui->styleBox->findData( - settings().interface().styleName().value_or("")); - - if (currentID != -1) { - ui->styleBox->setCurrentIndex(currentID); - } -} - void GeneralSettingsTab::resetDialogs() { settings().widgets().resetQuestionButtons(); GlobalSettings::resetDialogs(); } -void GeneralSettingsTab::onExploreStyles() -{ - QString ssPath = QCoreApplication::applicationDirPath() + "/" + ToQString(AppConfig::stylesheetsPath()); - shell::Explore(ssPath); -} - void GeneralSettingsTab::onEditCategories() { CategoriesDialog dialog(&dialog()); diff --git a/src/settingsdialoggeneral.h b/src/settingsdialoggeneral.h index 51e0dc72..8d82564d 100644 --- a/src/settingsdialoggeneral.h +++ b/src/settingsdialoggeneral.h @@ -15,12 +15,8 @@ private: void addLanguages(); void selectLanguage(); - void addStyles(); - void selectStyle(); - void resetDialogs(); - void onExploreStyles(); void onEditCategories(); void onResetDialogs(); }; diff --git a/src/settingsdialogmodlist.cpp b/src/settingsdialogmodlist.cpp new file mode 100644 index 00000000..4c04e3f5 --- /dev/null +++ b/src/settingsdialogmodlist.cpp @@ -0,0 +1,71 @@ +#include "settingsdialogmodlist.h" +#include "ui_settingsdialog.h" +#include "shared/appconfig.h" +#include "categoriesdialog.h" +#include "colortable.h" +#include "modlist.h" +#include +#include + +using namespace MOBase; + +ModListSettingsTab::ModListSettingsTab(Settings& s, SettingsDialog& d) + : SettingsTab(s, d), + m_columnToBox{ + { ModList::COL_CONFLICTFLAGS, ui->collapsibleSeparatorsIconsConflictsBox }, + { ModList::COL_FLAGS, ui->collapsibleSeparatorsIconsFlagsBox }, + { ModList::COL_CONTENT, ui->collapsibleSeparatorsIconsContentsBox}, + { ModList::COL_VERSION, ui->collapsibleSeparatorsIconsVersionBox } + } +{ + // connect before setting to trigger + QObject::connect(ui->collapsibleSeparatorsAscBox, &QCheckBox::toggled, [=] { updateCollapsibleSeparatorsGroup(); }); + QObject::connect(ui->collapsibleSeparatorsDscBox, &QCheckBox::toggled, [=] { updateCollapsibleSeparatorsGroup(); }); + + ui->colorSeparatorsBox->setChecked(settings().colors().colorSeparatorScrollbar()); + ui->displayForeignBox->setChecked(settings().interface().displayForeign()); + ui->collapsibleSeparatorsAscBox->setChecked(settings().interface().collapsibleSeparators(Qt::AscendingOrder)); + ui->collapsibleSeparatorsDscBox->setChecked(settings().interface().collapsibleSeparators(Qt::DescendingOrder)); + ui->collapsibleSeparatorsHighlightFromBox->setChecked(settings().interface().collapsibleSeparatorsHighlightFrom()); + ui->collapsibleSeparatorsHighlightToBox->setChecked(settings().interface().collapsibleSeparatorsHighlightTo()); + ui->collapsibleSeparatorsPerProfileBox->setChecked(settings().interface().collapsibleSeparatorsPerProfile()); + ui->saveFiltersBox->setChecked(settings().interface().saveFilters()); + ui->autoCollapseDelayBox->setChecked(settings().interface().autoCollapseOnHover()); + ui->checkUpdateInstallBox->setChecked(settings().interface().checkUpdateAfterInstallation()); + + for (auto& p : m_columnToBox) { + p.second->setChecked(settings().interface().collapsibleSeparatorsIcons(p.first)); + } + +} + +void ModListSettingsTab::update() +{ + // mod list + settings().colors().setColorSeparatorScrollbar(ui->colorSeparatorsBox->isChecked()); + settings().interface().setDisplayForeign(ui->displayForeignBox->isChecked()); + settings().interface().setCollapsibleSeparators( + ui->collapsibleSeparatorsAscBox->isChecked(), ui->collapsibleSeparatorsDscBox->isChecked()); + settings().interface().setCollapsibleSeparatorsHighlightFrom(ui->collapsibleSeparatorsHighlightFromBox->isChecked()); + settings().interface().setCollapsibleSeparatorsHighlightTo(ui->collapsibleSeparatorsHighlightToBox->isChecked()); + settings().interface().setCollapsibleSeparatorsPerProfile(ui->collapsibleSeparatorsPerProfileBox->isChecked()); + settings().interface().setSaveFilters(ui->saveFiltersBox->isChecked()); + settings().interface().setAutoCollapseOnHover(ui->autoCollapseDelayBox->isChecked()); + settings().interface().setCheckUpdateAfterInstallation(ui->checkUpdateInstallBox->isChecked()); + + for (auto& p : m_columnToBox) { + settings().interface().setCollapsibleSeparatorsIcons(p.first, p.second->isChecked()); + } +} + +void ModListSettingsTab::updateCollapsibleSeparatorsGroup() +{ + const auto checked = ui->collapsibleSeparatorsAscBox->isChecked() || + ui->collapsibleSeparatorsDscBox->isChecked(); + for (auto* widget : ui->collapsibleSeparatorsWidget->findChildren()) { + widget->setEnabled(checked); + } + ui->collapsibleSeparatorsLabel->setEnabled(true); + ui->collapsibleSeparatorsAscBox->setEnabled(true); + ui->collapsibleSeparatorsDscBox->setEnabled(true); +} diff --git a/src/settingsdialogmodlist.h b/src/settingsdialogmodlist.h new file mode 100644 index 00000000..0c0510b5 --- /dev/null +++ b/src/settingsdialogmodlist.h @@ -0,0 +1,27 @@ +#ifndef SETTINGSDIALOGMODLIST_H +#define SETTINGSDIALOGMODLIST_H + +#include + +#include "settingsdialog.h" +#include "settings.h" + +class ModListSettingsTab : public SettingsTab +{ +public: + ModListSettingsTab(Settings& settings, SettingsDialog& dialog); + + void update() override; + +protected slots: + + // enable/disable the collapsible separators group depending on + // the checkbox states + void updateCollapsibleSeparatorsGroup(); + +private: + + const std::map m_columnToBox; +}; + +#endif // SETTINGSDIALOGGENERAL_H diff --git a/src/settingsdialognexus.cpp b/src/settingsdialognexus.cpp index 48827a0e..364c6aa7 100644 --- a/src/settingsdialognexus.cpp +++ b/src/settingsdialognexus.cpp @@ -295,13 +295,9 @@ void NexusConnectionUI::updateState() NexusSettingsTab::NexusSettingsTab(Settings& s, SettingsDialog& d) : SettingsTab(s, d) { - ui->offlineBox->setChecked(settings().network().offlineMode()); - ui->proxyBox->setChecked(settings().network().useProxy()); ui->endorsementBox->setChecked(settings().nexus().endorsementIntegration()); ui->trackedBox->setChecked(settings().nexus().trackedIntegration()); ui->hideAPICounterBox->setChecked(settings().interface().hideAPICounter()); - ui->useCustomBrowser->setChecked(settings().network().useCustomBrowser()); - ui->browserCommand->setText(settings().network().customBrowserCommand()); // display server preferences for (const auto& server : s.network().servers()) { @@ -358,13 +354,9 @@ NexusSettingsTab::NexusSettingsTab(Settings& s, SettingsDialog& d) void NexusSettingsTab::update() { - settings().network().setOfflineMode(ui->offlineBox->isChecked()); - settings().network().setUseProxy(ui->proxyBox->isChecked()); settings().nexus().setEndorsementIntegration(ui->endorsementBox->isChecked()); settings().nexus().setTrackedIntegration(ui->trackedBox->isChecked()); settings().interface().setHideAPICounter(ui->hideAPICounterBox->isChecked()); - settings().network().setUseCustomBrowser(ui->useCustomBrowser->isChecked()); - settings().network().setCustomBrowserCommand(ui->browserCommand->text()); auto servers = settings().network().servers(); diff --git a/src/settingsdialogsteam.cpp b/src/settingsdialogsteam.cpp deleted file mode 100644 index 3c4c5de6..00000000 --- a/src/settingsdialogsteam.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "settingsdialogsteam.h" -#include "ui_settingsdialog.h" - -SteamSettingsTab::SteamSettingsTab(Settings& s, SettingsDialog& d) - : SettingsTab(s, d) -{ - QString username, password; - settings().steam().login(username, password); - - ui->steamUserEdit->setText(username); - ui->steamPassEdit->setText(password); -} - -void SteamSettingsTab::update() -{ - settings().steam().setLogin(ui->steamUserEdit->text(), ui->steamPassEdit->text()); -} diff --git a/src/settingsdialogsteam.h b/src/settingsdialogsteam.h deleted file mode 100644 index 6a3d75f4..00000000 --- a/src/settingsdialogsteam.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef SETTINGSDIALOGSTEAM_H -#define SETTINGSDIALOGSTEAM_H - -#include "settings.h" -#include "settingsdialog.h" - -class SteamSettingsTab : public SettingsTab -{ -public: - SteamSettingsTab(Settings& settings, SettingsDialog& dialog); - void update(); -}; - -#endif // SETTINGSDIALOGSTEAM_H diff --git a/src/settingsdialogtheme.cpp b/src/settingsdialogtheme.cpp new file mode 100644 index 00000000..9b32773b --- /dev/null +++ b/src/settingsdialogtheme.cpp @@ -0,0 +1,82 @@ +#include "settingsdialogtheme.h" +#include "ui_settingsdialog.h" +#include "shared/appconfig.h" +#include "categoriesdialog.h" +#include "colortable.h" +#include "modlist.h" +#include +#include + +using namespace MOBase; + +ThemeSettingsTab::ThemeSettingsTab(Settings& s, SettingsDialog& d) + : SettingsTab(s, d) +{ + // style + addStyles(); + selectStyle(); + + // colors + ui->colorTable->load(s); + + QObject::connect(ui->resetColorsBtn, &QPushButton::clicked, [&] { ui->colorTable->resetColors(); }); + + QObject::connect(ui->exploreStyles, &QPushButton::clicked, [&] { onExploreStyles(); }); +} + +void ThemeSettingsTab::update() +{ + // style + const QString oldStyle = settings().interface().styleName().value_or(""); + const QString newStyle = ui->styleBox->itemData( + ui->styleBox->currentIndex()).toString(); + + if (oldStyle != newStyle) { + settings().interface().setStyleName(newStyle); + emit settings().styleChanged(newStyle); + } + + // colors + ui->colorTable->commitColors(); +} + +void ThemeSettingsTab::addStyles() +{ + ui->styleBox->addItem("None", ""); + for (auto&& key : QStyleFactory::keys()) { + ui->styleBox->addItem(key, key); + } + + ui->styleBox->insertSeparator(ui->styleBox->count()); + + QDirIterator iter( + QCoreApplication::applicationDirPath() + "/" + + QString::fromStdWString(AppConfig::stylesheetsPath()), + QStringList("*.qss"), + QDir::Files); + + while (iter.hasNext()) { + iter.next(); + + ui->styleBox->addItem( + iter.fileInfo().completeBaseName(), + iter.fileName()); + } +} + +void ThemeSettingsTab::selectStyle() +{ + const int currentID = ui->styleBox->findData( + settings().interface().styleName().value_or("")); + + if (currentID != -1) { + ui->styleBox->setCurrentIndex(currentID); + } +} + +void ThemeSettingsTab::onExploreStyles() +{ + QString ssPath = QCoreApplication::applicationDirPath() + "/" + ToQString(AppConfig::stylesheetsPath()); + shell::Explore(ssPath); +} + diff --git a/src/settingsdialogtheme.h b/src/settingsdialogtheme.h new file mode 100644 index 00000000..61334c0b --- /dev/null +++ b/src/settingsdialogtheme.h @@ -0,0 +1,24 @@ +#ifndef SETTINGSDIALOGTHEME_H +#define SETTINGSDIALOGTHEME_H + +#include + +#include "settingsdialog.h" +#include "settings.h" + +class ThemeSettingsTab : public SettingsTab +{ +public: + ThemeSettingsTab(Settings& settings, SettingsDialog& dialog); + + void update() override; + +private: + + void addStyles(); + void selectStyle(); + void onExploreStyles(); + +}; + +#endif // SETTINGSDIALOGGENERAL_H diff --git a/src/settingsdialoguserinterface.cpp b/src/settingsdialoguserinterface.cpp deleted file mode 100644 index 503e0feb..00000000 --- a/src/settingsdialoguserinterface.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#include "settingsdialoguserinterface.h" -#include "ui_settingsdialog.h" -#include "shared/appconfig.h" -#include "categoriesdialog.h" -#include "colortable.h" -#include "modlist.h" -#include -#include - -using namespace MOBase; - -UserInterfaceSettingsTab::UserInterfaceSettingsTab(Settings& s, SettingsDialog& d) - : SettingsTab(s, d), - m_columnToBox{ - { ModList::COL_CONFLICTFLAGS, ui->collapsibleSeparatorsIconsConflictsBox }, - { ModList::COL_FLAGS, ui->collapsibleSeparatorsIconsFlagsBox }, - { ModList::COL_CONTENT, ui->collapsibleSeparatorsIconsContentsBox}, - { ModList::COL_VERSION, ui->collapsibleSeparatorsIconsVersionBox } - } -{ - - // connect before setting to trigger - QObject::connect(ui->collapsibleSeparatorsAscBox, &QCheckBox::toggled, [=] { updateCollapsibleSeparatorsGroup(); }); - QObject::connect(ui->collapsibleSeparatorsDscBox, &QCheckBox::toggled, [=] { updateCollapsibleSeparatorsGroup(); }); - - // mod list - ui->displayForeignBox->setChecked(settings().interface().displayForeign()); - ui->colorSeparatorsBox->setChecked(settings().colors().colorSeparatorScrollbar()); - ui->collapsibleSeparatorsAscBox->setChecked(settings().interface().collapsibleSeparators(Qt::AscendingOrder)); - ui->collapsibleSeparatorsDscBox->setChecked(settings().interface().collapsibleSeparators(Qt::DescendingOrder)); - ui->collapsibleSeparatorsHighlightFromBox->setChecked(settings().interface().collapsibleSeparatorsHighlightFrom()); - ui->collapsibleSeparatorsHighlightToBox->setChecked(settings().interface().collapsibleSeparatorsHighlightTo()); - ui->collapsibleSeparatorsPerProfileBox->setChecked(settings().interface().collapsibleSeparatorsPerProfile()); - ui->saveFiltersBox->setChecked(settings().interface().saveFilters()); - ui->autoCollapseDelayBox->setChecked(settings().interface().autoCollapseOnHover()); - ui->checkUpdateInstallBox->setChecked(settings().interface().checkUpdateAfterInstallation()); - - for (auto& p : m_columnToBox) { - p.second->setChecked(settings().interface().collapsibleSeparatorsIcons(p.first)); - } - - // download list - ui->compactBox->setChecked(settings().interface().compactDownloads()); - ui->showMetaBox->setChecked(settings().interface().metaDownloads()); - ui->hideDownloadInstallBox->setChecked(settings().interface().hideDownloadsAfterInstallation()); - - // colors - ui->colorTable->load(s); - - QObject::connect(ui->resetColorsBtn, &QPushButton::clicked, [&] { ui->colorTable->resetColors(); }); - -} - -void UserInterfaceSettingsTab::update() -{ - // mod list - settings().colors().setColorSeparatorScrollbar(ui->colorSeparatorsBox->isChecked()); - settings().interface().setDisplayForeign(ui->displayForeignBox->isChecked()); - settings().interface().setCollapsibleSeparators( - ui->collapsibleSeparatorsAscBox->isChecked(), ui->collapsibleSeparatorsDscBox->isChecked()); - settings().interface().setCollapsibleSeparatorsHighlightFrom(ui->collapsibleSeparatorsHighlightFromBox->isChecked()); - settings().interface().setCollapsibleSeparatorsHighlightTo(ui->collapsibleSeparatorsHighlightToBox->isChecked()); - settings().interface().setCollapsibleSeparatorsPerProfile(ui->collapsibleSeparatorsPerProfileBox->isChecked()); - settings().interface().setSaveFilters(ui->saveFiltersBox->isChecked()); - settings().interface().setAutoCollapseOnHover(ui->autoCollapseDelayBox->isChecked()); - settings().interface().setCheckUpdateAfterInstallation(ui->checkUpdateInstallBox->isChecked()); - - for (auto& p : m_columnToBox) { - settings().interface().setCollapsibleSeparatorsIcons(p.first, p.second->isChecked()); - } - - // download list - settings().interface().setCompactDownloads(ui->compactBox->isChecked()); - settings().interface().setMetaDownloads(ui->showMetaBox->isChecked()); - settings().interface().setHideDownloadsAfterInstallation(ui->hideDownloadInstallBox->isChecked()); - - // colors - ui->colorTable->commitColors(); -} - -void UserInterfaceSettingsTab::updateCollapsibleSeparatorsGroup() -{ - const auto checked = ui->collapsibleSeparatorsAscBox->isChecked() || - ui->collapsibleSeparatorsDscBox->isChecked(); - for (auto* widget : ui->collapsibleSeparatorsWidget->findChildren()) { - widget->setEnabled(checked); - } - ui->collapsibleSeparatorsLabel->setEnabled(true); - ui->collapsibleSeparatorsAscBox->setEnabled(true); - ui->collapsibleSeparatorsDscBox->setEnabled(true); -} diff --git a/src/settingsdialoguserinterface.h b/src/settingsdialoguserinterface.h deleted file mode 100644 index 0c3c7fb7..00000000 --- a/src/settingsdialoguserinterface.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef SETTINGSDIALOGUSERINTERFACE_H -#define SETTINGSDIALOGUSERINTERFACE_H - -#include - -#include "settingsdialog.h" -#include "settings.h" - -class UserInterfaceSettingsTab : public SettingsTab -{ -public: - UserInterfaceSettingsTab(Settings& settings, SettingsDialog& dialog); - - void update() override; - -protected slots: - - // enable/disable the collapsible separators group depending on - // the checkbox states - void updateCollapsibleSeparatorsGroup(); - -private: - - const std::map m_columnToBox; -}; - -#endif // SETTINGSDIALOGGENERAL_H diff --git a/src/settingsdialogworkarounds.cpp b/src/settingsdialogworkarounds.cpp index 5a4b15ca..17b2259b 100644 --- a/src/settingsdialogworkarounds.cpp +++ b/src/settingsdialogworkarounds.cpp @@ -8,12 +8,26 @@ WorkaroundsSettingsTab::WorkaroundsSettingsTab(Settings& s, SettingsDialog& d) : SettingsTab(s, d) { - ui->appIDEdit->setText(settings().steam().appID()); - + // options ui->forceEnableBox->setChecked(settings().game().forceEnableCoreFiles()); ui->lockGUIBox->setChecked(settings().interface().lockGUI()); ui->enableArchiveParsingBox->setChecked(settings().archiveParsing()); + // steam + QString username, password; + settings().steam().login(username, password); + + ui->appIDEdit->setText(settings().steam().appID()); + ui->steamUserEdit->setText(username); + ui->steamPassEdit->setText(password); + + // network + ui->offlineBox->setChecked(settings().network().offlineMode()); + ui->proxyBox->setChecked(settings().network().useProxy()); + ui->useCustomBrowser->setChecked(settings().network().useCustomBrowser()); + ui->browserCommand->setText(settings().network().customBrowserCommand()); + + // buttons m_ExecutableBlacklist = settings().executablesBlacklist(); QObject::connect(ui->bsaDateBtn, &QPushButton::clicked, [&]{ on_bsaDateBtn_clicked(); }); @@ -23,15 +37,26 @@ WorkaroundsSettingsTab::WorkaroundsSettingsTab(Settings& s, SettingsDialog& d) void WorkaroundsSettingsTab::update() { + // options + settings().game().setForceEnableCoreFiles(ui->forceEnableBox->isChecked()); + settings().interface().setLockGUI(ui->lockGUIBox->isChecked()); + settings().setArchiveParsing(ui->enableArchiveParsingBox->isChecked()); + + // steam if (ui->appIDEdit->text() != settings().game().plugin()->steamAPPId()) { settings().steam().setAppID(ui->appIDEdit->text()); } else { settings().steam().setAppID(""); } + settings().steam().setLogin(ui->steamUserEdit->text(), ui->steamPassEdit->text()); - settings().game().setForceEnableCoreFiles(ui->forceEnableBox->isChecked()); - settings().interface().setLockGUI(ui->lockGUIBox->isChecked()); - settings().setArchiveParsing(ui->enableArchiveParsingBox->isChecked()); + // network + settings().network().setOfflineMode(ui->offlineBox->isChecked()); + settings().network().setUseProxy(ui->proxyBox->isChecked()); + settings().network().setUseCustomBrowser(ui->useCustomBrowser->isChecked()); + settings().network().setCustomBrowserCommand(ui->browserCommand->text()); + + // buttons settings().setExecutablesBlacklist(m_ExecutableBlacklist); } -- cgit v1.3.1 From 76989e2b8f6dc3cea2c2e90813feb86af2ecad14 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Fri, 29 Jan 2021 20:09:14 +0100 Subject: Remove LoadMechanism completely. --- src/CMakeLists.txt | 1 - src/loadmechanism.cpp | 64 --------------------------------------------------- src/loadmechanism.h | 61 ------------------------------------------------ src/organizercore.cpp | 1 - src/settings.h | 2 -- 5 files changed, 129 deletions(-) delete mode 100644 src/loadmechanism.cpp delete mode 100644 src/loadmechanism.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 393ee79a..9b00cc5c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,7 +29,6 @@ add_filter(NAME src/core GROUPS categories archivefiletree installationmanager - loadmechanism nexusinterface nxmaccessmanager organizercore diff --git a/src/loadmechanism.cpp b/src/loadmechanism.cpp deleted file mode 100644 index e05ec584..00000000 --- a/src/loadmechanism.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright (C) 2012 Sebastian Herbord. All rights reserved. - -This file is part of Mod Organizer. - -Mod Organizer is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Mod Organizer is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Mod Organizer. If not, see . -*/ - -#include "loadmechanism.h" -#include "utility.h" -#include "shared/util.h" -#include -#include -#include "shared/appconfig.h" -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace MOBase; -using namespace MOShared; - -LoadMechanism::LoadMechanism() - : m_SelectedMechanism(LOAD_MODORGANIZER) -{ -} - -bool LoadMechanism::isDirectLoadingSupported() const -{ - return true; -} - -void LoadMechanism::activate(EMechanism) -{ - // no-op -} - - -QString toString(LoadMechanism::EMechanism e) -{ - switch (e) - { - case LoadMechanism::LOAD_MODORGANIZER: - return "ModOrganizer"; - - default: - return QString("unknown (%1)").arg(static_cast(e)); - } -} diff --git a/src/loadmechanism.h b/src/loadmechanism.h deleted file mode 100644 index 151e804f..00000000 --- a/src/loadmechanism.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright (C) 2012 Sebastian Herbord. All rights reserved. - -This file is part of Mod Organizer. - -Mod Organizer is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Mod Organizer is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Mod Organizer. If not, see . -*/ - -#ifndef LOADMECHANISM_H -#define LOADMECHANISM_H - - -#include -#include - - -/** - * @brief manages the various load mechanisms supported by Mod Organizer - **/ -class LoadMechanism -{ -public: - enum EMechanism { - LOAD_MODORGANIZER = 0, - }; - - LoadMechanism(); - - /** - * activate the specified mechanism. This automatically disables any other mechanism active - * - * @param mechanism the mechanism to activate - **/ - void activate(EMechanism mechanism); - - /** - * @brief test whether the "Mod Organizer" load mechanism is supported for the current game - * - * @return true - **/ - bool isDirectLoadingSupported() const; - -private: - EMechanism m_SelectedMechanism; -}; - - -QString toString(LoadMechanism::EMechanism e); - -#endif // LOADMECHANISM_H diff --git a/src/organizercore.cpp b/src/organizercore.cpp index e5aa6ed5..3874560b 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -5,7 +5,6 @@ #include "imoinfo.h" #include "iplugingame.h" #include "iuserinterface.h" -#include "loadmechanism.h" #include "messagedialog.h" #include "modlistsortproxy.h" #include "modrepositoryfileinfo.h" diff --git a/src/settings.h b/src/settings.h index 602ba4dd..6ddee308 100644 --- a/src/settings.h +++ b/src/settings.h @@ -20,7 +20,6 @@ along with Mod Organizer. If not, see . #ifndef SETTINGS_H #define SETTINGS_H -#include "loadmechanism.h" #include "envdump.h" #include #include @@ -86,7 +85,6 @@ public: private: QSettings& m_Settings; const MOBase::IPluginGame* m_GamePlugin; - LoadMechanism m_LoadMechanism; }; -- cgit v1.3.1