Compare commits

..
162 Commits
Author SHA1 Message Date
LostDragonist e2b799bd6b Update translation file 2018-12-20 15:56:54 -06:00
LostDragonist 185eb8e5ef Merge branch 'Develop' 2018-12-20 15:34:11 -06:00
LostDragonist 63efd21a6a Fix version reporting to allow non-alpha builds 2018-12-20 15:33:01 -06:00
LostDragonist ed67ac2113 Merge pull request #586 from ModOrganizer2/Develop
Release 2.1.6
2018-12-20 14:33:08 -06:00
Al12rs 9a33dc1480 *Added "Open INIs Folder" option.
*Changed "Open Instance Folder" to open the Appdata or MO2 install instead of the baseDirectory.
2018-12-20 19:12:11 +01:00
LostDragonist 1b0c437788 Update translation file 2018-12-19 14:33:04 -06:00
LostDragonist 5e530becc2 Don't mention save games when dealing with INI files 2018-12-19 13:02:15 -06:00
LostDragonist d9835cc4ae Update translation file 2018-12-19 12:47:33 -06:00
LostDragonist 18ea79c2d0 Update translation file 2018-12-19 11:53:53 -06:00
LostDragonist 37a6989ba8 Make language about profile-specific settings and save games consistent 2018-12-19 11:53:29 -06:00
LostDragonist 830b63c4e2 Re-initialize the profile configuration if INI files are missing 2018-12-19 11:43:15 -06:00
LostDragonist 662772c2fc Optionally delete and restore profile-specific game INI files when changing the setting 2018-12-19 11:19:03 -06:00
LostDragonist 027edcf688 Enable per-profile game INI files by default again 2018-12-19 11:03:24 -06:00
Al12rs ff51aa10c2 Fixed performance issue of Data tab. 2018-12-18 00:12:28 +01:00
LostDragonist cbc9d00584 Update translation file 2018-12-15 16:23:20 -06:00
Al12rs e15f768a15 Fixed opening multiple modinfodialog from Open Origin info. 2018-12-13 21:18:35 +01:00
LostDragonist e63eba2ca1 Improve cleanup of temporary files when installing 2018-12-13 13:30:04 -06:00
LostDragonist 20008e17b7 Fix highlighting plugins when selecting mods with no visible priority 2018-12-12 17:43:43 -06:00
LostDragonist c24200bc04 Remove a weird vertical spacer from the diagnostics settings tab 2018-12-12 13:22:17 -06:00
LostDragonist 25a9290cd5 Reset previousSeparatorColor when a separator color is reset 2018-12-12 09:40:25 -06:00
Al12rs efe657c23e Removed old styles 2018-12-12 16:30:04 +01:00
LePresidente 571347d2de Pass DIR parameter to install exe, so installation directory matches current directory. 2018-12-12 16:01:50 +02:00
Al12rs 346bc630f8 Create new Separators in last used color. 2018-12-12 10:37:10 +01:00
LostDragonist 013890f644 Remember the last separator color used 2018-12-12 03:04:23 -06:00
LostDragonist 3559364473 Update translation file 2018-12-12 02:46:51 -06:00
LostDragonist 92cdf41243 Update Skyrim theme by chintsu_kun to v2.1.0 2018-12-11 20:48:16 -06:00
LostDragonist 789e95ca58 Update VS2015 Themes by chintsu_kun to v2.0.2 2018-12-11 20:47:29 -06:00
LostDragonist 9b9a1f435e Add v1.1 Paper Automata theme by 6788 2018-12-11 20:37:59 -06:00
LostDragonist 7f82ffa664 Add v4.3 Paper Light and Paper Dark themes by 6788 2018-12-11 20:37:36 -06:00
LostDragonist 68a1afed49 Implement separator text color in a way that doesn't break everything else 2018-12-11 20:31:17 -06:00
LostDragonist 7b1ece5f28 Further extend the version field to 32 characters 2018-12-11 18:31:09 -06:00
LostDragonist 2306e006dc Remove the requirement for a game launcher to be present 2018-12-11 15:45:29 -06:00
LostDragonist f6cd53e932 Change color of separator text based on the configured color of the separator 2018-12-11 15:24:25 -06:00
LostDragonist 5335188e63 Add option to remove column colors for mod list separators 2018-12-11 14:47:50 -06:00
LostDragonist dac716bb86 Allow tool plugins to define a submenu with the display name
Setting the display name to "<submenu>/<displayname>" will group plugins under the submenu.
2018-12-11 14:15:37 -06:00
Al12rs c486220d20 Updated translations and removed an excessive separator from previous commit. 2018-12-11 16:33:39 +01:00
Al12rs 0af33ccddf Added "Open Origin in Explorer" and "Open Origin Info..." options to ESPList context menu. 2018-12-11 16:26:41 +01:00
Al12rs 413c045383 * Fixed order of data tab to be Folders first.
* Remember expanded folders across refreshes.
2018-12-11 14:57:03 +01:00
LostDragonist 1266e13921 Add the ability to change the managed game directory 2018-12-11 01:52:53 -06:00
LostDragonist f4af3264f0 Sort tools menu to provide consistent results 2018-12-11 00:25:18 -06:00
Al12rs f61236e4cf Added UI locking while loadbar is active (for refresh of modlist). 2018-12-10 20:53:45 +01:00
LostDragonist d7e6fd1dd6 Don't disable ESMs when disabling mods if alternatives are available 2018-12-08 20:23:45 -06:00
LostDragonist 9d9dbd9f7e Add shortcut to select name filters on mod list and plugin list 2018-12-08 14:46:42 -06:00
LostDragonist 93763a9364 Add workaround setting to prevent the GUI from locking when running an executable 2018-12-08 11:15:16 -06:00
LostDragonist a94977988b Move the mod info separator flag to the end as it's hidden 2018-12-08 10:44:46 -06:00
LostDragonist c501b5cca0 Add notes column to mod list 2018-12-08 10:44:46 -06:00
Al12rs c87d97de8c Added missing games to the suggested names list.
Imroved dialog description.
2018-12-08 15:01:01 +01:00
LostDragonist 4914fd172d Add workarounds button to reset window geometries 2018-12-08 01:19:37 -06:00
LostDragonist 02fe0d3384 Improve refresh of data when changing profile settings 2018-12-07 23:44:31 -06:00
LostDragonist e76891b926 Update translation file 2018-12-06 03:06:46 -06:00
LostDragonist b53be165fd Savagemes -> Savegames 2018-12-06 02:59:41 -06:00
LostDragonist 849d00521a Transition profile settings to settings.ini 2018-12-05 19:17:16 -06:00
Al12rs deb3c5ca21 Fixed tooltip and "What's this" to better explain INI options. 2018-12-05 22:57:52 +01:00
Al12rs 25448ef076 * Changed "Local game settings" to "Use profile-specific Game INI files".
* Added tooltip to the option explaining what it does since it was missing.
* Improved Local Savegames text and tooltip as well.
2018-12-05 22:50:03 +01:00
LostDragonist 40919c1520 Create empty mods above the selected mod 2018-12-04 18:08:39 -06:00
LostDragonist 79c451bb17 Improvements to "send to separator..." dialog
* Scale contents with dialog size
* Save and restore dialog geometry
* Add a better window title
2018-12-03 06:04:16 -06:00
LostDragonist 87292ca30f Add filter to "send to separator..." dialog 2018-12-02 22:07:58 -06:00
LostDragonist c0b55690bc Add "send to separator..." option for mods 2018-12-02 20:26:26 -06:00
Al12rs f1384cdfa7 Fixed context menu for Data tab showing the File version for empty folders. 2018-12-02 12:48:16 +01:00
Al12rs c9658e1a65 * Added Folders and Files icons to Data tab.
* Fixed empty folders not showing up in Data tab.
2018-12-01 23:23:28 +01:00
LostDragonist 9431597e66 Correct comparison logic for blacklist warning 2018-11-29 15:33:47 -06:00
LostDragonist 4566b51093 Set general settings tab as the default again 2018-11-29 15:23:25 -06:00
LostDragonist 2212ad6f1c Add executable blacklisting 2018-11-29 14:11:09 -06:00
LostDragonist 6142872620 Prevent the user from renaming unmanaged and DLC mods 2018-11-26 07:51:45 -06:00
LostDragonist 4cae1397e7 Prevent the user from setting a negative mod priority 2018-11-26 07:44:26 -06:00
LostDragonist 7fbfc12118 Sort the plugin list 2018-11-26 07:23:11 -06:00
LostDragonist 4eaa0d16bb Resize plugin settings to make keys visible 2018-11-26 07:23:03 -06:00
LostDragonist a219d03444 Add cancel button to "Start Steam?" dialog to not start binary 2018-11-26 03:13:33 -06:00
LostDragonist ad01e1d608 Less strict implementation of path normalization 2018-11-10 22:04:12 -06:00
LostDragonist aaa1523db9 Normalize path settings to prevent extra characters 2018-11-10 16:24:45 -06:00
LostDragonist effd05df06 Tweak text color selection to prevent white text on bright green background 2018-11-09 19:05:06 -06:00
LostDragonist 545b7b4eb7 Fix button colors in the settings dialog with the default theme 2018-11-09 18:14:01 -06:00
Al12rs 71830a65d4 Added three new Transparent Styles by Gernash:
Transparent Style 101 Green
Transparent Style BOS
Transparent Style Skyrim
2018-11-09 21:50:46 +01:00
Al12rs bde2e5fca1 Improved Skyrim.qss theme performance. 2018-11-09 17:15:04 +01:00
Al12rs 15bbfdfa6f Added Nigh Eyes theme by ciathyza. 2018-11-08 20:41:40 +01:00
LostDragonist a85a6e635e Update translation file 2018-11-06 19:00:06 -06:00
LostDragonist 9abb3ca162 Prevent user from clicking the run button more than once 2018-11-05 21:43:50 -06:00
LostDragonist 5588b8b756 Change "mods" to "plugins" in "send to priority..." option for plugins 2018-11-04 13:47:39 -06:00
LostDragonist d48392c89f Don't change priority of new separators when not sorting by priority 2018-11-04 13:45:42 -06:00
LostDragonist 21d61e617b Hide "send to" context menu options when not sorting by priority 2018-11-04 13:39:22 -06:00
LostDragonist a48a20f13f Add context menu option to send to a specific priority 2018-11-04 13:10:41 -06:00
LostDragonist 2e09e633bd Fix creating separators when right-clicking overwrite 2018-11-04 12:33:37 -06:00
Al12rs 1189b8cc33 Made the "checked" filter show separators. 2018-11-04 16:19:54 +01:00
LostDragonist 17f1cf0aab Allow switching instances when MO is launched with moshortcut://<instance>: 2018-11-02 21:02:30 -05:00
Al12rs 78cd0110d3 Updated Skyrim and VS15 theme to fix highlighting on ESPlist. 2018-11-02 19:29:50 +01:00
LostDragonist 2c57899cf6 Fix matching highlights for mod and plugin selections
The selectionChanged event used before requires subtractive/additive logic to work correctly.  A separate event is fired for each row and each column for each row that is selected or deselected.  The previous logic assumed all of the selection was passed in at once.

The logic has been changed to recalculate all highlights each time the event is fired.  This is poorly optimized in regards to performance but makes the function work.
2018-11-01 17:58:49 -05:00
LostDragonist 3dbfba91e1 Add separators according to context location of context menu 2018-11-01 16:55:58 -05:00
Al12rs 2c53f9d934 Cleaned up leftover from color customizzation. 2018-11-01 16:35:02 +01:00
Al12rs 6323a348da Fixed missing category selection for separators. 2018-11-01 16:29:38 +01:00
Al12rs 73842ee245 Added ability to change color of conflict and plugin highlighting from the settings. 2018-11-01 16:20:53 +01:00
LostDragonist 122744454c Improve changing mod and plugin priorities 2018-11-01 06:40:55 -05:00
LostDragonist 5de173ba1a Add send to top/bottom options for the plugin list 2018-10-31 17:05:05 -05:00
LostDragonist eb26120332 Add send to top/bottom options for the mod list 2018-10-31 14:53:24 -05:00
LostDragonist 6056202ead Fix crash when 7-zip fails to extract a file
A thread is spun off to handle the extraction while the main thread handles the progress bar updates.  Previously, a dialog was spawned in the thread when an error in 7-zip occurred.  Now, the thread will terminate and pass the error message back to the main thread who will spawn the dialog.
2018-10-31 00:52:32 -05:00
LostDragonist c1d90b131b Add modinfoseparator to CMakeLists.txt 2018-10-30 21:38:16 -05:00
Al12rs 63a66c8754 Added VS2015 and Skyrim Stylesheets, courtesy of chintsu! 2018-10-28 19:11:44 +01:00
Al12rs ab95f78689 Added Reset color option for separators and changed the bahavior of "cancel" of the color selector dialog to keep previous color. 2018-10-28 17:27:34 +01:00
Al12rs 9e66799abf Fixed Separators not getting deleted while deleting multiple selected items. 2018-10-28 16:15:27 +01:00
Al12rs dce6507dad Added Color costumization for Separators. 2018-10-28 15:04:50 +01:00
Al12rs 42d2344f0b Added modlist Separators feature:
*New modType separator.
*Bold, italic and centralized name without _separator at the end.
*Added "create separator" option to context menu.
*Added "rename separator" option.
*Fixed rename separator issue with priority resetting.
2018-10-28 02:16:20 +02:00
Al12rs 18e49b71b5 Added uniformRowHeight = true property to the modlist, data tab, filters view and Log area. It should make Qt perform better when showing a large number of items. 2018-10-27 18:37:51 +02:00
Al12rs fcb29afe83 Increase filterview size to not cut off filternames 2018-10-13 14:44:16 +02:00
Al12rs cf52aa335a Fix Creator setting Boss button to invisible each time 2018-10-13 11:47:10 +02:00
Al12rs 9c35443780 Fixed UI file to not break each time it's opened in creator. 2018-10-13 10:42:12 +02:00
Silarn 9c6c01df56 Update path to gamebryo/creation engine sources 2018-10-01 00:14:03 -05:00
LostDragonist b83807e4d5 Set the web viewer widget in the mod info dialog to expand vertically 2018-09-30 16:04:28 -05:00
LostDragonist 2d50b17243 Fix pointer truncation to remove warning 2018-09-30 16:03:28 -05:00
LostDragonist 5a1d4e8783 Rename spacer to get remove warning 2018-09-30 16:03:27 -05:00
Al 478aeeb28c Merge pull request #536 from AnyOldName3/patch-1
Add link to upcoming FNISTool repo
2018-09-30 12:27:27 +02:00
Al 07fc9d3546 Merge pull request #537 from AnyOldName3/patch-2
Add link to Skyrim VR repo
2018-09-30 12:27:14 +02:00
Al12rs 15ab8d5c5e Changed "ignore missing game data" to not create an empty Texture folder and instead save the choice in meta.ini 2018-09-29 15:07:24 +02:00
Al12rs 192f14b001 Updated translations file 2018-09-29 12:10:41 +02:00
Al12rs 3ccceb19e1 Added .editorconfig to main repo to help keep some consistency of whitespace. 2018-09-29 09:38:03 +02:00
AnyOldName3 2d9a2a0432 Add link to Skyrim VR repo 2018-09-26 16:40:57 +01:00
AnyOldName3 ac650ae078 Add link to upcoming FNISTool repo
DO NOT MERGE UNTIL https://github.com/ModOrganizer2/modorganizer-umbrella/pull/31 IS HANDLED
2018-09-26 16:16:43 +01:00
LostDragonist 1a91174757 Merge pull request #534 from Gaerzi/patch-1
Extend version field to 12 characters
2018-09-25 14:28:46 -05:00
Gaerzi e2ec6632ec Extend version field to 12 characters
This is needed because some mods out there have version strings longer than 10 characters. For example, the current version string of [SSE Engine Fixes (skse64 plugin)](https://www.nexusmods.com/skyrimspecialedition/mods/17230) is "2.12.1.5.50" -- 11 characters in total.

12 should hopefully be enough.
2018-09-25 17:37:24 +02:00
LostDragonist b1a3bdd6e8 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.
2018-09-17 00:01:12 -05:00
Al12rs 22a004be2e Reverted default setting tab to General 2018-09-15 19:18:29 +02:00
Al12rs a3cb400152 Store and load major dialogs geometry information. 2018-09-15 14:12:24 +02:00
Silarn 3e29d31231 Allow installs to pass Mod ID through (fixes NCC installs losing ID) 2018-09-09 04:12:23 -05:00
Al edf48bca6f Update readme.md 2018-09-08 13:08:06 +02:00
Al12rs 33e11e2056 Added debug line to check actual processed parameters passed to CreateProcessHooked() to see if we can discover somethig more on Parameter is incorrect error. 2018-09-08 12:32:45 +02:00
Al12rs 67fb7e56d3 Add option to create a Mod backup from the modlist context menu. 2018-09-07 22:04:03 +02:00
Al12rs 979206228d Added Mod Backups filter for modlist. 2018-09-07 20:53:42 +02:00
Al12rs ba162804cd Added Contains Script Extender Files filter. 2018-09-07 20:19:20 +02:00
Al12rs c6751b690a Improved Skript Extender Plugin filter to actually look for plugins and not only the SKSE folder. 2018-09-07 18:56:28 +02:00
Al12rs 138154aca0 Added "Refresh" button to downloads tab. 2018-08-31 22:16:13 +02:00
LostDragonist c576f1ff40 Refresh save game list when local game settings may have changed 2018-08-26 18:39:30 -05:00
Al12rs c4636d891f Added ModGroups contents icon and flag. 2018-08-25 14:30:27 +02:00
LostDragonist 8ea8444dc8 Update the version to 2.1.6 2018-08-24 19:50:46 -05:00
Brian Munro 2232bdfc77 Merge pull request #497 from Modorganizer2/Develop
Fix possible crash during write to disk error
2018-08-22 06:38:34 +02:00
LostDragonist 258bddb6b7 Fix possible crash during write to disk error 2018-08-21 15:59:22 -05:00
Brian Munro 364289db72 Merge pull request #495 from Modorganizer2/Develop
Release 2.1.5
2018-08-21 12:23:47 +02:00
LostDragonist ef771fd8ca Fix disabled menu item styling in Paper Dark theme 2018-08-20 00:55:18 -05:00
LostDragonist 2060df1585 Detect errors when writing downloads to disk and cancel download 2018-08-19 16:33:34 -05:00
LostDragonist 9a973ccf5f Center profile deletion dialog on parent 2018-08-19 13:02:54 -05:00
LostDragonist a2eb3e0266 Prevent user from deleting currently active profile 2018-08-19 13:02:30 -05:00
LostDragonist d65031c814 Allow user to cancel VFS mapping 2018-08-16 22:40:17 -05:00
LostDragonist c27e718fbd Add "enable/disable selected" to mod list context menu 2018-08-16 14:32:28 -05:00
LostDragonist 43b2df9077 Add "enable/disable selected" to plugin list context menu 2018-08-16 13:58:44 -05:00
LostDragonist 79b2e52a58 Fix another instance of "Open in Explorer" 2018-08-16 08:35:19 -05:00
LostDragonist 16a7ef78d3 Change version to 2.1.5 2018-08-16 08:19:05 -05:00
LostDragonist 74202cc743 Dracula theme: Make disabled widgets darker than enabled widgets
Fix by Kob, author of the Paper themes.
2018-08-16 01:29:01 -05:00
LostDragonist 8f86130759 Correct file category when manually querying info
The Nexus API appears to have been changed back in July 2018 to match what MO was expecting without the conversion.
2018-08-15 11:53:33 -05:00
LostDragonist 17e4ec7b13 Fix selecting the active profile when opening the profiles dialog 2018-08-12 19:59:54 -05:00
LostDragonist 9a426a2474 Revert "Improve robustness of endorsement checks"
This reverts commit fc8a6b358f.
2018-08-12 12:33:22 -05:00
LostDragonist 80594d6e1a Set toolbar widget names later to catch the problems and update widgets 2018-08-12 12:13:47 -05:00
Al12rs 56473e0ec8 Updated "Thanks". 2018-08-07 19:57:23 +02:00
LostDragonist 71988e386c Modify dark and dracula stylesheets to allow text colors on download widgets 2018-08-06 21:40:59 -05:00
LostDragonist 5e7c0fddf0 Update Paper themes by 6788-00 to version 3.0.1 2018-08-06 21:37:05 -05:00
Al12rs b0c15c9cfb Added Open File option to downloads tab. 2018-08-06 20:17:57 +02:00
Al12rs f92027bea6 Merge PR 2018-08-06 19:54:45 +02:00
Al a31b5495b8 Merge pull request #469 from Freso/minor-fixups
A couple of minor fixes
2018-08-06 16:13:18 +02:00
Frederik “Freso” S. Olesen fc19486f53 Fix capitalisation of "Explorer"
1. Explorer is a specific program, so it should be treated as a proper
   noun, and thus capitalised.
2. Other menu items in the same menu are Title Cases, so it looks out of
   place that this item is not.
2018-08-06 15:17:23 +02:00
Frederik “Freso” S. Olesen 232bbfb23b Fix DownloadManager::openInDownloadsFolder error message 2018-08-06 13:23:28 +02:00
Frederik “Freso” S. Olesen 2af99f2170 Clean up DownloadManager::openFile 2018-08-06 13:21:08 +02:00
Frederik “Freso” S. Olesen 796224d733 Add new "Open File" right-click dialog for Downloads
This enables the user to directly open the downloaded archived/file
which can be useful for e.g., inspection of what's inside or if they
need to copy files from inside the archive to somewhere else. Saves a
step compared to "Show in Folder" and then opening the file.
2018-08-06 12:21:02 +02:00
LostDragonist 1e4b5d2436 Set the names of the toolbar widgets to allow styling
QToolButton#foo where foo is one of:
  actionChange_Game
  actionInstallMod
  actionNexus
  actionAdd_Profile
  actionModify_Executables
  actionTool
  actionSettings
  seperator
  actionEndorseMO
  actionProblems
  actionUpdate
  actionHelp
2018-08-05 15:56:39 -05:00
LostDragonist 94ef8dffbc List load order backups from most recent to oldest 2018-08-04 22:16:39 -05:00
LePresidente 7b1821a518 Reverted bad commit, should of removed VS_FF_PRERELEASE 2018-08-04 11:24:49 +02:00
LePresidente fb0d4d5e5a use VER_FILEVERSION_STR instead of VER_FILEVERSION so pre-alpha is not shown 2018-08-04 10:35:56 +02:00
297 changed files with 23640 additions and 3687 deletions
+16
View File
@@ -0,0 +1,16 @@
root = true
[*.cpp]
indent_style = space
indent_size = 2
insert_final_newline = true
[*.h]
indent_style = space
indent_size = 2
insert_final_newline = true
[*.ui]
indent_style = space
indent_size = 2
insert_final_newline = true
+3 -1
View File
@@ -20,7 +20,7 @@ Through the work of a few people of the community MO2 has come quite far, now it
## Reporting Issues:
Issues should be reported to the GitHub page or on the open discord server: [ModOrganizerDevs](https://discord.gg/vD2ZbfX). Here is also where dev builds are tested, bugs are reported and investigated, suggestions are discussed and a lot more.
Credits to Tannin, LePresidente, Silarn, erasmux, AL12 and many others for the development.
Credits to Tannin, LePresidente, Silarn, erasmux, AL12, LostDragonist, AnyOldName3 and many others for the development.
## Download Location
@@ -49,6 +49,7 @@ Here is a complete list:
* https://github.com/Modorganizer2/modorganizer-check_fnis
* https://github.com/Modorganizer2/modorganizer-diagnose_basic
* https://github.com/Modorganizer2/modorganizer-esptk
* https://github.com/ModOrganizer2/modorganizer-fnistool
* https://github.com/Modorganizer2/modorganizer-helper
* https://github.com/Modorganizer2/modorganizer-game_fallout3
* https://github.com/Modorganizer2/modorganizer-game_fallout4
@@ -60,6 +61,7 @@ Here is a complete list:
* https://github.com/Modorganizer2/modorganizer-game_oblivion
* https://github.com/Modorganizer2/modorganizer-game_skyrim
* https://github.com/Modorganizer2/modorganizer-game_skyrimSE
* https://github.com/ModOrganizer2/modorganizer-game_skyrimVR
* https://github.com/Modorganizer2/modorganizer-game_ttw
* https://github.com/Modorganizer2/modorganizer-installer_bain
* https://github.com/Modorganizer2/modorganizer-installer_bundle
+7 -1
View File
@@ -37,6 +37,7 @@ SET(organizer_SRCS
modinfoforeign.cpp
modinfooverwrite.cpp
modinforegular.cpp
modinfoseparator.cpp
modinfowithconflictinfo.cpp
messagedialog.cpp
mainwindow.cpp
@@ -90,6 +91,7 @@ SET(organizer_SRCS
usvfsconnector.cpp
eventfilter.cpp
moshortcut.cpp
listdialog.cpp
shared/windows_error.cpp
shared/error_report.cpp
@@ -128,6 +130,7 @@ SET(organizer_HDRS
modinfoforeign.h
modinfooverwrite.h
modinforegular.h
modinfoseparator.h
modinfowithconflictinfo.h
messagedialog.h
mainwindow.h
@@ -183,6 +186,7 @@ SET(organizer_HDRS
eventfilter.h
descriptionpage.h
moshortcut.h
listdialog.h
shared/windows_error.h
shared/error_report.h
@@ -223,6 +227,7 @@ SET(organizer_UIS
previewdialog.ui
browserdialog.ui
aboutdialog.ui
listdialog.ui
)
SET(organizer_QRCS
@@ -288,7 +293,8 @@ INCLUDE_DIRECTORIES(${project_path}/uibase/src
${project_path}/esptk/src
${project_path}/archive/src
${project_path}/../usvfs/include
${project_path}/game_gamebryo/src
${project_path}/game_gamebryo/src/gamebryo
${project_path}/game_gamebryo/src/creation
${project_path}/game_features/src
${project_path}/githubpp/src
${LZ4_ROOT}/include)
+6 -1
View File
@@ -189,6 +189,11 @@
<property name="text">
<string notr="true">Silarn</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">LostDragonist</string>
</property>
</item>
</widget>
</item>
@@ -208,7 +213,7 @@
</property>
<item>
<property name="text">
<string notr="true">AnyOldName3 (Python Plugins)</string>
<string notr="true">AnyOldName3</string>
</property>
</item>
</widget>
+4 -2
View File
@@ -47,8 +47,10 @@ public:
static const int CATEGORY_SPECIAL_NOCATEGORY = 10003;
static const int CATEGORY_SPECIAL_CONFLICT = 10004;
static const int CATEGORY_SPECIAL_NOTENDORSED = 10005;
static const int CATEGORY_SPECIAL_MANAGED = 10006;
static const int CATEGORY_SPECIAL_UNMANAGED = 10007;
static const int CATEGORY_SPECIAL_BACKUP = 10006;
static const int CATEGORY_SPECIAL_MANAGED = 10007;
static const int CATEGORY_SPECIAL_UNMANAGED = 10008;
public:
+6
View File
@@ -272,6 +272,11 @@ void DownloadListWidgetDelegate::issueVisitOnNexus()
emit visitOnNexus(m_ContextRow);
}
void DownloadListWidgetDelegate::issueOpenFile()
{
emit openFile(m_ContextRow);
}
void DownloadListWidgetDelegate::issueOpenInDownloadsFolder()
{
emit openInDownloadsFolder(m_ContextRow);
@@ -375,6 +380,7 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
menu.addAction(tr("Visit on Nexus"), this,SLOT(issueVisitOnNexus()));
}
menu.addAction(tr("Open File"), this, SLOT(issueOpenFile()));
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
menu.addSeparator();
+2
View File
@@ -72,6 +72,7 @@ signals:
void pauseDownload(int index);
void resumeDownload(int index);
void visitOnNexus(int index);
void openFile(int index);
void openInDownloadsFolder(int index);
protected:
@@ -93,6 +94,7 @@ private slots:
void issueRestoreToView();
void issueRestoreToViewAll();
void issueVisitOnNexus();
void issueOpenFile();
void issueOpenInDownloadsFolder();
void issueCancel();
void issuePause();
+6
View File
@@ -247,6 +247,11 @@ void DownloadListWidgetCompactDelegate::issueVisitOnNexus()
emit visitOnNexus(m_ContextIndex.row());
}
void DownloadListWidgetCompactDelegate::issueOpenFile()
{
emit openFile(m_ContextIndex.row());
}
void DownloadListWidgetCompactDelegate::issueOpenInDownloadsFolder()
{
emit openInDownloadsFolder(m_ContextIndex.row());
@@ -361,6 +366,7 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
}else {
menu.addAction(tr("Visit on Nexus"), this, SLOT(issueVisitOnNexus()));
}
menu.addAction(tr("Open File"), this, SLOT(issueOpenFile()));
menu.addAction(tr("Show in Folder"), this, SLOT(issueOpenInDownloadsFolder()));
menu.addSeparator();
menu.addAction(tr("Delete"), this, SLOT(issueDelete()));
+2
View File
@@ -70,6 +70,7 @@ signals:
void pauseDownload(int index);
void resumeDownload(int index);
void visitOnNexus(int index);
void openFile(int index);
void openInDownloadsFolder(int index);
protected:
@@ -92,6 +93,7 @@ private slots:
void issueRestoreToView();
void issueRestoreToViewAll();
void issueVisitOnNexus();
void issueOpenFile();
void issueOpenInDownloadsFolder();
void issueCancel();
void issuePause();
+41 -22
View File
@@ -703,7 +703,7 @@ void DownloadManager::removeDownload(int index, bool deleteFile)
DownloadState minState;
if (index == -3) {
minState = STATE_UNINSTALLED;
}
}
else
minState = index == -1 ? STATE_READY : STATE_INSTALLED;
@@ -804,8 +804,10 @@ void DownloadManager::resumeDownloadInt(int index)
if (info->isPausedState() || info->m_State == STATE_PAUSING) {
if (info->m_State == STATE_PAUSING) {
if (info->m_Output.isOpen()) {
info->m_Output.write(info->m_Reply->readAll());
setState(info, STATE_PAUSED);
writeData(info);
if (info->m_State == STATE_PAUSING) {
setState(info, STATE_PAUSED);
}
}
}
if ((info->m_Urls.size() == 0)
@@ -927,10 +929,27 @@ void DownloadManager::visitOnNexus(int index)
}
}
void DownloadManager::openFile(int index)
{
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
reportError(tr("OpenFile: invalid download index %1").arg(index));
return;
}
QDir path = QDir(m_OutputDirectory);
if (path.exists(getFileName(index))) {
::ShellExecuteW(nullptr, L"open", ToWString(QDir::toNativeSeparators(getFilePath(index))).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
return;
}
::ShellExecuteW(nullptr, L"explore", ToWString(QDir::toNativeSeparators(m_OutputDirectory)).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
return;
}
void DownloadManager::openInDownloadsFolder(int index)
{
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
reportError(tr("VisitNexus: invalid download index %1").arg(index));
reportError(tr("OpenFileInDownloadsFolder: invalid download index %1").arg(index));
return;
}
QString params = "/select,\"";
@@ -1345,10 +1364,7 @@ void DownloadManager::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
void DownloadManager::downloadReadyRead()
{
try {
DownloadInfo *info = findDownload(this->sender());
if (info != nullptr) {
info->m_Output.write(info->m_Reply->readAll());
}
writeData(findDownload(this->sender()));
} catch (const std::bad_alloc&) {
reportError(tr("Memory allocation error (in processing downloaded data)."));
}
@@ -1428,18 +1444,6 @@ QDateTime DownloadManager::matchDate(const QString &timeString)
}
static EFileCategory convertFileCategory(int id)
{
// TODO: need to handle file categories in the mod page plugin
switch (id) {
case 0: return TYPE_MAIN;
case 1: return TYPE_UPDATE;
case 2: return TYPE_OPTION;
default: return TYPE_MAIN;
}
}
void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVariant resultData, int requestID)
{
std::set<int>::iterator idIter = m_RequestIDs.find(requestID);
@@ -1476,7 +1480,7 @@ void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVarian
if (!info->m_FileInfo->version.isValid()) {
info->m_FileInfo->version = info->m_FileInfo->newestVersion;
}
info->m_FileInfo->fileCategory = convertFileCategory(fileInfo["category_id"].toInt());
info->m_FileInfo->fileCategory = fileInfo["category_id"].toInt();
info->m_FileInfo->fileTime = matchDate(fileInfo["date"].toString());
info->m_FileInfo->fileID = fileInfo["id"].toInt();
info->m_FileInfo->fileName = fileInfo["uri"].toString();
@@ -1501,7 +1505,7 @@ void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVarian
QVariantMap fileInfo = selection.getChoiceData().toMap();
info->m_FileInfo->name = fileInfo["name"].toString();
info->m_FileInfo->version.parse(fileInfo["version"].toString());
info->m_FileInfo->fileCategory = convertFileCategory(fileInfo["category_id"].toInt());
info->m_FileInfo->fileCategory = fileInfo["category_id"].toInt();
info->m_FileInfo->fileID = fileInfo["id"].toInt();
} else {
emit showMessage(tr("No matching file found on Nexus! Maybe this file is no longer available or it was renamed?"));
@@ -1835,3 +1839,18 @@ void DownloadManager::checkDownloadTimeout()
}
}
}
void DownloadManager::writeData(DownloadInfo *info)
{
if (info != nullptr) {
qint64 ret = info->m_Output.write(info->m_Reply->readAll());
if (ret < info->m_Reply->size()) {
QString fileName = info->m_FileName; // m_FileName may be destroyed after setState
setState(info, DownloadState::STATE_CANCELED);
qCritical(QString("Unable to write download \"%2\" to drive (return %1)").arg(ret).arg(info->m_FileName).toLocal8Bit());
reportError(tr("Unable to write download to drive (return %1).\n"
"Check the drive's available storage.\n\n"
"Canceling download \"%2\"...").arg(ret).arg(fileName));
}
}
}
+4
View File
@@ -445,6 +445,8 @@ public slots:
void visitOnNexus(int index);
void openFile(int index);
void openInDownloadsFolder(int index);
void nxmDescriptionAvailable(QString gameName, int modID, QVariant userData, QVariant resultData, int requestID);
@@ -522,6 +524,8 @@ private:
static QString getFileTypeString(int fileType);
void writeData(DownloadInfo *info);
private:
static const int AUTOMATIC_RETRIES = 3;
File diff suppressed because it is too large Load Diff
+227 -224
View File
@@ -1,224 +1,227 @@
/*
Copyright (C) 2012 Sebastian Herbord. All rights reserved.
This file is part of Mod Organizer.
Mod Organizer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mod Organizer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INSTALLATIONMANAGER_H
#define INSTALLATIONMANAGER_H
#include <iinstallationmanager.h>
#include <iplugininstaller.h>
#include <guessedvalue.h>
#include <QObject>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <archive.h>
#include <QProgressDialog>
#include <set>
#include <errorcodes.h>
/**
* @brief manages the installation of mod archives
* This currently supports two special kind of archives:
* - "simple" archives: properly packaged archives without options, so they can be extracted to the (virtual) data directory directly
* - "complex" bain archives: archives with options for the bain system.
* All other archives are managed through the manual "InstallDialog"
* @todo this may be a good place to support plugins
**/
class InstallationManager : public QObject, public MOBase::IInstallationManager
{
Q_OBJECT
public:
/**
* @brief constructor
*
* @param parent parent object.
**/
explicit InstallationManager();
virtual ~InstallationManager();
void setParentWidget(QWidget *widget);
void setURL(const QString &url);
/**
* @brief update the directory where mods are to be installed
* @param modsDirectory the mod directory
* @note this is called a lot, probably redundantly
*/
void setModsDirectory(const QString &modsDirectory) { m_ModsDirectory = modsDirectory; }
/**
* @brief update the directory where downloads are stored
* @param downloadDirectory the download directory
*/
void setDownloadDirectory(const QString &downloadDirectory) { m_DownloadsDirectory = downloadDirectory; }
/**
* @brief install a mod from an archive
*
* @param fileName absolute file name of the archive to install
* @param modName suggested name of the mod. If this is empty (the default), a name will be guessed based on the filename. The user will always have a chance to rename the mod
* @return true if the archive was installed, false if installation failed or was refused
* @exception std::exception an exception may be thrown if the archive can't be opened (maybe the format is invalid or the file is damaged)
**/
bool install(const QString &fileName, MOBase::GuessedValue<QString> &modName, bool &hasIniTweaks);
/**
* @return true if the installation was canceled
**/
bool wasCancelled();
/**
* @brief retrieve a string describing the specified error code
*
* @param errorCode an error code as returned by the archiving function
* @return the error string
* @todo This function doesn't belong here, it is only public because the SelfUpdater class also uses "Archive" to get to the package.txt file
**/
static QString getErrorString(Archive::Error errorCode);
/**
* @brief register an installer-plugin
* @param the installer to register
*/
void registerInstaller(MOBase::IPluginInstaller *installer);
/**
* @return list of file extensions we can install
*/
QStringList getSupportedExtensions() const;
/**
* @brief extract the specified file from the currently open archive to a temporary location
* @param (relative) name of the file within the archive
* @return the absolute name of the temporary file
* @note the call will fail with an exception if no archive is open (plugins deriving
* from IPluginInstallerSimple can rely on that, custom installers shouldn't)
* @note the temporary file is automatically cleaned up after the installation
* @note This call can be very slow if the archive is large and "solid"
*/
virtual QString extractFile(const QString &fileName);
/**
* @brief extract the specified files from the currently open archive to a temporary location
* @param (relative) names of files within the archive
* @return the absolute names of the temporary files
* @note the call will fail with an exception if no archive is open (plugins deriving
* from IPluginInstallerSimple can rely on that, custom installers shouldn't)
* @note the temporary file is automatically cleaned up after the installation
* @note This call can be very slow if the archive is large and "solid"
*/
virtual QStringList extractFiles(const QStringList &files, bool flatten);
/**
* @brief installs an archive
* @param modName suggested name of the mod
* @param archiveFile path to the archive to install
* @return the installation result
*/
virtual MOBase::IPluginInstaller::EInstallResult installArchive(MOBase::GuessedValue<QString> &modName, const QString &archiveName);
/**
* @brief test if the specified mod name is free. If not, query the user how to proceed
* @param modName current possible names for the mod
* @param merge if this value is not null, the value will be set to whether the use chose to merge or replace
* @return true if we can proceed with the installation, false if the user canceled or in case of an unrecoverable error
*/
virtual bool testOverwrite(MOBase::GuessedValue<QString> &modName, bool *merge = nullptr) const;
private:
void queryPassword(QString *password);
void updateProgress(float percentage);
void updateProgressFile(const QString &fileName);
void report7ZipError(const QString &errorMessage);
MOBase::DirectoryTree *createFilesTree();
// remap all files in the archive to the directory structure represented by baseNode
// files not present in baseNode are disabled
void mapToArchive(const MOBase::DirectoryTree::Node *baseNode);
// recursive worker function for mapToArchive
void mapToArchive(const MOBase::DirectoryTree::Node *node, QString path, FileData * const *data);
bool unpackSingleFile(const QString &fileName);
bool isSimpleArchiveTopLayer(const MOBase::DirectoryTree::Node *node, bool bainStyle);
MOBase::DirectoryTree::Node *getSimpleArchiveBase(MOBase::DirectoryTree *dataTree);
bool doInstall(MOBase::GuessedValue<QString> &modName, QString gameName,
int modID, const QString &version, const QString &newestVersion, int categoryID, const QString &repository);
QString generateBackupName(const QString &directoryName) const;
bool ensureValidModName(MOBase::GuessedValue<QString> &name) const;
void postInstallCleanup();
signals:
void progressUpdate(float percentage);
void progressUpdate(QString const fileName);
private:
struct ByPriority {
bool operator()(MOBase::IPluginInstaller *LHS, MOBase::IPluginInstaller *RHS) const
{
return LHS->priority() > RHS->priority();
}
};
struct CaseInsensitive {
bool operator() (const QString &LHS, const QString &RHS) const
{
return QString::compare(LHS, RHS, Qt::CaseInsensitive) < 0;
}
};
private:
QWidget *m_ParentWidget;
QString m_ModsDirectory;
QString m_DownloadsDirectory;
std::vector<MOBase::IPluginInstaller*> m_Installers;
std::set<QString, CaseInsensitive> m_SupportedExtensions;
Archive *m_ArchiveHandler;
QString m_CurrentFile;
QProgressDialog *m_InstallationProgress { nullptr };
int m_Progress;
QString m_ProgressFile;
std::set<QString> m_TempFilesToDelete;
QString m_URL;
};
#endif // INSTALLATIONMANAGER_H
/*
Copyright (C) 2012 Sebastian Herbord. All rights reserved.
This file is part of Mod Organizer.
Mod Organizer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mod Organizer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INSTALLATIONMANAGER_H
#define INSTALLATIONMANAGER_H
#include <iinstallationmanager.h>
#include <iplugininstaller.h>
#include <guessedvalue.h>
#include <QObject>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <archive.h>
#include <QProgressDialog>
#include <set>
#include <errorcodes.h>
/**
* @brief manages the installation of mod archives
* This currently supports two special kind of archives:
* - "simple" archives: properly packaged archives without options, so they can be extracted to the (virtual) data directory directly
* - "complex" bain archives: archives with options for the bain system.
* All other archives are managed through the manual "InstallDialog"
* @todo this may be a good place to support plugins
**/
class InstallationManager : public QObject, public MOBase::IInstallationManager
{
Q_OBJECT
public:
/**
* @brief constructor
*
* @param parent parent object.
**/
explicit InstallationManager();
virtual ~InstallationManager();
void setParentWidget(QWidget *widget);
void setURL(const QString &url);
/**
* @brief update the directory where mods are to be installed
* @param modsDirectory the mod directory
* @note this is called a lot, probably redundantly
*/
void setModsDirectory(const QString &modsDirectory) { m_ModsDirectory = modsDirectory; }
/**
* @brief update the directory where downloads are stored
* @param downloadDirectory the download directory
*/
void setDownloadDirectory(const QString &downloadDirectory) { m_DownloadsDirectory = downloadDirectory; }
/**
* @brief install a mod from an archive
*
* @param fileName absolute file name of the archive to install
* @param modName suggested name of the mod. If this is empty (the default), a name will be guessed based on the filename. The user will always have a chance to rename the mod
* @return true if the archive was installed, false if installation failed or was refused
* @exception std::exception an exception may be thrown if the archive can't be opened (maybe the format is invalid or the file is damaged)
**/
bool install(const QString &fileName, MOBase::GuessedValue<QString> &modName, bool &hasIniTweaks, int modID = 0);
/**
* @return true if the installation was canceled
**/
bool wasCancelled();
/**
* @brief retrieve a string describing the specified error code
*
* @param errorCode an error code as returned by the archiving function
* @return the error string
* @todo This function doesn't belong here, it is only public because the SelfUpdater class also uses "Archive" to get to the package.txt file
**/
static QString getErrorString(Archive::Error errorCode);
/**
* @brief register an installer-plugin
* @param the installer to register
*/
void registerInstaller(MOBase::IPluginInstaller *installer);
/**
* @return list of file extensions we can install
*/
QStringList getSupportedExtensions() const;
/**
* @brief extract the specified file from the currently open archive to a temporary location
* @param (relative) name of the file within the archive
* @return the absolute name of the temporary file
* @note the call will fail with an exception if no archive is open (plugins deriving
* from IPluginInstallerSimple can rely on that, custom installers shouldn't)
* @note the temporary file is automatically cleaned up after the installation
* @note This call can be very slow if the archive is large and "solid"
*/
virtual QString extractFile(const QString &fileName);
/**
* @brief extract the specified files from the currently open archive to a temporary location
* @param (relative) names of files within the archive
* @return the absolute names of the temporary files
* @note the call will fail with an exception if no archive is open (plugins deriving
* from IPluginInstallerSimple can rely on that, custom installers shouldn't)
* @note the temporary file is automatically cleaned up after the installation
* @note This call can be very slow if the archive is large and "solid"
*/
virtual QStringList extractFiles(const QStringList &files, bool flatten);
/**
* @brief installs an archive
* @param modName suggested name of the mod
* @param archiveFile path to the archive to install
* @return the installation result
*/
virtual MOBase::IPluginInstaller::EInstallResult installArchive(MOBase::GuessedValue<QString> &modName, const QString &archiveName, const int &modId = 0);
/**
* @brief test if the specified mod name is free. If not, query the user how to proceed
* @param modName current possible names for the mod
* @param merge if this value is not null, the value will be set to whether the use chose to merge or replace
* @return true if we can proceed with the installation, false if the user canceled or in case of an unrecoverable error
*/
virtual bool testOverwrite(MOBase::GuessedValue<QString> &modName, bool *merge = nullptr) const;
QString generateBackupName(const QString &directoryName) const;
private:
void queryPassword(QString *password);
void updateProgress(float percentage);
void updateProgressFile(const QString &fileName);
void report7ZipError(const QString &errorMessage);
MOBase::DirectoryTree *createFilesTree();
// remap all files in the archive to the directory structure represented by baseNode
// files not present in baseNode are disabled
void mapToArchive(const MOBase::DirectoryTree::Node *baseNode);
// recursive worker function for mapToArchive
void mapToArchive(const MOBase::DirectoryTree::Node *node, QString path, FileData * const *data);
bool unpackSingleFile(const QString &fileName);
bool isSimpleArchiveTopLayer(const MOBase::DirectoryTree::Node *node, bool bainStyle);
MOBase::DirectoryTree::Node *getSimpleArchiveBase(MOBase::DirectoryTree *dataTree);
bool doInstall(MOBase::GuessedValue<QString> &modName, QString gameName,
int modID, const QString &version, const QString &newestVersion, int categoryID, const QString &repository);
//QString generateBackupName(const QString &directoryName) const;
bool ensureValidModName(MOBase::GuessedValue<QString> &name) const;
void postInstallCleanup();
signals:
void progressUpdate(float percentage);
void progressUpdate(QString const fileName);
private:
struct ByPriority {
bool operator()(MOBase::IPluginInstaller *LHS, MOBase::IPluginInstaller *RHS) const
{
return LHS->priority() > RHS->priority();
}
};
struct CaseInsensitive {
bool operator() (const QString &LHS, const QString &RHS) const
{
return QString::compare(LHS, RHS, Qt::CaseInsensitive) < 0;
}
};
private:
QWidget *m_ParentWidget;
QString m_ModsDirectory;
QString m_DownloadsDirectory;
std::vector<MOBase::IPluginInstaller*> m_Installers;
std::set<QString, CaseInsensitive> m_SupportedExtensions;
Archive *m_ArchiveHandler;
QString m_CurrentFile;
QString m_ErrorMessage;
QProgressDialog *m_InstallationProgress { nullptr };
int m_Progress;
QString m_ProgressFile;
std::set<QString> m_TempFilesToDelete;
QString m_URL;
};
#endif // INSTALLATIONMANAGER_H
+6 -4
View File
@@ -66,6 +66,7 @@ void InstanceManager::clearCurrentInstance()
{
setCurrentInstance("");
m_Reset = true;
m_overrideInstance = false;
}
void InstanceManager::setCurrentInstance(const QString &name)
@@ -136,12 +137,13 @@ QString InstanceManager::queryInstanceName(const QStringList &instanceList) cons
QInputDialog dialog;
dialog.setWindowTitle(QObject::tr("Enter a Name for the new Instance"));
dialog.setLabelText(QObject::tr("Enter a new name or select one from the suggested list:"));
dialog.setLabelText(QObject::tr("Enter a new name or select one from the suggested list: \n"
"(This is just the name of the Instance, not the game selection)"));
// would be neat if we could take the names from the game plugins but
// the required initialization order requires the ini file to be
// available *before* we load plugins
dialog.setComboBoxItems({ "NewName", "Fallout 4", "SkyrimSE", "Skyrim", "Fallout 3",
"Fallout NV", "FO4VR", "Oblivion" });
dialog.setComboBoxItems({ "NewName", "Fallout 4", "SkyrimSE", "Skyrim", "SkyrimVR", "Fallout 3",
"Fallout NV", "TTW", "FO4VR", "Oblivion", "Morrowind" });
dialog.setComboBoxEditable(true);
if (dialog.exec() == QDialog::Rejected) {
@@ -324,4 +326,4 @@ QString InstanceManager::sanitizeInstanceName(const QString &name) const
return sanitizeInstanceName(new_name);
}
return new_name;
}
}
+4 -1
View File
@@ -8,6 +8,8 @@
#include <ipluginmodpage.h>
#include <delayedfilewriter.h>
#include <QMenu>
class QSettings;
class IUserInterface
@@ -16,7 +18,8 @@ public:
virtual void storeSettings(QSettings &settings) = 0;
virtual void registerPluginTool(MOBase::IPluginTool *tool) = 0;
virtual void registerPluginTool(MOBase::IPluginTool *tool, QString name = QString(), QMenu *menu = nullptr) = 0;
virtual void registerPluginTools(std::vector<MOBase::IPluginTool *> toolPlugins) = 0;
virtual void registerModPage(MOBase::IPluginModPage *modPage) = 0;
virtual void installTranslator(const QString &name) = 0;
+74
View File
@@ -0,0 +1,74 @@
/*
This file is part of Mod Organizer.
Mod Organizer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mod Organizer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "listdialog.h"
#include "ui_listdialog.h"
ListDialog::ListDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::ListDialog)
, m_Choices()
{
ui->setupUi(this);
ui->filterEdit->setFocus();
}
ListDialog::~ListDialog()
{
delete ui;
}
void ListDialog::setChoices(QStringList choices)
{
m_Choices = choices;
ui->choiceList->clear();
ui->choiceList->addItems(m_Choices);
}
QString ListDialog::getChoice() const
{
if (ui->choiceList->selectedItems().length()) {
return ui->choiceList->currentItem()->text();
} else {
return "";
}
}
void ListDialog::on_filterEdit_textChanged(QString filter)
{
QStringList newChoices;
for (auto choice : m_Choices) {
if (choice.contains(filter, Qt::CaseInsensitive)){
newChoices << choice;
}
}
ui->choiceList->clear();
ui->choiceList->addItems(newChoices);
if (newChoices.length() == 1) {
QListWidgetItem *item = ui->choiceList->item(0);
ui->choiceList->setItemSelected(item, true);
ui->choiceList->setCurrentItem(item);
}
if (!filter.isEmpty()) {
ui->choiceList->setStyleSheet("QListWidget { border: 2px ridge #f00; }");
} else {
ui->choiceList->setStyleSheet("");
}
}
+29
View File
@@ -0,0 +1,29 @@
#ifndef LISTDIALOG_H
#define LISTDIALOG_H
#include <QDialog>
namespace Ui {
class ListDialog;
}
class ListDialog : public QDialog
{
Q_OBJECT
public:
explicit ListDialog(QWidget *parent = nullptr);
~ListDialog();
void setChoices(QStringList choices);
QString getChoice() const;
public slots:
void on_filterEdit_textChanged(QString filter);
private:
Ui::ListDialog *ui;
QStringList m_Choices;
};
#endif // LISTDIALOG_H
+103
View File
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ListDialog</class>
<widget class="QDialog" name="ListDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>260</width>
<height>380</height>
</rect>
</property>
<property name="windowTitle">
<string>Select an item...</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="choiceList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>240</width>
<height>280</height>
</size>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
</widget>
</item>
<item>
<widget class="MOBase::LineEditClear" name="filterEdit">
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>Filter</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MOBase::LineEditClear</class>
<extends>QLineEdit</extends>
<header>lineeditclear.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ListDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ListDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+3 -2
View File
@@ -322,7 +322,7 @@ MOBase::IPluginGame *determineCurrentGame(QString const &moPath, QSettings &sett
//The following code would try to determine the right game to mange but it would usually find the wrong one
//so it was commented out.
/*
/*
//OK, we are in a new setup or existing info is useless.
//See if MO has been installed inside a game directory
for (IPluginGame * const game : plugins.plugins<IPluginGame>()) {
@@ -383,7 +383,7 @@ MOBase::IPluginGame *determineCurrentGame(QString const &moPath, QSettings &sett
}
}
reportError(QObject::tr("No game identified in \"%1\". The directory is required to contain "
"the game binary and its launcher.").arg(gamePath));
"the game binary.").arg(gamePath));
}
}
@@ -715,5 +715,6 @@ int main(int argc, char *argv[])
return result;
}
argc = 1;
moshortcut = MOShortcut("");
} while (true);
}
+735 -109
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More