From a3cb4001521fa4b29252ce6f9c652fb07b335bf4 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sat, 15 Sep 2018 14:12:24 +0200 Subject: Store and load major dialogs geometry information. --- src/settings.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/settings.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index db4ea565..6ef43ace 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -604,6 +604,12 @@ void Settings::query(PluginContainer *pluginContainer, QWidget *parent) tabs.push_back(std::unique_ptr(new PluginsTab(this, dialog))); tabs.push_back(std::unique_ptr(new WorkaroundsTab(this, dialog))); + + QString key = QString("geometry/%1").arg(dialog.objectName()); + if (m_Settings.contains(key)) { + dialog.restoreGeometry(m_Settings.value(key).toByteArray()); + } + if (dialog.exec() == QDialog::Accepted) { // remember settings before change QMap before; @@ -631,6 +637,8 @@ void Settings::query(PluginContainer *pluginContainer, QWidget *parent) } m_Settings.endGroup(); } + m_Settings.setValue(key, dialog.saveGeometry()); + } Settings::SettingsTab::SettingsTab(Settings *m_parent, SettingsDialog &m_dialog) -- cgit v1.3.1 From b1a3bdd6e8dba5df77f25b3813bcb73043b14bbc Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sun, 16 Sep 2018 23:44:09 -0500 Subject: Automatically set CDN as a preferred server This also removes the (free) and (premium) labels from the servers as they aren't useful anymore. Premium users get premium speeds on all servers. Added (automatic) tag to the CDN server to indicate it will automatically pick servers based on geography. --- src/mainwindow.cpp | 2 +- src/settings.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0a4ab912..04491c3e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4580,7 +4580,7 @@ void MainWindow::nxmDownloadURLs(QString, int, int, QVariant, QVariant resultDat info.name = serverInfo["Name"].toString(); info.premium = serverInfo["IsPremium"].toBool(); info.lastSeen = QDate::currentDate(); - info.preferred = 0; + info.preferred = !info.name.compare("CDN", Qt::CaseInsensitive); // other keys: ConnectedUsers, Country, URI servers.append(info); } diff --git a/src/settings.cpp b/src/settings.cpp index 6ef43ace..2dbca0eb 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -604,7 +604,7 @@ void Settings::query(PluginContainer *pluginContainer, QWidget *parent) tabs.push_back(std::unique_ptr(new PluginsTab(this, dialog))); tabs.push_back(std::unique_ptr(new WorkaroundsTab(this, dialog))); - + QString key = QString("geometry/%1").arg(dialog.objectName()); if (m_Settings.contains(key)) { dialog.restoreGeometry(m_Settings.value(key).toByteArray()); @@ -838,9 +838,10 @@ Settings::NexusTab::NexusTab(Settings *parent, SettingsDialog &dialog) m_Settings.beginGroup("Servers"); for (const QString &key : m_Settings.childKeys()) { QVariantMap val = m_Settings.value(key).toMap(); - QString type = val["premium"].toBool() ? "(premium)" : "(free)"; - - QString descriptor = key + " " + type; + QString descriptor = key; + if (!descriptor.compare("CDN", Qt::CaseInsensitive)) { + descriptor += QStringLiteral(" (automatic)"); + } if (val.contains("downloadSpeed") && val.contains("downloadCount") && (val["downloadCount"].toInt() > 0)) { int bps = static_cast(val["downloadSpeed"].toDouble() / val["downloadCount"].toInt()); descriptor += QString(" (%1 kbps)").arg(bps / 1024); -- cgit v1.3.1 From 73842ee245a09fe4ead0e1a2a5f778d89f0a8039 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Thu, 1 Nov 2018 16:20:53 +0100 Subject: Added ability to change color of conflict and plugin highlighting from the settings. --- src/modlist.cpp | 6 +- src/organizer_en.ts | 1417 ++++++++++++++++++++++++++---------------------- src/pluginlist.cpp | 2 +- src/settings.cpp | 86 ++- src/settings.h | 18 +- src/settingsdialog.cpp | 104 ++++ src/settingsdialog.h | 27 + src/settingsdialog.ui | 88 ++- 8 files changed, 1065 insertions(+), 683 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 7b57eeda..3f8fa0c0 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -385,12 +385,12 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const || (role == ViewMarkingScrollBar::DEFAULT_ROLE)) { auto flags = modInfo->getFlags(); if (modInfo->getHighlight() & ModInfo::HIGHLIGHT_PLUGIN) { - return QColor(0, 0, 255, 64); + return Settings::instance().modlistContainsPluginColor(); } else if (m_Overwrite.find(modIndex) != m_Overwrite.end()) { - return QColor(0, 255, 0, 64); + return Settings::instance().modlistOverwrittenLooseColor(); } else if (m_Overwritten.find(modIndex) != m_Overwritten.end()) { - return QColor(255, 0, 0, 64); + return Settings::instance().modlistOverwritingLooseColor(); } else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_SEPARATOR) != flags.end() && modInfo->getColor().isValid()) { return modInfo->getColor(); } else { diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 9a7e0713..3d2f1744 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -1386,58 +1386,58 @@ p, li { white-space: pre-wrap; } - + File format "%1" not supported - + None of the available installer plugins were able to handle that archive. This is likely due to a corrupted or incompatible download or unrecognized archive format. - + no error - + 7z.dll not found - + 7z.dll isn't valid - + archive not found - + failed to open archive - + unsupported archive type - + internal library error - + archive invalid - + unknown archive error @@ -1534,47 +1534,47 @@ This is likely due to a corrupted or incompatible download or unrecognized archi MainWindow - + Categories - + Clear - + If checked, only mods that match all selected categories are displayed. - + And - + If checked, all mods that match at least one of the selected categories are displayed. - + Or - + Profile - + Pick a module collection - + <!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; } @@ -1584,77 +1584,77 @@ p, li { white-space: pre-wrap; } - + Open list options... - + Refresh list. This is usually not necessary unless you modified data outside the program. - + Show Open Folders menu... - - + + Restore Backup... - - - + + + Create Backup - + List of available mods. - + This is a list of installed mods. Use the checkboxes to activate/deactivate mods and drag & drop mods to change their "installation" orders. - + Filter - + Clear all Filters - + No groups - + Nexus IDs - - - + + + Namefilter - + Pick a program to run. - + <!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; } @@ -1664,12 +1664,12 @@ p, li { white-space: pre-wrap; } - + Run program - + <!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; } @@ -1678,17 +1678,17 @@ p, li { white-space: pre-wrap; } - + Run - + Create a shortcut in your start menu or on the desktop to the specified program - + <!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; } @@ -1697,27 +1697,27 @@ p, li { white-space: pre-wrap; } - + Shortcut - + Plugins - + Sort - + List of available esp/esm files - + <!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; } @@ -1726,27 +1726,27 @@ p, li { white-space: pre-wrap; } - + Archives - + <html><head/><body><p>BSAs / BA2s are bundles of game assets (textures, scripts, etc.). By default, the engine loads these bundles in a separate step from loose files. <p>Their load order is specified by the priority of the corresponding plugin (right pane, plugins tab).</p><p>If there is a matching plugin, the game will load them no matter what.</p></body></html> - + <html><head/><body><p>Currently detected archives. (<a href="#"><span style=" text-decoration: underline; color:#0000ff;">What is an archive?</span></a>)</p></body></html> - + List of available BS Archives. Archives not checked here are not managed by MO and ignore installation order. - + BSA files are archives (comparable to .zip files) that contain data assets (meshes, textures, ...) to be used by the game. As such they "compete" with loose files in your data directory over which is loaded. By default, BSAs that share their base name with an enabled ESP (i.e. plugin.esp and plugin.bsa) are automatically loaded and will have precedence over all loose files, the installation order you set up to the left is then ignored! @@ -1754,61 +1754,61 @@ p, li { white-space: pre-wrap; } - + Data - + refresh data-directory overview - + Refresh the overview. This may take a moment. - - - - + + + + Refresh - + This is an overview of your data directory as visible to the game (and tools). - + File - + Mod - - + + Filter the above list so that only conflicts are displayed. - + Show only conflicts - + Saves - + <!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; } @@ -1819,160 +1819,160 @@ p, li { white-space: pre-wrap; } - + Downloads - + Refresh downloads view - + This is a list of mods you downloaded from Nexus. Double click one to install it. You can also drag an archive into here. - + Show Hidden - + Tool Bar - + Install Mod - + Install &Mod - + Install a new mod from an archive - + Ctrl+M - + Profiles - + &Profiles - + Configure Profiles - + Ctrl+P - + Executables - + &Executables - + Configure the executables that can be started through Mod Organizer - + Ctrl+E - - + + Tools - + &Tools - + Ctrl+I - + Settings - + &Settings - + Configure settings and workarounds - + Ctrl+S - + Nexus - + Search nexus network for more mods - + Ctrl+N - - + + Update - + Mod Organizer is up-to-date - - + + No Problems - + This button will be highlighted if MO discovered potential problems in your setup and provide tips on how to fix them. !Work in progress! @@ -1980,758 +1980,813 @@ Right now this has very limited functionality - - + + Help - + Ctrl+H - + Endorse MO - - + + Endorse Mod Organizer - + Copy Log to Clipboard - + Change Game - + Open the Instance selection dialog to manage a different Game - + Toolbar - + Desktop - + Start Menu - + There is no supported sort mechanism for this game. You will probably have to use a third-party tool. - + Problems - + There are potential problems with your setup - + Everything seems to be in order - + Help on UI - + Documentation Wiki - + Report Issue - + Tutorials - + About - + About Qt - + Name - + Please enter a name for the new profile - + failed to create profile: %1 - + Show tutorial? - + You are starting Mod Organizer for the first time. Do you want to show a tutorial of its basic features? If you choose no you can always start the tutorial from the "Help"-menu. - + Downloads in progress - + There are still downloads in progress, do you really want to quit? - + Plugin "%1" failed: %2 - + Plugin "%1" failed - + Browse Mod Page - + Also in: <br> - + No conflict - + <Edit...> - + This bsa is enabled in the ini file so it may be required! - + Activating Network Proxy - + Notice: Your current MO version (%1) is lower than the previous version (%2).<br>The GUI may not downgrade gracefully, so you may experience oddities.<br>However, there should be no serious issues. - + Choose Mod - + Mod Archive - + Start Tutorial? - + You're about to start a tutorial. For technical reasons it's not possible to end the tutorial early. Continue? - + failed to spawn notepad.exe: %1 - + failed to change origin name: %1 - + failed to move "%1" from mod "%2" to "%3": %4 - + <Contains %1> - + <Checked> - + <Unchecked> - + <Update> - + <Mod Backup> - + <Managed by MO> - + <Managed outside MO> - + <No category> - + <Conflicted> - + <Not Endorsed> - + failed to rename mod: %1 - + Overwrite? - + This will replace the existing mod "%1". Continue? - + failed to remove mod "%1" - - - + + + failed to rename "%1" to "%2" - - - - + + + + Confirm - + Remove the following mods?<br><ul>%1</ul> - + failed to remove mod: %1 - - - + + + Failed - + Installation file no longer exists - + Mods installed with old versions of MO can't be reinstalled in this way. - + Failed to create backup. - + You need to be logged in with Nexus to resume a download - - + + You need to be logged in with Nexus to endorse - + Failed to display overwrite dialog: %1 - + Nexus ID for this Mod is unknown - + Web page for this mod is unknown - - - + + + Create Mod... - + This will create an empty mod. Please enter a name: - - + + A mod with this name already exists - + + Create Separator... + + + + + This will create a new separator. +Please enter a name: + + + + + A separator with this name already exists + + + + This will move all files from overwrite into a new, regular mod. Please enter a name: - - + + Are you sure? - + About to recursively delete: - + Not logged in, endorsement information will be wrong - + Continue? - + The versioning scheme decides which version is considered newer than another. This function will guess the versioning scheme under the assumption that the installed version is outdated. - - + + Sorry - + I don't know a versioning scheme where %1 is newer than %2. - + Really enable all visible mods? - + Really disable all visible mods? - + Export to csv - + CSV (Comma Separated Values) is a format that can be imported in programs like Excel to create a spreadsheet. You can also use online editors and converters instead. - + Select what mods you want export: - + All installed mods - + Only active (checked) mods from your current profile - + All currently visible mods in the mod list - + Choose what Columns to export: - + Mod_Priority - + Mod_Name - + Mod_Status - + Primary_Category - + Nexus_ID - + Mod_Nexus_URL - + Mod_Version - + Install_Date - + Download_File_Name - + export failed: %1 - + Open Game folder - + Open MyGames folder - + Open Instance folder - + Open Mods folder - + Open Profile folder - + Open Downloads folder - + Open MO2 Install folder - + Open MO2 Plugins folder - + Open MO2 Logs folder - + Install Mod... - + Create empty mod - + + Create Separator + + + + Enable all visible - + Disable all visible - + Check all for update - + Export to csv... - + All Mods - + Sync to Mods... - + Clear Overwrite... - - + + Open in Explorer - + Restore Backup - + Remove Backup... - + + Rename Separator... + + + + + Remove Separator... + + + + + + + Send to Top + + + + + + + Send to Bottom + + + + + Select Color... + + + + + Reset Color + + + + Change Categories - + Primary Category - + Change versioning scheme - + Un-ignore update - + Ignore update - - + + Enable selected - - + + Disable selected - + Rename Mod... - + Reinstall Mod - + Remove Mod... - + Un-Endorse - - + + Endorse - + Won't endorse - + Endorsement state unknown - + Ignore missing data - + Mark as converted/working - + Visit on Nexus - + Visit web page - + Information... - - + + Exception: - - + + Unknown exception - + <All> - + <Multiple> - + %1 more - + Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin. @@ -2739,12 +2794,12 @@ You can also use online editors and converters instead. - + Enable Mods... - + Delete %n save(s) @@ -2752,319 +2807,329 @@ You can also use online editors and converters instead. - + failed to remove %1 - + failed to create %1 - + Can't change download directory while downloads are in progress! - + failed to write to file %1 - + %1 written - + Select binary - + Binary - + Enter Name - + Please enter a name for the executable - + Not an executable - + This is not a recognized executable. - - + + Replace file? - + There already is a hidden version of this file. Replace it? - - + + File operation failed - - + + Failed to remove "%1". Maybe you lack the required file permissions? - + There already is a visible version of this file. Replace it? - + file not found: %1 - + failed to generate preview for %1 - + Sorry, can't preview anything. This function currently does not support extracting from bsas. - + Update available - + Open/Execute - + Add as Executable - + Preview - + Un-Hide - + Hide - + Write To File... - + Do you want to endorse Mod Organizer on %1 now? - + Thank you! - + Thank you for your endorsement! - + Request to Nexus failed: %1 - - + + failed to read %1: %2 - - + + Error - + failed to extract %1 (errorcode %2) - + Extract BSA - + This archive contains invalid hashes. Some files may be broken. - + Extract... - + This will restart MO, continue? - + Edit Categories... - + Deselect filter - + Remove - + Enable all - + Disable all - + + Send to top + + + + + Send to bottom + + + + Unlock load order - + Lock load order - + depends on missing "%1" - + incompatible with "%1" - + Please wait while LOOT is running - + loot failed. Exit code was: %1 - + failed to start loot - + failed to run loot: %1 - + Errors occured - + Backup of load order created - + Choose backup to restore - + No Backups - + There are no backups to restore - - + + Restore failed - - + + Failed to restore the backup. Errorcode: %1 - + Backup of modlist created - + A file with the same name has already been downloaded. What would you like to do? - + Overwrite - + Rename new file - + Ignore file @@ -3081,82 +3146,82 @@ You can also use online editors and converters instead. ModInfo - + Plugins - + Textures - + Meshes - + Bethesda Archive - + UI Changes - + Sound Effects - + Scripts - + Script Extender - + Script Extender Files - + SkyProc Tools - + MCM Data - + INI files - + ModGroup files - + invalid content type %1 - + invalid mod index %1 - + remove: invalid mod index %1 @@ -3481,273 +3546,273 @@ p, li { white-space: pre-wrap; } - + &Delete - + &Rename - + &Hide - + &Unhide - + &Open - + &New Folder - + Save changes? - + Save changes to "%1"? - + File Exists - + A file with that name exists, please enter a new one - + failed to move file - + failed to create directory "optional" - - + + Info requested, please wait - + Main - + Update - + Optional - + Old - + Misc - + Unknown - + Current Version: %1 - + No update available - + (description incomplete, please visit nexus) - + <a href="%1">Visit on Nexus</a> - + Failed to delete %1 - - - - + + + + Confirm - - + + Are sure you want to delete "%1"? - - + + Are sure you want to delete the selected files? - - + + New Folder - + Failed to create "%1" - - + + Replace file? - + There already is a hidden version of this file. Replace it? - - + + File operation failed - - + + Failed to remove "%1". Maybe you lack the required file permissions? - - + + failed to rename %1 to %2 - + There already is a visible version of this file. Replace it? - + Select binary - + Binary - + file not found: %1 - + failed to generate preview for %1 - + Sorry - + Sorry, can't preview anything. This function currently does not support extracting from bsas. - + Un-Hide - + Hide - - + + Open/Execute - - + + Preview - + Name - + Please enter a name - - + + Error - + Invalid name. Must be a valid file name - + A tweak by that name exists - + Create Tweak @@ -3786,272 +3851,285 @@ p, li { white-space: pre-wrap; } ModInfoRegular - - + + failed to write %1/meta.ini: error %2 - + %1 contains no esp/esm/esl and no asset (textures, meshes, interface, ...) directory - + Categories: <br> + + ModInfoSeparator + + + This is a Separator + + + ModList - + Game Plugins (ESP/ESM/ESL) - + Interface - + Meshes - + Bethesda Archive - + Scripts (Papyrus) - + Script Extender Plugin - + SkyProc Patcher - + Sound or Music - + Textures - + MCM Configuration - + INI files - + ModGroup files - + This entry contains files that have been created inside the virtual data tree (i.e. by the construction kit) - + Backup - + + Separator + + + + No valid game data - + Not endorsed yet - + Overwrites files - + Overwritten files - + Overwrites & Overwritten - + Redundant - + Alternate game source - + Non-MO - + invalid - + installed version: "%1", newest version: "%2" - + The newest version on Nexus seems to be older than the one you have installed. This could either mean the version you have has been withdrawn (i.e. due to a bug) or the author uses a non-standard versioning scheme and that newest version is actually newer. Either way you may want to "upgrade". - + Categories: <br> - + Invalid name - + Name is already in use by another mod - + drag&drop failed: %1 - + Confirm - + Are you sure you want to remove "%1"? - + Flags - + Content - + Mod Name - + Version - + Priority - + Category - + Source Game - + Nexus ID - + Installation - - + + unknown - + Name of your mods - + Version of the mod (if available) - + Installation priority of your mod. The higher, the more "important" it is and thus overwrites files from mods with lower priority. - + Category of the mod. - + The source game which was the origin of this mod. - + Id of the mod as used on Nexus. - + Emblemes to highlight things that might require attention. - + Depicts the content of the mod:<br><table cellspacing=7><tr><td><img src=":/MO/gui/content/plugin" width=32/></td><td>Game plugins (esp/esm/esl)</td></tr><tr><td><img src=":/MO/gui/content/interface" width=32/></td><td>Interface</td></tr><tr><td><img src=":/MO/gui/content/mesh" width=32/></td><td>Meshes</td></tr><tr><td><img src=":/MO/gui/content/bsa" width=32/></td><td>BSA</td></tr><tr><td><img src=":/MO/gui/content/texture" width=32/></td><td>Textures</td></tr><tr><td><img src=":/MO/gui/content/sound" width=32/></td><td>Sounds</td></tr><tr><td><img src=":/MO/gui/content/music" width=32/></td><td>Music</td></tr><tr><td><img src=":/MO/gui/content/string" width=32/></td><td>Strings</td></tr><tr><td><img src=":/MO/gui/content/script" width=32/></td><td>Scripts (Papyrus)</td></tr><tr><td><img src=":/MO/gui/content/skse" width=32/></td><td>Script Extender plugins</td></tr><tr><td><img src=":/MO/gui/content/skyproc" width=32/></td><td>SkyProc Patcher</td></tr><tr><td><img src=":/MO/gui/content/menu" width=32/></td><td>Mod Configuration Menu</td></tr><tr><td><img src=":/MO/gui/content/inifile" width=32/></td><td>INI files</td></tr><tr><td><img src=":/MO/gui/content/modgroup" width=32/></td><td>ModGroup files</td></tr></table> - + Time this mod was installed @@ -4225,123 +4303,123 @@ p, li { white-space: pre-wrap; } - + Executable "%1" not found - + Start Steam? - + Steam is required to be running already to correctly start the game. Should MO try to start steam now? - + Error - + Windows Event Log Error - + The Windows Event Log service is disabled and/or not running. This prevents USVFS from running properly. Your mods may not be working in the executable that you are launching. Note that you may have to restart MO and/or your PC after the service is fixed. Continue launching %1? - + No profile set - + Failed to refresh list of esps: %1 - + Multiple esps/esls activated, please check that they don't conflict. - + Download? - + A download has been started but no installed page plugin recognizes it. If you download anyway no information (i.e. version) will be associated with the download. Continue? - + failed to update mod list: %1 - - + + login successful - + Login failed - + Login failed, try again? - + login failed: %1. Download will not be associated with an account - + login failed: %1 - + login failed: %1. You need to log-in with Nexus to update MO. - + MO1 "Script Extender" load mechanism has left hook.dll in your game folder - - + + Description missing - + <a href="%1">hook.dll</a> has been found in your game folder (right click to copy the full path). This is most likely a leftover of setting the ModOrganizer 1 load mechanism to "Script Extender", in which case you must remove this file either by changing the load mechanism in ModOrganizer 1 or manually removing the file, otherwise the game is likely to crash and burn. - + failed to save load order: %1 - + The designated write target "%1" is not enabled. @@ -4514,68 +4592,68 @@ Continue? - + The file containing locked plugin indices is broken - - + + <b>Origin</b>: %1 - + <br><b><i>This plugin can't be disabled (enforced by the game).</i></b> - + Author - + Description - + Missing Masters - + Enabled Masters - + Loads Archives - + There are Archives connected to this plugin. Their assets will be added to your game, overwriting in case of conflicts following the plugin order. Loose files will always overwrite assets from Archives. (This flag only checks for Archives from the same mod as the plugin) - + Loads INI settings - + There is an ini file connected to this plugin. Its settings will be added to your game settings, overwriting in case of conflicts. - + This ESP is flagged as an ESL. It will adhere to the ESP load order but the records will be loaded in ESL space. - + failed to restore load order for %1 @@ -4647,56 +4725,56 @@ p, li { white-space: pre-wrap; } - + failed to write mod list: %1 - + failed to update tweaked ini file, wrong settings may be used: %1 - + failed to create tweaked ini: %1 - + failed to open %1 - + "%1" is missing or inaccessible - - - - - + + + + + invalid index %1 - + Overwrite directory couldn't be parsed - + invalid priority %1 - + Delete savegames? - + Do you want to delete local savegames? (If you select "No", the save games will show up again if you re-enable local savegames) @@ -5302,7 +5380,7 @@ If the folder was still in use, restart MO and try again. - + Mod Organizer @@ -5317,18 +5395,18 @@ If the folder was still in use, restart MO and try again. - + Please use "Help" from the toolbar to get usage instructions to all elements - - + + <Manage...> - + failed to parse profile %1: %2 @@ -5364,12 +5442,12 @@ If the folder was still in use, restart MO and try again. - + failed to access %1 - + failed to set file time %1 @@ -5379,12 +5457,12 @@ If the folder was still in use, restart MO and try again. - + Script Extender - + Proxy DLL @@ -5588,28 +5666,28 @@ Select Show Details option to see the full change-log. Settings - + Failed - + Sorry, failed to start the helper application - - + + attempt to store setting for unknown plugin "%1" - + Error - + Failed to create "%1", you may not have the necessary permission. path remains unchanged. @@ -5686,136 +5764,167 @@ If you use pre-releases, never contact me directly by e-mail or via private mess + Colors + + + + + Plugin is Contained in selected Mod + + + + + Reset Colors + + + + If checked, the download interface will be more compact. - + Compact Download Interface - + If checked, the download list will display meta information instead of file names. - + Download Meta Information - + Reset stored information from dialogs. - + + Mod Contains selected Plugin + Is contained in selected Mod + + + + This will make all dialogs show up again where you checked the "Remember selection"-box. - + Reset Dialogs - - + + Modify the categories available to arrange your mods. - + Configure Mod Categories - + + Is overwriting (loose files) + + + + + Is overwritten (loose files) + + + + Paths - - - + + + ... - + Caches - + Overwrite - - + + Directory where downloads are stored. - + Downloads - + Profiles - + Directory where mods are stored. - + Directory where mods are stored. Please note that changing this will break all associations of profiles with mods that don't exist in the new location (with the same name). - + Mods - + Managed Game - + Base Directory - + Use %BASE_DIR% to refer to the Base Directory. - + Important: All directories have to be writeable! - - + + Nexus - + Allows automatic log-in when the Nexus-Page for the game is clicked. - + <!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; } @@ -5824,144 +5933,144 @@ p, li { white-space: pre-wrap; } - + If checked and if correct credentials are entered below, log-in to Nexus (for browsing and downloading) is automatic. - + Automatically Log-In to Nexus - - + + Username - - + + Password - + Remove cache and cookies. Forces a new login. - + Clear Cache - + 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 HTTP Proxy (Uses System Settings) - + Associate with "Download with manager" links - + Known Servers (updated on download) - + Preferred Servers (Drag & Drop) - + Steam - + If you save your steam user ID and password here, they will be used when logging into steam. Note, however, your password will be stored unencrypted, so make sure your computer is secure. - + Plugins - + Author: - + Version: - + Description: - + Key - + Value - + Blacklisted Plugins (use <del> to remove): - + Workarounds - + 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; } @@ -5977,17 +6086,17 @@ p, li { white-space: pre-wrap; } - + Load Mechanism - + 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. @@ -5998,17 +6107,17 @@ If you use the Steam version of Oblivion the default will NOT work. In this case - + NMM Version - + The Version of Nexus Mod Manager to impersonate. - + Mod Organizer uses an API provided by the Nexus to provide features like checking for updates and downloading files. Unfortunately this API has not been made available officially to third party tools like MO so we have to impersonate the Nexus Mod Manager to be allowed in. On top of this Nexus has used the client identification to lock out outdated versions of NMM to force users to update. This means that MO also needs to impersonate the new version of NMM even if MO doesn't need an update. Therefore you can configure the version to identify as here. Please note that MO does identify itself as MO to the webserver, it's not lying about what it is. It is merely adding a "compatible" NMM version to the user agent. @@ -6017,44 +6126,44 @@ tl;dr-version: If Nexus-features don't work, insert the current version num - + 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 - + 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. @@ -6062,44 +6171,44 @@ If you disable this feature, MO will only display official DLCs this way. Please - + Display mods installed outside MO - - + + 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 - + These are workarounds for problems with Mod Organizer. Please make sure you read the help text before changing anything here. - + Diagnostics - + 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 regluar use. On the "Error" level the log file usually remains empty. @@ -6107,37 +6216,37 @@ For the other games this is not a sufficient replacement for AI! - + Debug - + Info (recommended) - + Warning - + Error - + 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. @@ -6148,37 +6257,37 @@ For the other games this is not a sufficient replacement for AI! - + None - + Mini (recommended) - + Data - + Full - + 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. @@ -6186,12 +6295,12 @@ For the other games this is not a sufficient replacement for AI! - + Hint: right click link and copy link location - + Logs and crash dumps are stored under your current instance in the <a href="LOGS_FULL_PATH">LOGS_DIR</a> and <a href="DUMPS_FULL_PATH">DUMPS_DIR</a> folders. @@ -6201,52 +6310,52 @@ For the other games this is not a sufficient replacement for AI! - + Confirm - + Changing the mod directory affects all your profiles! Mods not present (or named differently) in the new location will be disabled in all profiles. There is no way to undo this unless you backed up your profiles manually. Proceed? - + Select base directory - + Select download directory - + Select mod directory - + Select cache directory - + Select profiles directory - + Select overwrite directory - + Confirm? - + This will make all dialogs show up again where you checked the "Remember selection"-box. Continue? diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 8f714afd..d56a4bde 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -936,7 +936,7 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const } else if (role == Qt::BackgroundRole || (role == ViewMarkingScrollBar::DEFAULT_ROLE)) { if (m_ESPs[index].m_ModSelected) { - return QColor(0, 0, 255, 64); + return Settings::instance().pluginListContainedColor(); } else { return QVariant(); } diff --git a/src/settings.cpp b/src/settings.cpp index 2dbca0eb..0ecbaa23 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -50,6 +50,8 @@ along with Mod Organizer. If not, see . #include #include #include +#include +#include #include // for Qt::UserRole, etc #include // for qDebug, qWarning @@ -62,6 +64,7 @@ along with Mod Organizer. If not, see . #include #include // for pair, make_pair + using namespace MOBase; template @@ -189,6 +192,14 @@ QString Settings::deObfuscate(const QString &password) return QString::fromUtf8(buffer.constData()); } +QColor Settings::getIdealTextColor(const QColor& rBackgroundColor) +{ + const int THRESHOLD = 105; + int BackgroundDelta = (rBackgroundColor.red() * 0.299) + (rBackgroundColor.green() * 0.587) + (rBackgroundColor.blue() * 0.114); + return QColor((255 - BackgroundDelta < THRESHOLD) ? Qt::black : Qt::white); +} + + bool Settings::hideUncheckedPlugins() const { return m_Settings.value("Settings/hide_unchecked_plugins", false).toBool(); @@ -355,6 +366,26 @@ int Settings::crashDumpsMax() const return m_Settings.value("Settings/crash_dumps_max", 5).toInt(); } +QColor Settings::modlistOverwrittenLooseColor() const +{ + return m_Settings.value("Settings/overwrittenLooseFilesColor", QColor(0, 255, 0, 64)).value(); +} + +QColor Settings::modlistOverwritingLooseColor() const +{ + return m_Settings.value("Settings/overwritingLooseFilesColor", QColor(255, 0, 0, 64)).value(); +} + +QColor Settings::modlistContainsPluginColor() const +{ + return m_Settings.value("Settings/containsPluginColor", QColor(0, 0, 255, 64)).value(); +} + +QColor Settings::pluginListContainedColor() const +{ + return m_Settings.value("Settings/containedColor", QColor(0, 0, 255, 64)).value(); +} + void Settings::setNexusLogin(QString username, QString password) { m_Settings.setValue("Settings/nexus_login", true); @@ -587,13 +618,14 @@ void Settings::resetDialogs() QuestionBoxMemory::resetDialogs(); } - void Settings::query(PluginContainer *pluginContainer, QWidget *parent) { SettingsDialog dialog(pluginContainer, parent); connect(&dialog, SIGNAL(resetDialogs()), this, SLOT(resetDialogs())); + connect(&dialog, SIGNAL(resetColorSettings()), this, SLOT(resetColorSettings())); + std::vector> tabs; tabs.push_back(std::unique_ptr(new GeneralTab(this, dialog))); @@ -658,6 +690,10 @@ Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) , m_compactBox(m_dialog.findChild("compactBox")) , m_showMetaBox(m_dialog.findChild("showMetaBox")) , m_usePrereleaseBox(m_dialog.findChild("usePrereleaseBox")) + , m_overwritingBtn(m_dialog.findChild("overwritingBtn")) + , m_overwrittenBtn(m_dialog.findChild("overwrittenBtn")) + , m_containsBtn(m_dialog.findChild("containsBtn")) + , m_containedBtn(m_dialog.findChild("containedBtn")) { // FIXME I think 'addLanguages' lives in here not in parent m_parent->addLanguages(m_languageBox); @@ -685,6 +721,50 @@ Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) m_styleBox->setCurrentIndex(currentID); } } + /* verision using palette only works with fusion theme for some stupid reason... + m_overwritingBtn->setAutoFillBackground(true); + m_overwrittenBtn->setAutoFillBackground(true); + m_containsBtn->setAutoFillBackground(true); + m_containedBtn->setAutoFillBackground(true); + m_overwritingBtn->setPalette(QPalette(m_parent->modlistOverwritingLooseColor())); + m_overwrittenBtn->setPalette(QPalette(m_parent->modlistOverwrittenLooseColor())); + m_containsBtn->setPalette(QPalette(m_parent->modlistContainsPluginColor())); + m_containedBtn->setPalette(QPalette(m_parent->pluginListContainedColor())); + QPalette palette1 = m_overwritingBtn->palette(); + QPalette palette2 = m_overwrittenBtn->palette(); + QPalette palette3 = m_containsBtn->palette(); + QPalette palette4 = m_containedBtn->palette(); + palette1.setColor(QPalette::Background, m_parent->modlistOverwritingLooseColor()); + palette2.setColor(QPalette::Background, m_parent->modlistOverwrittenLooseColor()); + palette3.setColor(QPalette::Background, m_parent->modlistContainsPluginColor()); + palette4.setColor(QPalette::Background, m_parent->pluginListContainedColor()); + m_overwritingBtn->setPalette(palette1); + m_overwrittenBtn->setPalette(palette2); + m_containsBtn->setPalette(palette3); + m_containedBtn->setPalette(palette4); + */ + + //version with stylesheet + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + + + m_overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + m_parent->modlistOverwritingLooseColor().name()).arg(getIdealTextColor( + m_parent->modlistOverwritingLooseColor()).name())); + m_overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + m_parent->modlistOverwrittenLooseColor().name()).arg(getIdealTextColor( + m_parent->modlistOverwrittenLooseColor()).name())); + m_containsBtn->setStyleSheet(COLOR_STYLE.arg( + m_parent->modlistContainsPluginColor().name()).arg(getIdealTextColor( + m_parent->modlistContainsPluginColor()).name())); + m_containedBtn->setStyleSheet(COLOR_STYLE.arg( + m_parent->pluginListContainedColor().name()).arg(getIdealTextColor( + m_parent->pluginListContainedColor()).name())); + + m_dialog.setOverwritingColor(m_parent->modlistOverwritingLooseColor()); + m_dialog.setOverwrittenColor(m_parent->modlistOverwrittenLooseColor()); + m_dialog.setContainsColor(m_parent->modlistContainsPluginColor()); + m_dialog.setContainedColor(m_parent->pluginListContainedColor()); m_compactBox->setChecked(m_parent->compactDownloads()); m_showMetaBox->setChecked(m_parent->metaDownloads()); @@ -707,6 +787,10 @@ void Settings::GeneralTab::update() emit m_parent->styleChanged(newStyle); } + m_Settings.setValue("Settings/overwritingLooseFilesColor", m_dialog.getOverwritingColor()); + m_Settings.setValue("Settings/overwrittenLooseFilesColor", m_dialog.getOverwrittenColor()); + m_Settings.setValue("Settings/containsPluginColor", m_dialog.getContainsColor()); + m_Settings.setValue("Settings/containedColor", m_dialog.getContainedColor()); m_Settings.setValue("Settings/compact_downloads", m_compactBox->isChecked()); m_Settings.setValue("Settings/meta_downloads", m_showMetaBox->isChecked()); m_Settings.setValue("Settings/use_prereleases", m_usePrereleaseBox->isChecked()); diff --git a/src/settings.h b/src/settings.h index c49edfcb..8fe053e8 100644 --- a/src/settings.h +++ b/src/settings.h @@ -29,6 +29,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include //for uint @@ -42,6 +43,7 @@ class QSpinBox; class QListWidget; class QWidget; class QLabel; +class QPushButton; struct ServerInfo; @@ -217,6 +219,15 @@ public: */ int crashDumpsMax() const; + QColor modlistOverwrittenLooseColor() const; + + QColor modlistOverwritingLooseColor() const; + + QColor modlistContainsPluginColor() const; + + QColor pluginListContainedColor() const; + + /** * @brief set the nexus login information * @@ -346,7 +357,8 @@ public: public slots: void managedGameChanged(MOBase::IPluginGame const *gamePlugin); - +public: + static QColor getIdealTextColor(const QColor& rBackgroundColor); private: static QString obfuscate(const QString &password); @@ -387,6 +399,10 @@ private: QCheckBox *m_compactBox; QCheckBox *m_showMetaBox; QCheckBox *m_usePrereleaseBox; + QPushButton *m_overwritingBtn; + QPushButton *m_overwrittenBtn; + QPushButton *m_containsBtn; + QPushButton *m_containedBtn; }; class PathsTab : public SettingsTab diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 058d082a..7f484830 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -33,6 +33,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #define WIN32_LEAN_AND_MEAN #include @@ -177,6 +178,109 @@ void SettingsDialog::on_browseOverwriteDirBtn_clicked() } } +void SettingsDialog::on_containsBtn_clicked() +{ + QColor result = QColorDialog::getColor(m_ContainsColor, this); + if (result.isValid()) { + m_ContainsColor = result; + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + ui->containsBtn->setStyleSheet(COLOR_STYLE.arg( + result.name()).arg(Settings::getIdealTextColor( + result).name())); + + /*ui->containsBtn->setAutoFillBackground(true); + ui->containsBtn->setPalette(QPalette(result)); + QPalette palette = ui->containsBtn->palette(); + palette.setColor(QPalette::Background, result); + ui->containsBtn->setPalette(palette);*/ + } +} + +void SettingsDialog::on_containedBtn_clicked() +{ + QColor result = QColorDialog::getColor(m_ContainedColor, this); + if (result.isValid()) { + m_ContainedColor = result; + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + ui->containedBtn->setStyleSheet(COLOR_STYLE.arg( + result.name()).arg(Settings::getIdealTextColor( + result).name())); + + /*ui->containedBtn->setAutoFillBackground(true); + ui->containedBtn->setPalette(QPalette(result)); + QPalette palette = ui->containedBtn->palette(); + palette.setColor(QPalette::Background, result); + ui->containedBtn->setPalette(palette);*/ + } +} + +void SettingsDialog::on_overwrittenBtn_clicked() +{ + QColor result = QColorDialog::getColor(m_OverwrittenColor, this); + if (result.isValid()) { + m_OverwrittenColor = result; + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + ui->overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + result.name()).arg(Settings::getIdealTextColor( + result).name())); + + /*ui->overwrittenBtn->setAutoFillBackground(true); + ui->overwrittenBtn->setPalette(QPalette(result)); + QPalette palette = ui->overwrittenBtn->palette(); + palette.setColor(QPalette::Background, result); + ui->overwrittenBtn->setPalette(palette);*/ + } +} + +void SettingsDialog::on_overwritingBtn_clicked() +{ + QColor result = QColorDialog::getColor(m_OverwritingColor, this); + if (result.isValid()) { + m_OverwritingColor = result; + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + ui->overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + result.name()).arg(Settings::getIdealTextColor( + result).name())); + + /*ui->overwritingBtn->setAutoFillBackground(true); + ui->overwritingBtn->setPalette(QPalette(result)); + QPalette palette = ui->overwritingBtn->palette(); + palette.setColor(QPalette::Background, result); + ui->overwritingBtn->setPalette(palette);*/ + } +} + +void SettingsDialog::on_resetColorsBtn_clicked() +{ + m_OverwritingColor = QColor(255, 0, 0, 64); + m_OverwrittenColor = QColor(0, 255, 0, 64); + m_ContainsColor = QColor(0, 0, 255, 64); + m_ContainedColor = QColor(0, 0, 255, 64); + + QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); + + ui->overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + QColor(255, 0, 0, 64).name()).arg(Settings::getIdealTextColor( + QColor(255, 0, 0, 64)).name())); + + ui->overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + QColor(0, 255, 0, 64).name()).arg(Settings::getIdealTextColor( + QColor(0, 255, 0, 64)).name())); + + ui->containsBtn->setStyleSheet(COLOR_STYLE.arg( + QColor(0, 0, 255, 64).name()).arg(Settings::getIdealTextColor( + QColor(0, 0, 255, 64)).name())); + + ui->containedBtn->setStyleSheet(COLOR_STYLE.arg( + QColor(0, 0, 255, 64).name()).arg(Settings::getIdealTextColor( + QColor(0, 0, 255, 64)).name())); + +} + void SettingsDialog::on_resetDialogsButton_clicked() { if (QMessageBox::question(this, tr("Confirm?"), diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 2e270131..c678ec78 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -56,6 +56,18 @@ private: void storeSettings(QListWidgetItem *pluginItem); +public: + + QColor getOverwritingColor() { return m_OverwritingColor; } + QColor getOverwrittenColor() { return m_OverwrittenColor; } + QColor getContainsColor() { return m_ContainsColor; } + QColor getContainedColor() { return m_ContainedColor; } + + void setOverwritingColor(QColor col) { m_OverwritingColor = col; } + void setOverwrittenColor(QColor col) { m_OverwrittenColor = col; } + void setContainsColor(QColor col) { m_ContainsColor = col; } + void setContainedColor(QColor col) { m_ContainedColor = col; } + private slots: void on_loginCheckBox_toggled(bool checked); @@ -85,9 +97,24 @@ private slots: void on_browseProfilesDirBtn_clicked(); + void on_overwritingBtn_clicked(); + + void on_overwrittenBtn_clicked(); + + void on_containsBtn_clicked(); + + void on_containedBtn_clicked(); + + void on_resetColorsBtn_clicked(); + private: Ui::SettingsDialog *ui; PluginContainer *m_PluginContainer; + + QColor m_OverwritingColor; + QColor m_OverwrittenColor; + QColor m_ContainsColor; + QColor m_ContainedColor; }; diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 05814091..4d6535dc 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -92,28 +92,65 @@ If you use pre-releases, never contact me directly by e-mail or via private mess User interface - - - - - If checked, the download interface will be more compact. - - - Compact Download Interface + + + + + Colors + + + + + Mod Contains selected Plugin + + + + + + + Plugin is Contained in selected Mod + + + + + + + Reset Colors + + + + + + + Is overwritten (loose files) + + + + + + + Is overwriting (loose files) + + + + - - + + - If checked, the download list will display meta information instead of file names. + Modify the categories available to arrange your mods. + + + Modify the categories available to arrange your mods. - Download Meta Information + Configure Mod Categories - + @@ -132,7 +169,17 @@ If you use pre-releases, never contact me directly by e-mail or via private mess - + + + + If checked, the download interface will be more compact. + + + Compact Download Interface + + + + Qt::Vertical @@ -145,16 +192,13 @@ If you use pre-releases, never contact me directly by e-mail or via private mess - - + + - Modify the categories available to arrange your mods. - - - Modify the categories available to arrange your mods. + If checked, the download list will display meta information instead of file names. - Configure Mod Categories + Download Meta Information @@ -1217,8 +1261,6 @@ For the other games this is not a sufficient replacement for AI! logLevelBox usePrereleaseBox compactBox - showMetaBox - resetDialogsButton categoriesBtn baseDirEdit browseBaseDirBtn -- cgit v1.3.1 From 2c53f9d934c27bf3d0414d5bb355dfde52cc4d73 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Thu, 1 Nov 2018 16:35:02 +0100 Subject: Cleaned up leftover from color customizzation. --- src/settings.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index 0ecbaa23..7d9fb7c0 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -624,8 +624,6 @@ void Settings::query(PluginContainer *pluginContainer, QWidget *parent) connect(&dialog, SIGNAL(resetDialogs()), this, SLOT(resetDialogs())); - connect(&dialog, SIGNAL(resetColorSettings()), this, SLOT(resetColorSettings())); - std::vector> tabs; tabs.push_back(std::unique_ptr(new GeneralTab(this, dialog))); -- cgit v1.3.1 From 545b7b4eb7f629ccbbe03d7c20c305f1225b5416 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 9 Nov 2018 17:42:15 -0600 Subject: Fix button colors in the settings dialog with the default theme --- src/settings.cpp | 15 ++++++--------- src/settingsdialog.cpp | 32 ++++++++++++++++++-------------- src/settingsdialog.h | 6 ++++++ 3 files changed, 30 insertions(+), 23 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index 7d9fb7c0..0f8eaa2a 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -741,24 +741,21 @@ Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) m_containsBtn->setPalette(palette3); m_containedBtn->setPalette(palette4); */ - - //version with stylesheet - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - - m_overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + //version with stylesheet + m_overwritingBtn->setStyleSheet(m_dialog.getColoredButtonStyleSheet().arg( m_parent->modlistOverwritingLooseColor().name()).arg(getIdealTextColor( m_parent->modlistOverwritingLooseColor()).name())); - m_overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + m_overwrittenBtn->setStyleSheet(m_dialog.getColoredButtonStyleSheet().arg( m_parent->modlistOverwrittenLooseColor().name()).arg(getIdealTextColor( m_parent->modlistOverwrittenLooseColor()).name())); - m_containsBtn->setStyleSheet(COLOR_STYLE.arg( + m_containsBtn->setStyleSheet(m_dialog.getColoredButtonStyleSheet().arg( m_parent->modlistContainsPluginColor().name()).arg(getIdealTextColor( m_parent->modlistContainsPluginColor()).name())); - m_containedBtn->setStyleSheet(COLOR_STYLE.arg( + m_containedBtn->setStyleSheet(m_dialog.getColoredButtonStyleSheet().arg( m_parent->pluginListContainedColor().name()).arg(getIdealTextColor( m_parent->pluginListContainedColor()).name())); - + m_dialog.setOverwritingColor(m_parent->modlistOverwritingLooseColor()); m_dialog.setOverwrittenColor(m_parent->modlistOverwrittenLooseColor()); m_dialog.setContainsColor(m_parent->modlistContainsPluginColor()); diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 7f484830..8a983896 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -59,6 +59,16 @@ SettingsDialog::~SettingsDialog() delete ui; } +QString SettingsDialog::getColoredButtonStyleSheet() const +{ + return QString("QPushButton {" + "background-color: %1;" + "color: %2;" + "border: 1px solid;" + "padding: 3px;" + "}"); +} + void SettingsDialog::accept() { QString newModPath = ui->modDirEdit->text(); @@ -184,8 +194,7 @@ void SettingsDialog::on_containsBtn_clicked() if (result.isValid()) { m_ContainsColor = result; - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - ui->containsBtn->setStyleSheet(COLOR_STYLE.arg( + ui->containsBtn->setStyleSheet(getColoredButtonStyleSheet().arg( result.name()).arg(Settings::getIdealTextColor( result).name())); @@ -203,8 +212,7 @@ void SettingsDialog::on_containedBtn_clicked() if (result.isValid()) { m_ContainedColor = result; - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - ui->containedBtn->setStyleSheet(COLOR_STYLE.arg( + ui->containedBtn->setStyleSheet(getColoredButtonStyleSheet().arg( result.name()).arg(Settings::getIdealTextColor( result).name())); @@ -222,8 +230,7 @@ void SettingsDialog::on_overwrittenBtn_clicked() if (result.isValid()) { m_OverwrittenColor = result; - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - ui->overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + ui->overwrittenBtn->setStyleSheet(getColoredButtonStyleSheet().arg( result.name()).arg(Settings::getIdealTextColor( result).name())); @@ -241,8 +248,7 @@ void SettingsDialog::on_overwritingBtn_clicked() if (result.isValid()) { m_OverwritingColor = result; - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - ui->overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + ui->overwritingBtn->setStyleSheet(getColoredButtonStyleSheet().arg( result.name()).arg(Settings::getIdealTextColor( result).name())); @@ -261,21 +267,19 @@ void SettingsDialog::on_resetColorsBtn_clicked() m_ContainsColor = QColor(0, 0, 255, 64); m_ContainedColor = QColor(0, 0, 255, 64); - QString COLOR_STYLE("QPushButton { background-color : %1; color : %2; }"); - - ui->overwritingBtn->setStyleSheet(COLOR_STYLE.arg( + ui->overwritingBtn->setStyleSheet(getColoredButtonStyleSheet().arg( QColor(255, 0, 0, 64).name()).arg(Settings::getIdealTextColor( QColor(255, 0, 0, 64)).name())); - ui->overwrittenBtn->setStyleSheet(COLOR_STYLE.arg( + ui->overwrittenBtn->setStyleSheet(getColoredButtonStyleSheet().arg( QColor(0, 255, 0, 64).name()).arg(Settings::getIdealTextColor( QColor(0, 255, 0, 64)).name())); - ui->containsBtn->setStyleSheet(COLOR_STYLE.arg( + ui->containsBtn->setStyleSheet(getColoredButtonStyleSheet().arg( QColor(0, 0, 255, 64).name()).arg(Settings::getIdealTextColor( QColor(0, 0, 255, 64)).name())); - ui->containedBtn->setStyleSheet(COLOR_STYLE.arg( + ui->containedBtn->setStyleSheet(getColoredButtonStyleSheet().arg( QColor(0, 0, 255, 64).name()).arg(Settings::getIdealTextColor( QColor(0, 0, 255, 64)).name())); diff --git a/src/settingsdialog.h b/src/settingsdialog.h index c678ec78..7df52ccd 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -44,6 +44,12 @@ public: explicit SettingsDialog(PluginContainer *pluginContainer, QWidget *parent = 0); ~SettingsDialog(); + /** + * @brief get stylesheet of settings buttons with colored background + * @return string of stylesheet + */ + QString getColoredButtonStyleSheet() const; + public slots: virtual void accept(); -- cgit v1.3.1 From effd05df06a8db24020d289e1734ba57e5488cb5 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 9 Nov 2018 19:05:06 -0600 Subject: Tweak text color selection to prevent white text on bright green background --- src/settings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index 0f8eaa2a..ce3a68ff 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -194,9 +194,9 @@ QString Settings::deObfuscate(const QString &password) QColor Settings::getIdealTextColor(const QColor& rBackgroundColor) { - const int THRESHOLD = 105; + const int THRESHOLD = 106; int BackgroundDelta = (rBackgroundColor.red() * 0.299) + (rBackgroundColor.green() * 0.587) + (rBackgroundColor.blue() * 0.114); - return QColor((255 - BackgroundDelta < THRESHOLD) ? Qt::black : Qt::white); + return QColor((255 - BackgroundDelta <= THRESHOLD) ? Qt::black : Qt::white); } -- cgit v1.3.1 From 2212ad6f1c0bbaff7025cdb7227023661e399596 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Thu, 29 Nov 2018 08:17:28 -0600 Subject: Add executable blacklisting --- src/mainwindow.cpp | 14 +-- src/organizer_en.ts | 263 +++++++++++++++++++++++++++++-------------------- src/organizercore.cpp | 20 +++- src/organizercore.h | 2 +- src/settings.cpp | 18 ++++ src/settings.h | 7 +- src/settingsdialog.cpp | 27 +++++ src/settingsdialog.h | 13 ++- src/settingsdialog.ui | 22 ++++- src/usvfsconnector.cpp | 13 ++- src/usvfsconnector.h | 2 +- 11 files changed, 272 insertions(+), 129 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d0591d6e..9a0e02aa 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2877,7 +2877,7 @@ void MainWindow::createSeparator_clicked() } int newPriority = -1; - if (m_ContextRow >= 0 && m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) + if (m_ContextRow >= 0 && m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) { newPriority = m_OrganizerCore.currentProfile()->getModPriority(m_ContextRow); } @@ -2885,7 +2885,7 @@ void MainWindow::createSeparator_clicked() if (m_OrganizerCore.createMod(name) == nullptr) { return; } m_OrganizerCore.refreshModList(); - if (newPriority >= 0) + if (newPriority >= 0) { m_OrganizerCore.modList()->changeModPriority(ModInfo::getIndex(name), newPriority); } @@ -4129,7 +4129,7 @@ void MainWindow::on_actionSettings_triggered() updateDownloadListDelegate(); - m_OrganizerCore.updateVFSParams(settings.logLevel(), settings.crashDumpsType()); + m_OrganizerCore.updateVFSParams(settings.logLevel(), settings.crashDumpsType(), settings.executablesBlacklist()); m_OrganizerCore.cycleDiagnostics(); } @@ -4405,8 +4405,8 @@ void MainWindow::sendSelectedPluginsToBottom_clicked() void MainWindow::sendSelectedPluginsToPriority_clicked() { bool ok; - int newPriority = QInputDialog::getInt(this, - tr("Set Priority"), tr("Set the priority of the selected plugins"), + int newPriority = QInputDialog::getInt(this, + tr("Set Priority"), tr("Set the priority of the selected plugins"), 0, 0, INT_MAX, 1, &ok); if (!ok) return; @@ -5678,8 +5678,8 @@ void MainWindow::sendSelectedModsToBottom_clicked() void MainWindow::sendSelectedModsToPriority_clicked() { bool ok; - int newPriority = QInputDialog::getInt(this, - tr("Set Priority"), tr("Set the priority of the selected mods"), + int newPriority = QInputDialog::getInt(this, + tr("Set Priority"), tr("Set the priority of the selected mods"), 0, 0, INT_MAX, 1, &ok); if (!ok) return; diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 9b1294ac..518e49bc 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -4041,113 +4041,113 @@ p, li { white-space: pre-wrap; } - + drag&drop failed: %1 - + Confirm - + Are you sure you want to remove "%1"? - + Flags - + Content - + Mod Name - + Version - + Priority - + Category - + Source Game - + Nexus ID - + Installation - - + + unknown - + Name of your mods - + Version of the mod (if available) - + Installation priority of your mod. The higher, the more "important" it is and thus overwrites files from mods with lower priority. - + Category of the mod. - + The source game which was the origin of this mod. - + Id of the mod as used on Nexus. - + Emblemes to highlight things that might require attention. - + Depicts the content of the mod:<br><table cellspacing=7><tr><td><img src=":/MO/gui/content/plugin" width=32/></td><td>Game plugins (esp/esm/esl)</td></tr><tr><td><img src=":/MO/gui/content/interface" width=32/></td><td>Interface</td></tr><tr><td><img src=":/MO/gui/content/mesh" width=32/></td><td>Meshes</td></tr><tr><td><img src=":/MO/gui/content/bsa" width=32/></td><td>BSA</td></tr><tr><td><img src=":/MO/gui/content/texture" width=32/></td><td>Textures</td></tr><tr><td><img src=":/MO/gui/content/sound" width=32/></td><td>Sounds</td></tr><tr><td><img src=":/MO/gui/content/music" width=32/></td><td>Music</td></tr><tr><td><img src=":/MO/gui/content/string" width=32/></td><td>Strings</td></tr><tr><td><img src=":/MO/gui/content/script" width=32/></td><td>Scripts (Papyrus)</td></tr><tr><td><img src=":/MO/gui/content/skse" width=32/></td><td>Script Extender plugins</td></tr><tr><td><img src=":/MO/gui/content/skyproc" width=32/></td><td>SkyProc Patcher</td></tr><tr><td><img src=":/MO/gui/content/menu" width=32/></td><td>Mod Configuration Menu</td></tr><tr><td><img src=":/MO/gui/content/inifile" width=32/></td><td>INI files</td></tr><tr><td><img src=":/MO/gui/content/modgroup" width=32/></td><td>ModGroup files</td></tr></table> - + Time this mod was installed @@ -4353,91 +4353,103 @@ Continue launching %1? - + + Blacklisted Executable + + + + + The executable you are attempted to launch is blacklisted in the virtual file system. This will likely prevent the executable, and any executables that are launched by this one, from seeing any mods. This could extend to INI files, save games and any other virtualized files. + +Continue launching %1? + + + + No profile set - + Failed to refresh list of esps: %1 - + Multiple esps/esls activated, please check that they don't conflict. - + Download? - + A download has been started but no installed page plugin recognizes it. If you download anyway no information (i.e. version) will be associated with the download. Continue? - + failed to update mod list: %1 - - + + login successful - + Login failed - + Login failed, try again? - + login failed: %1. Download will not be associated with an account - + login failed: %1 - + login failed: %1. You need to log-in with Nexus to update MO. - + MO1 "Script Extender" load mechanism has left hook.dll in your game folder - - + + Description missing - + <a href="%1">hook.dll</a> has been found in your game folder (right click to copy the full path). This is most likely a leftover of setting the ModOrganizer 1 load mechanism to "Script Extender", in which case you must remove this file either by changing the load mechanism in ModOrganizer 1 or manually removing the file, otherwise the game is likely to crash and burn. - + failed to save load order: %1 - + The designated write target "%1" is not enabled. @@ -5398,7 +5410,7 @@ If the folder was still in use, restart MO and try again. - + Mod Organizer @@ -5475,12 +5487,12 @@ If the folder was still in use, restart MO and try again. - + Script Extender - + Proxy DLL @@ -5694,18 +5706,18 @@ Select Show Details option to see the full change-log. - - + + attempt to store setting for unknown plugin "%1" - + Error - + Failed to create "%1", you may not have the necessary permission. path remains unchanged. @@ -6042,52 +6054,52 @@ p, li { white-space: pre-wrap; } - + Author: - + Version: - + Description: - + Key - + Value - + Blacklisted Plugins (use <del> to remove): - + Workarounds - + 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; } @@ -6103,17 +6115,17 @@ p, li { white-space: pre-wrap; } - + Load Mechanism - + 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. @@ -6124,17 +6136,17 @@ If you use the Steam version of Oblivion the default will NOT work. In this case - + NMM Version - + The Version of Nexus Mod Manager to impersonate. - + Mod Organizer uses an API provided by the Nexus to provide features like checking for updates and downloading files. Unfortunately this API has not been made available officially to third party tools like MO so we have to impersonate the Nexus Mod Manager to be allowed in. On top of this Nexus has used the client identification to lock out outdated versions of NMM to force users to update. This means that MO also needs to impersonate the new version of NMM even if MO doesn't need an update. Therefore you can configure the version to identify as here. Please note that MO does identify itself as MO to the webserver, it's not lying about what it is. It is merely adding a "compatible" NMM version to the user agent. @@ -6143,44 +6155,44 @@ tl;dr-version: If Nexus-features don't work, insert the current version num - + 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 - + 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. @@ -6188,44 +6200,63 @@ If you disable this feature, MO will only display official DLCs this way. Please - + Display mods installed outside MO - - + + 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 + + + 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 + + + + These are workarounds for problems with Mod Organizer. Please make sure you read the help text before changing anything here. - + Diagnostics - + 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 regluar use. On the "Error" level the log file usually remains empty. @@ -6233,37 +6264,37 @@ For the other games this is not a sufficient replacement for AI! - + Debug - + Info (recommended) - + Warning - + Error - + 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. @@ -6274,37 +6305,37 @@ For the other games this is not a sufficient replacement for AI! - + None - + Mini (recommended) - + Data - + Full - + 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. @@ -6312,12 +6343,12 @@ For the other games this is not a sufficient replacement for AI! - + Hint: right click link and copy link location - + Logs and crash dumps are stored under your current instance in the <a href="LOGS_FULL_PATH">LOGS_DIR</a> and <a href="DUMPS_FULL_PATH">DUMPS_DIR</a> folders. @@ -6327,52 +6358,68 @@ For the other games this is not a sufficient replacement for AI! - + Confirm - + Changing the mod directory affects all your profiles! Mods not present (or named differently) in the new location will be disabled in all profiles. There is no way to undo this unless you backed up your profiles manually. Proceed? - + + Executables Blacklist + + + + + Enter one executable per line to be blacklisted from the virtual file system. +Mods and other virtualized files will not be visible to these executables and +any executables launched by them. + +Example: + Chrome.exe + Firefox.exe + + + + Select base directory - + Select download directory - + Select mod directory - + Select cache directory - + Select profiles directory - + Select overwrite directory - + Confirm? - + This will make all dialogs show up again where you checked the "Remember selection"-box. Continue? @@ -6576,7 +6623,7 @@ On Windows XP: UsvfsConnector - + Preparing vfs diff --git a/src/organizercore.cpp b/src/organizercore.cpp index b66895db..9ac3cb63 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -762,9 +762,9 @@ void OrganizerCore::prepareVFS() m_USVFS.updateMapping(fileMapping(m_CurrentProfile->name(), QString())); } -void OrganizerCore::updateVFSParams(int logLevel, int crashDumpsType) { +void OrganizerCore::updateVFSParams(int logLevel, int crashDumpsType, QString executableBlacklist) { setGlobalCrashDumpsType(crashDumpsType); - m_USVFS.updateParams(logLevel, crashDumpsType); + m_USVFS.updateParams(logLevel, crashDumpsType, executableBlacklist); } bool OrganizerCore::cycleDiagnostics() { @@ -1339,10 +1339,24 @@ HANDLE OrganizerCore::spawnBinaryProcess(const QFileInfo &binary, } } + for (auto exec : settings().executablesBlacklist().split(";")) { + if (exec.compare(binary.fileName(), Qt::CaseInsensitive)) { + if (QuestionBoxMemory::query(window, QString("blacklistedExecutable"), binary.fileName(), + tr("Blacklisted Executable"), + tr("The executable you are attempted to launch is blacklisted in the virtual file" + " system. This will likely prevent the executable, and any executables that are" + " launched by this one, from seeing any mods. This could extend to INI files, save" + " games and any other virtualized files.\n\nContinue launching %1?").arg(binary.fileName()), + QDialogButtonBox::Yes | QDialogButtonBox::No) == QDialogButtonBox::No) { + return INVALID_HANDLE_VALUE; + } + } + } + QString modsPath = settings().getModDirectory(); // Check if this a request with either an executable or a working directory under our mods folder - // then will start the processs in a virtualized "environment" with the appropriate paths fixed: + // then will start the process in a virtualized "environment" with the appropriate paths fixed: // (i.e. mods\FNIS\path\exe => game\data\path\exe) QString cwdPath = currentDirectory.absolutePath(); bool virtualizedCwd = cwdPath.startsWith(modsPath, Qt::CaseInsensitive); diff --git a/src/organizercore.h b/src/organizercore.h index 28ecef48..086fa11d 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -167,7 +167,7 @@ public: void prepareVFS(); - void updateVFSParams(int logLevel, int crashDumpsType); + void updateVFSParams(int logLevel, int crashDumpsType, QString executableBlacklist); bool cycleDiagnostics(); diff --git a/src/settings.cpp b/src/settings.cpp index ce3a68ff..c311ef29 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -386,6 +386,20 @@ QColor Settings::pluginListContainedColor() const return m_Settings.value("Settings/containedColor", QColor(0, 0, 255, 64)).value(); } +QString Settings::executablesBlacklist() const +{ + return m_Settings.value("Settings/executable_blacklist", ( + QStringList() + << "Chrome.exe" + << "Firefox.exe" + << "TSVNCache.exe" + << "TGitCache.exe" + << "Steam.exe" + << "GameOverlayUI.exe" + ).join(";") + ).toString(); +} + void Settings::setNexusLogin(QString username, QString password) { m_Settings.setValue("Settings/nexus_login", true); @@ -1080,6 +1094,8 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, m_forceEnableBox->setChecked(m_parent->forceEnableCoreFiles()); m_displayForeignBox->setChecked(m_parent->displayForeign()); + m_dialog.setExecutableBlacklist(m_parent->executablesBlacklist()); + } void Settings::WorkaroundsTab::update() @@ -1094,4 +1110,6 @@ void Settings::WorkaroundsTab::update() 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()); + + m_Settings.setValue("Settings/executable_blacklist", m_dialog.getExecutableBlacklist()); } diff --git a/src/settings.h b/src/settings.h index 8fe053e8..667b1b4c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see . */ -#ifndef WORKAROUNDS_H -#define WORKAROUNDS_H +#ifndef SETTINGS_H +#define SETTINGS_H #include "loadmechanism.h" @@ -227,6 +227,7 @@ public: QColor pluginListContainedColor() const; + QString executablesBlacklist() const; /** * @brief set the nexus login information @@ -525,4 +526,4 @@ private: }; -#endif // WORKAROUNDS_H +#endif // SETTINGS_H diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index de18a850..e1c4b10d 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -34,6 +34,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #define WIN32_LEAN_AND_MEAN #include @@ -115,6 +116,32 @@ void SettingsDialog::on_categoriesBtn_clicked() } } +void SettingsDialog::on_execBlacklistBtn_clicked() +{ + bool ok = false; + QString result = QInputDialog::getMultiLineText( + this, + tr("Executables Blacklist"), + tr("Enter one executable per line to be blacklisted from the virtual file system.\n" + "Mods and other virtualized files will not be visible to these executables and\n" + "any executables launched by them.\n\n" + "Example:\n" + " Chrome.exe\n" + " Firefox.exe"), + m_ExecutableBlacklist.split(";").join("\n"), + &ok + ); + if (ok) { + QStringList blacklist; + for (auto exec : result.split("\n")) { + if (exec.trimmed().endsWith(".exe", Qt::CaseInsensitive)) { + blacklist << exec.trimmed(); + } + } + m_ExecutableBlacklist = blacklist.join(";"); + } +} + void SettingsDialog::on_bsaDateBtn_clicked() { IPluginGame const *game diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 386cd24e..911f910d 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see . */ -#ifndef WORKAROUNDDIALOG_H -#define WORKAROUNDDIALOG_H +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H #include "tutorabledialog.h" #include @@ -69,17 +69,22 @@ public: QColor getOverwrittenColor() { return m_OverwrittenColor; } QColor getContainsColor() { return m_ContainsColor; } QColor getContainedColor() { return m_ContainedColor; } + QString getExecutableBlacklist() { return m_ExecutableBlacklist; } void setOverwritingColor(QColor col) { m_OverwritingColor = col; } void setOverwrittenColor(QColor col) { m_OverwrittenColor = col; } void setContainsColor(QColor col) { m_ContainsColor = col; } void setContainedColor(QColor col) { m_ContainedColor = col; } + void setExecutableBlacklist(QString blacklist) { m_ExecutableBlacklist = blacklist; } + private slots: void on_loginCheckBox_toggled(bool checked); void on_categoriesBtn_clicked(); + void on_execBlacklistBtn_clicked(); + void on_bsaDateBtn_clicked(); void on_browseDownloadDirBtn_clicked(); @@ -134,8 +139,10 @@ private: QColor m_OverwrittenColor; QColor m_ContainsColor; QColor m_ContainedColor; + + QString m_ExecutableBlacklist; }; -#endif // WORKAROUNDDIALOG_H +#endif // SETTINGSDIALOG_H diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 555180b5..ae13b9f2 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -17,7 +17,7 @@ - 4 + 5 @@ -1037,6 +1037,26 @@ For the other games this is not a sufficient replacement for AI! + + + + 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 + + + diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index 4ffc81c0..9c81d0d9 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -132,7 +132,11 @@ UsvfsConnector::UsvfsConnector() CreateVFS(¶ms); - BlacklistExecutable(L"TSVNCache.exe"); + ClearExecutableBlacklist(); + for (auto exec : Settings::instance().executablesBlacklist().split(";")) { + std::wstring buf = exec.toStdWString(); + BlacklistExecutable(buf.data()); + } m_LogWorker.moveToThread(&m_WorkerThread); @@ -199,6 +203,11 @@ void UsvfsConnector::updateMapping(const MappingType &mapping) */ } -void UsvfsConnector::updateParams(int logLevel, int crashDumpsType) { +void UsvfsConnector::updateParams(int logLevel, int crashDumpsType, QString executableBlacklist) { USVFSUpdateParams(::logLevel(logLevel), ::crashDumpsType(crashDumpsType)); + ClearExecutableBlacklist(); + for (auto exec : executableBlacklist.split(";")) { + std::wstring buf = exec.toStdWString(); + BlacklistExecutable(buf.data()); + } } diff --git a/src/usvfsconnector.h b/src/usvfsconnector.h index 40f8857b..3aefb703 100644 --- a/src/usvfsconnector.h +++ b/src/usvfsconnector.h @@ -82,7 +82,7 @@ public: ~UsvfsConnector(); void updateMapping(const MappingType &mapping); - void updateParams(int logLevel, int crashDumpsType); + void updateParams(int logLevel, int crashDumpsType, QString executableBlacklist); private: -- cgit v1.3.1 From 4914fd172deffe15631ab37264a1ffda33637e99 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 8 Dec 2018 01:19:37 -0600 Subject: Add workarounds button to reset window geometries --- src/mainwindow.cpp | 34 ++-- src/organizer_en.ts | 527 +++++++++++++++++++++++++------------------------ src/settings.cpp | 11 ++ src/settingsdialog.cpp | 4 + src/settingsdialog.h | 1 + src/settingsdialog.ui | 16 ++ 6 files changed, 323 insertions(+), 270 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index de015c54..84b77945 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1738,21 +1738,31 @@ void MainWindow::processUpdates() { void MainWindow::storeSettings(QSettings &settings) { settings.setValue("group_state", ui->groupCombo->currentIndex()); - - settings.setValue("window_geometry", saveGeometry()); - settings.setValue("window_split", ui->splitter->saveState()); - settings.setValue("log_split", ui->topLevelSplitter->saveState()); - - settings.setValue("browser_geometry", m_IntegratedBrowser.saveGeometry()); - - settings.setValue("filters_visible", ui->displayCategoriesBtn->isChecked()); - settings.setValue("selected_executable", ui->executablesListBox->currentIndex()); - for (const std::pair kv : m_PersistedGeometry) { - QString key = QString("geometry/") + kv.first; - settings.setValue(key, kv.second->saveState()); + if (settings.value("reset_geometry", false).toBool()) { + settings.remove("window_geometry"); + settings.remove("window_split"); + settings.remove("log_split"); + settings.remove("filters_visible"); + settings.remove("browser_geometry"); + settings.beginGroup("geometry"); + for (auto key : settings.childKeys()) { + settings.remove(key); + } + settings.endGroup(); + settings.remove("reset_geometry"); + } else { + settings.setValue("window_geometry", saveGeometry()); + settings.setValue("window_split", ui->splitter->saveState()); + settings.setValue("log_split", ui->topLevelSplitter->saveState()); + settings.setValue("browser_geometry", m_IntegratedBrowser.saveGeometry()); + settings.setValue("filters_visible", ui->displayCategoriesBtn->isChecked()); + for (const std::pair kv : m_PersistedGeometry) { + QString key = QString("geometry/") + kv.first; + settings.setValue(key, kv.second->saveState()); + } } } diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 2ea1c09a..1b752ae5 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -1620,7 +1620,7 @@ p, li { white-space: pre-wrap; } - + Create Backup @@ -1784,8 +1784,8 @@ p, li { white-space: pre-wrap; } - - + + Refresh @@ -1969,7 +1969,7 @@ p, li { white-space: pre-wrap; } - + Update @@ -2010,7 +2010,7 @@ Right now this has very limited functionality - + Endorse Mod Organizer @@ -2145,678 +2145,678 @@ Right now this has very limited functionality - + Also in: <br> - + No conflict - + <Edit...> - + This bsa is enabled in the ini file so it may be required! - + Activating Network Proxy - + Notice: Your current MO version (%1) is lower than the previous version (%2).<br>The GUI may not downgrade gracefully, so you may experience oddities.<br>However, there should be no serious issues. - + Choose Mod - + Mod Archive - + Start Tutorial? - + You're about to start a tutorial. For technical reasons it's not possible to end the tutorial early. Continue? - + failed to spawn notepad.exe: %1 - + failed to change origin name: %1 - + failed to move "%1" from mod "%2" to "%3": %4 - + <Contains %1> - + <Checked> - + <Unchecked> - + <Update> - + <Mod Backup> - + <Managed by MO> - + <Managed outside MO> - + <No category> - + <Conflicted> - + <Not Endorsed> - + failed to rename mod: %1 - + Overwrite? - + This will replace the existing mod "%1". Continue? - + failed to remove mod "%1" - - - + + + failed to rename "%1" to "%2" - - - - + + + + Confirm - + Remove the following mods?<br><ul>%1</ul> - + failed to remove mod: %1 - - - + + + Failed - + Installation file no longer exists - + Mods installed with old versions of MO can't be reinstalled in this way. - + Failed to create backup. - + You need to be logged in with Nexus to resume a download - - + + You need to be logged in with Nexus to endorse - + Failed to display overwrite dialog: %1 - + Nexus ID for this Mod is unknown - + Web page for this mod is unknown - - - + + + Create Mod... - + This will create an empty mod. Please enter a name: - - + + A mod with this name already exists - + Create Separator... - + This will create a new separator. Please enter a name: - + A separator with this name already exists - + This will move all files from overwrite into a new, regular mod. Please enter a name: - - + + Are you sure? - + About to recursively delete: - + Not logged in, endorsement information will be wrong - + Continue? - + The versioning scheme decides which version is considered newer than another. This function will guess the versioning scheme under the assumption that the installed version is outdated. - - + + Sorry - + I don't know a versioning scheme where %1 is newer than %2. - + Really enable all visible mods? - + Really disable all visible mods? - + Export to csv - + CSV (Comma Separated Values) is a format that can be imported in programs like Excel to create a spreadsheet. You can also use online editors and converters instead. - + Select what mods you want export: - + All installed mods - + Only active (checked) mods from your current profile - + All currently visible mods in the mod list - + Choose what Columns to export: - + Mod_Priority - + Mod_Name - + Mod_Status - + Primary_Category - + Nexus_ID - + Mod_Nexus_URL - + Mod_Version - + Install_Date - + Download_File_Name - + export failed: %1 - + Open Game folder - + Open MyGames folder - + Open Instance folder - + Open Mods folder - + Open Profile folder - + Open Downloads folder - + Open MO2 Install folder - + Open MO2 Plugins folder - + Open MO2 Logs folder - + Install Mod... - + Create empty mod - + Create Separator - + Enable all visible - + Disable all visible - + Check all for update - + Export to csv... - - + + Send to - - + + Top - - + + Bottom - - + + Priority... - + Separator... - + All Mods - + Sync to Mods... - + Clear Overwrite... - - + + Open in Explorer - + Restore Backup - + Remove Backup... - - + + Change Categories - - + + Primary Category - + Rename Separator... - + Remove Separator... - + Select Color... - + Reset Color - + Change versioning scheme - + Un-ignore update - + Ignore update - - + + Enable selected - - + + Disable selected - + Rename Mod... - + Reinstall Mod - + Remove Mod... - + Un-Endorse - - + + Endorse - + Won't endorse - + Endorsement state unknown - + Ignore missing data - + Mark as converted/working - + Visit on Nexus - + Visit web page - + Information... - - + + Exception: - - + + Unknown exception - + <All> - + <Multiple> - + %1 more - + Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin. @@ -2824,12 +2824,12 @@ You can also use online editors and converters instead. - + Enable Mods... - + Delete %n save(s) @@ -2837,335 +2837,335 @@ You can also use online editors and converters instead. - + failed to remove %1 - + failed to create %1 - + Can't change download directory while downloads are in progress! - + failed to write to file %1 - + %1 written - + Select binary - + Binary - + Enter Name - + Please enter a name for the executable - + Not an executable - + This is not a recognized executable. - - + + Replace file? - + There already is a hidden version of this file. Replace it? - - + + File operation failed - - + + Failed to remove "%1". Maybe you lack the required file permissions? - + There already is a visible version of this file. Replace it? - - + + Set Priority - + Set the priority of the selected plugins - + file not found: %1 - + failed to generate preview for %1 - + Sorry, can't preview anything. This function currently does not support extracting from bsas. - + Update available - + Open/Execute - + Add as Executable - + Preview - + Un-Hide - + Hide - + Write To File... - + Do you want to endorse Mod Organizer on %1 now? - + Thank you! - + Thank you for your endorsement! - + Request to Nexus failed: %1 - - + + failed to read %1: %2 - - + + Error - + failed to extract %1 (errorcode %2) - + Extract BSA - + This archive contains invalid hashes. Some files may be broken. - + Extract... - + This will restart MO, continue? - + Edit Categories... - + Deselect filter - + Remove - + Enable all - + Disable all - + Unlock load order - + Lock load order - + depends on missing "%1" - + incompatible with "%1" - + Please wait while LOOT is running - + loot failed. Exit code was: %1 - + failed to start loot - + failed to run loot: %1 - + Errors occured - + Backup of load order created - + Choose backup to restore - + No Backups - + There are no backups to restore - - + + Restore failed - - + + Failed to restore the backup. Errorcode: %1 - + Backup of modlist created - + A file with the same name has already been downloaded. What would you like to do? - + Overwrite - + Rename new file - + Ignore file - + Set the priority of the selected mods @@ -5462,13 +5462,13 @@ If the folder was still in use, restart MO and try again. - - + + <Manage...> - + failed to parse profile %1: %2 @@ -6268,27 +6268,38 @@ programs you are intentionally running. - + + + 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 + + + + These are workarounds for problems with Mod Organizer. Please make sure you read the help text before changing anything here. - + Diagnostics - + 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 regluar use. On the "Error" level the log file usually remains empty. @@ -6296,37 +6307,37 @@ programs you are intentionally running. - + Debug - + Info (recommended) - + Warning - + Error - + 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. @@ -6337,37 +6348,37 @@ programs you are intentionally running. - + None - + Mini (recommended) - + Data - + Full - + 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. @@ -6375,12 +6386,12 @@ programs you are intentionally running. - + Hint: right click link and copy link location - + Logs and crash dumps are stored under your current instance in the <a href="LOGS_FULL_PATH">LOGS_DIR</a> and <a href="DUMPS_FULL_PATH">DUMPS_DIR</a> folders. diff --git a/src/settings.cpp b/src/settings.cpp index c311ef29..3abb0988 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1112,4 +1112,15 @@ void Settings::WorkaroundsTab::update() m_Settings.setValue("Settings/display_foreign", m_displayForeignBox->isChecked()); m_Settings.setValue("Settings/executable_blacklist", m_dialog.getExecutableBlacklist()); + + if (m_dialog.getResetGeometries()) { + m_Settings.setValue("reset_geometry", true); + if (QMessageBox::question(nullptr, + tr("Restart Mod Organizer?"), + tr("In order to reset the window geometries, MO must be restarted.\n" + "Restart it now?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + qApp->exit(INT_MAX); + } + } } diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index e1c4b10d..dec2532c 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -94,6 +94,10 @@ void SettingsDialog::accept() TutorableDialog::accept(); } +bool SettingsDialog::getResetGeometries() +{ + return ui->resetGeometryBtn->isChecked(); +} void SettingsDialog::on_loginCheckBox_toggled(bool checked) { diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 911f910d..95ed288f 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -70,6 +70,7 @@ public: QColor getContainsColor() { return m_ContainsColor; } QColor getContainedColor() { return m_ContainedColor; } QString getExecutableBlacklist() { return m_ExecutableBlacklist; } + bool getResetGeometries(); void setOverwritingColor(QColor col) { m_OverwritingColor = col; } void setOverwrittenColor(QColor col) { m_OverwrittenColor = col; } diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index a6c6a03b..91bfca4e 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -1057,6 +1057,22 @@ programs you are intentionally running. + + + + 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 + + + true + + + -- cgit v1.3.1 From 93763a93640754f468d4a5d1aeaf5ad4effa6d56 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 8 Dec 2018 11:15:16 -0600 Subject: Add workaround setting to prevent the GUI from locking when running an executable --- src/organizercore.cpp | 5 ++- src/settings.cpp | 8 ++++ src/settings.h | 6 +++ src/settingsdialog.ui | 117 +++++++++++++++++++++++++++++--------------------- 4 files changed, 85 insertions(+), 51 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 4dbe7c86..1a5a9484 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1223,7 +1223,7 @@ HANDLE OrganizerCore::spawnBinaryDirect(const QFileInfo &binary, LPDWORD exitCode) { HANDLE processHandle = spawnBinaryProcess(binary, arguments, profileName, currentDirectory, steamAppID, customOverwrite); - if (processHandle != INVALID_HANDLE_VALUE) { + if (Settings::instance().lockGUI() && processHandle != INVALID_HANDLE_VALUE) { std::unique_ptr dlg; ILockedWaitingForProcess* uilock = nullptr; @@ -1485,6 +1485,9 @@ HANDLE OrganizerCore::startApplication(const QString &executable, bool OrganizerCore::waitForApplication(HANDLE handle, LPDWORD exitCode) { + if (!Settings::instance().lockGUI()) + return true; + ILockedWaitingForProcess* uilock = nullptr; if (m_UserInterface != nullptr) { uilock = m_UserInterface->lock(); diff --git a/src/settings.cpp b/src/settings.cpp index 3abb0988..b067106f 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -210,6 +210,11 @@ bool Settings::forceEnableCoreFiles() const return m_Settings.value("Settings/force_enable_core_files", true).toBool(); } +bool Settings::lockGUI() const +{ + return m_Settings.value("Settings/lock_gui", true).toBool(); +} + bool Settings::automaticLoginEnabled() const { return m_Settings.value("Settings/nexus_login", false).toBool(); @@ -1060,6 +1065,7 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, , m_hideUncheckedBox(m_dialog.findChild("hideUncheckedBox")) , m_forceEnableBox(m_dialog.findChild("forceEnableBox")) , m_displayForeignBox(m_dialog.findChild("displayForeignBox")) + , m_lockGUIBox(m_dialog.findChild("lockGUIBox")) { m_appIDEdit->setText(m_parent->getSteamAppID()); @@ -1093,6 +1099,7 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, m_hideUncheckedBox->setChecked(m_parent->hideUncheckedPlugins()); m_forceEnableBox->setChecked(m_parent->forceEnableCoreFiles()); m_displayForeignBox->setChecked(m_parent->displayForeign()); + m_lockGUIBox->setChecked(m_parent->lockGUI()); m_dialog.setExecutableBlacklist(m_parent->executablesBlacklist()); @@ -1110,6 +1117,7 @@ void Settings::WorkaroundsTab::update() 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()); + m_Settings.setValue("Settings/lock_gui", m_lockGUIBox->isChecked()); m_Settings.setValue("Settings/executable_blacklist", m_dialog.getExecutableBlacklist()); diff --git a/src/settings.h b/src/settings.h index 667b1b4c..2b8186f3 100644 --- a/src/settings.h +++ b/src/settings.h @@ -109,6 +109,11 @@ public: */ bool forceEnableCoreFiles() const; + /** + * @return true if the GUI should be locked when running executables + */ + bool lockGUI() const; + /** * @brief register download speed * @param url complete download url @@ -496,6 +501,7 @@ private: QCheckBox *m_hideUncheckedBox; QCheckBox *m_forceEnableBox; QCheckBox *m_displayForeignBox; + QCheckBox *m_lockGUIBox; }; private slots: diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 91bfca4e..203078a6 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -966,57 +966,77 @@ tl;dr-version: If Nexus-features don't work, insert the current version number o - - - 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) + + + + + 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 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. + + + Force-enable game files + + + 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 - - + + + Display mods installed outside MO + + + true + + + + + + + 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 + + + + + + + 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 + + + + @@ -1330,9 +1350,6 @@ programs you are intentionally running. appIDEdit mechanismBox nmmVersionEdit - hideUncheckedBox - forceEnableBox - displayForeignBox bsaDateBtn tabWidget -- cgit v1.3.1 From 1266e13921812ac647e1b788fab5eb04e8267ec9 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Tue, 11 Dec 2018 01:52:53 -0600 Subject: Add the ability to change the managed game directory --- src/mainwindow.cpp | 13 +++++++++++-- src/settings.cpp | 11 +++++++++++ src/settings.h | 5 +++++ src/settingsdialog.cpp | 10 ++++++++++ src/settingsdialog.h | 2 ++ src/settingsdialog.ui | 7 +++++++ 6 files changed, 46 insertions(+), 2 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2551aa2a..834a1fce 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4178,11 +4178,22 @@ void MainWindow::on_actionSettings_triggered() QString oldModDirectory(settings.getModDirectory()); QString oldCacheDirectory(settings.getCacheDirectory()); QString oldProfilesDirectory(settings.getProfileDirectory()); + QString oldManagedGameDirectory(settings.getManagedGameDirectory()); bool oldDisplayForeign(settings.displayForeign()); bool proxy = settings.useProxy(); + DownloadManager *dlManager = m_OrganizerCore.downloadManager(); settings.query(&m_PluginContainer, this); + if (oldManagedGameDirectory != settings.getManagedGameDirectory()) { + QMessageBox::about(this, tr("Restarting MO"), + tr("Changing the managed game directory requires restarting MO.\n" + "Any pending downloads will be paused.\n\n" + "Click OK to restart MO now.")); + dlManager->pauseAll(); + qApp->exit(INT_MAX); + } + InstallationManager *instManager = m_OrganizerCore.installationManager(); instManager->setModsDirectory(settings.getModDirectory()); instManager->setDownloadDirectory(settings.getDownloadDirectory()); @@ -4194,8 +4205,6 @@ void MainWindow::on_actionSettings_triggered() refreshProfiles(); } - DownloadManager *dlManager = m_OrganizerCore.downloadManager(); - if (dlManager->getOutputDirectory() != settings.getDownloadDirectory()) { if (dlManager->downloadsInProgress()) { MessageDialog::showMessage(tr("Can't change download directory while " diff --git a/src/settings.cpp b/src/settings.cpp index b067106f..5db656d8 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -298,6 +298,11 @@ QString Settings::getModDirectory(bool resolve) const return getConfigurablePath("mod_directory", ToQString(AppConfig::modsPath()), resolve); } +QString Settings::getManagedGameDirectory() const +{ + return m_Settings.value("gamePath", "").toString(); +} + QString Settings::getProfileDirectory(bool resolve) const { return getConfigurablePath("profiles_directory", ToQString(AppConfig::profilesPath()), resolve); @@ -882,6 +887,12 @@ void Settings::PathsTab::update() } else { m_Settings.remove("Settings/base_directory"); } + + QFileInfo oldGameExe(m_parent->m_GamePlugin->gameDirectory().absoluteFilePath(m_parent->m_GamePlugin->binaryName())); + QFileInfo newGameExe(m_managedGameDirEdit->text()); + if (oldGameExe != newGameExe) { + m_Settings.setValue("gamePath", newGameExe.absolutePath()); + } } Settings::DiagnosticsTab::DiagnosticsTab(Settings *m_parent, SettingsDialog &m_dialog) diff --git a/src/settings.h b/src/settings.h index 2b8186f3..4009d4a3 100644 --- a/src/settings.h +++ b/src/settings.h @@ -160,6 +160,11 @@ public: **/ QString getCacheDirectory(bool resolve = true) const; + /** + * retrieve the directory where the managed game is stored (with native separators) + **/ + QString getManagedGameDirectory() const; + /** * retrieve the directory where profiles stored (with native separators) **/ diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index dec2532c..0d96e63a 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -220,6 +220,16 @@ void SettingsDialog::on_browseOverwriteDirBtn_clicked() } } +void SettingsDialog::on_browseGameDirBtn_clicked() +{ + QFileInfo oldGameExe(ui->managedGameDirEdit->text()); + + QString temp = QFileDialog::getOpenFileName(this, tr("Select game executable"), oldGameExe.absolutePath(), oldGameExe.fileName()); + if (!temp.isEmpty()) { + ui->managedGameDirEdit->setText(temp); + } +} + void SettingsDialog::on_containsBtn_clicked() { QColor result = QColorDialog::getColor(m_ContainsColor, this); diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 95ed288f..f0567d87 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -110,6 +110,8 @@ private slots: void on_browseProfilesDirBtn_clicked(); + void on_browseGameDirBtn_clicked(); + void on_overwritingBtn_clicked(); void on_overwrittenBtn_clicked(); diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 203078a6..80a6a0e7 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -386,6 +386,13 @@ If you use pre-releases, never contact me directly by e-mail or via private mess + + + + ... + + + -- cgit v1.3.1 From 5335188e635c8c1b1cb2529e2a921d15c7d02058 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Tue, 11 Dec 2018 14:47:50 -0600 Subject: Add option to remove column colors for mod list separators --- src/modlist.cpp | 8 +++++--- src/settings.cpp | 8 ++++++++ src/settings.h | 7 +++++++ src/settingsdialog.ui | 40 ++++++++++++++++++++++++++++------------ 4 files changed, 48 insertions(+), 15 deletions(-) (limited to 'src/settings.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 547cc853..dfe2efd3 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -395,7 +395,6 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const return QVariant(); } else if ((role == Qt::BackgroundRole) || (role == ViewMarkingScrollBar::DEFAULT_ROLE)) { - auto flags = modInfo->getFlags(); if (modInfo->getHighlight() & ModInfo::HIGHLIGHT_PLUGIN) { return Settings::instance().modlistContainsPluginColor(); } else if (m_Overwrite.find(modIndex) != m_Overwrite.end()) { @@ -403,8 +402,11 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const } else if (m_Overwritten.find(modIndex) != m_Overwritten.end()) { return Settings::instance().modlistOverwritingLooseColor(); - } else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_SEPARATOR) != flags.end() && modInfo->getColor().isValid()) { - return modInfo->getColor(); + } else if (modInfo->hasFlag(ModInfo::FLAG_SEPARATOR) + && modInfo->getColor().isValid() + && ((role != ViewMarkingScrollBar::DEFAULT_ROLE) + || Settings::instance().colorSeparatorScrollbar())) { + return modInfo->getColor(); } else { return QVariant(); } diff --git a/src/settings.cpp b/src/settings.cpp index 5db656d8..18e893cb 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -148,6 +148,11 @@ void Settings::registerAsNXMHandler(bool force) } } +bool Settings::colorSeparatorScrollbar() const +{ + return m_Settings.value("Settings/colorSeparatorScrollbars", true).toBool(); +} + void Settings::managedGameChanged(IPluginGame const *gamePlugin) { m_GamePlugin = gamePlugin; @@ -716,6 +721,7 @@ Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) , m_overwrittenBtn(m_dialog.findChild("overwrittenBtn")) , m_containsBtn(m_dialog.findChild("containsBtn")) , m_containedBtn(m_dialog.findChild("containedBtn")) + , m_colorSeparatorsBox(m_dialog.findChild("colorSeparatorsBox")) { // FIXME I think 'addLanguages' lives in here not in parent m_parent->addLanguages(m_languageBox); @@ -788,6 +794,7 @@ Settings::GeneralTab::GeneralTab(Settings *m_parent, SettingsDialog &m_dialog) m_compactBox->setChecked(m_parent->compactDownloads()); m_showMetaBox->setChecked(m_parent->metaDownloads()); m_usePrereleaseBox->setChecked(m_parent->usePrereleases()); + m_colorSeparatorsBox->setChecked(m_parent->colorSeparatorScrollbar()); } void Settings::GeneralTab::update() @@ -813,6 +820,7 @@ void Settings::GeneralTab::update() m_Settings.setValue("Settings/compact_downloads", m_compactBox->isChecked()); m_Settings.setValue("Settings/meta_downloads", m_showMetaBox->isChecked()); m_Settings.setValue("Settings/use_prereleases", m_usePrereleaseBox->isChecked()); + m_Settings.setValue("Settings/colorSeparatorScrollbars", m_colorSeparatorsBox->isChecked()); } Settings::PathsTab::PathsTab(Settings *parent, SettingsDialog &dialog) diff --git a/src/settings.h b/src/settings.h index 4009d4a3..912864e2 100644 --- a/src/settings.h +++ b/src/settings.h @@ -365,6 +365,12 @@ public: */ void registerAsNXMHandler(bool force); + /** + * @brief color the scrollbar of the mod list for custom separator colors? + * @return the state of the setting + */ + bool colorSeparatorScrollbar() const; + public slots: void managedGameChanged(MOBase::IPluginGame const *gamePlugin); @@ -414,6 +420,7 @@ private: QPushButton *m_overwrittenBtn; QPushButton *m_containsBtn; QPushButton *m_containedBtn; + QCheckBox *m_colorSeparatorsBox; }; class PathsTab : public SettingsTab diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 80a6a0e7..6557bbcc 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -99,31 +99,31 @@ If you use pre-releases, never contact me directly by e-mail or via private mess Colors - - + + - Mod Contains selected Plugin + Reset Colors - - + + - Plugin is Contained in selected Mod + Is overwritten (loose files) - - + + - Reset Colors + Mod Contains selected Plugin - - + + - Is overwritten (loose files) + Plugin is Contained in selected Mod @@ -134,6 +134,22 @@ If you use pre-releases, never contact me directly by e-mail or via private mess + + + + When this is enabled, the color defined for a separator will be shown on the mod list scrollbar at the location of the separator. This can be useful for quick navigation between separator sections or to a specific separator section. + + + When this is enabled, the color defined for a separator will be shown on the mod list scrollbar at the location of the separator. This can be useful for quick navigation between separator sections or to a specific separator section. + + + Show mod list separator colors on the scrollbar + + + true + + + -- cgit v1.3.1