Skip to content

Mod list multi-select - #4386

Merged
HebaruSan merged 5 commits into
KSP-CKAN:masterfrom
HebaruSan:feature/mod-list-multiselect
Jun 4, 2025
Merged

HebaruSan merged 5 commits into
KSP-CKAN:masterfrom
HebaruSan:feature/mod-list-multiselect

Conversation

@HebaruSan

@HebaruSan HebaruSan commented Jun 4, 2025 •

Copy link
Copy Markdown
Member

Motivations

  • Sometimes it would be nice to be able to perform an action for multiple modules at once, e.g., adding or removing labels. Currently the main mod list only allows selecting one row, which means you can only do such things for one module at a time.
  • CKAN stores metadata and settings in JSON files, except for <Game dir>/CKAN/GUIConfig.xml, which uses an XML format. This inconsistency complicates maintenance and support, since different tools need to be used to handle this one file compared to all the others.
  • Use New JSON Config File; Add .NET Standard 2.0 Target to CKAN-core #2820 moved Core configuration from the Windows registry (and Mono's emulation of it in ~/.mono/registry) to config.json in the app data folder, but it intentionally left the old Windows registry data in place in case it was needed. That was 6 years ago, so any such data that still exists probably either has already been converted or is no longer relevant.

Changes

  • Now the main mod list supports multi-select when you hold Ctrl or Shift. When multiple rows are selected:

    • Pressing Space will toggle upgrading or installation for selected rows. This change includes a fix: Space will no longer toggle the auto-installed checkbox, since that was never the intention.
    • The right click menu options support multiple selections:
      • The purge from cache option will purge all selected modules from the cache, and is enabled if any of the selected mods are in the cache.
      • The download option will download all selected modules to the cache, and is enabled if any of the selected mods are not in the cache.
      • The Reinstall option will reinstall all selected installed modules, and is enabled if any of the selected mods are installed and not autodetected.
      • Labels can be added to and removed from all selected rows at once. If some of the selected rows already have a label and others don't, two options appear for that label, one to add the label and one to remove it.

    Fixes [Feature]: Multi-Select mods and change their label all at once #4380.

  • Now GUIConfig.xml is replaced by GUIConfig.json containing the same data in JSON format. The old file will be converted and deleted if it is present without the new file.

  • Now the code to save and load the Core configuration in the Windows registry is deleted, except for a remnant that we now use to delete the old Windows registry data if it exists.

@HebaruSan HebaruSan added Enhancement New features or functionality GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN labels Jun 4, 2025
@HebaruSan
HebaruSan merged commit 7cb113a into KSP-CKAN:master Jun 4, 2025
@HebaruSan
HebaruSan deleted the feature/mod-list-multiselect branch June 4, 2025 02:25
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 15432034930

Details

  • 55 of 170 (32.35%) changed or added relevant lines in 12 files are covered.
  • 59 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.04%) to 30.322%

Changes Missing Coverage Covered Lines Changed/Added Lines %
GUI/Controls/ManageMods.Designer.cs 0 1 0.0%
GUI/Model/ModChange.cs 0 1 0.0%
GUI/Program.cs 0 1 0.0%
Core/Configuration/JsonConfiguration.cs 3 5 60.0%
Core/Configuration/Win32RegistryConfiguration.cs 4 6 66.67%
GUI/Controls/ChooseRecommendedMods.cs 0 2 0.0%
GUI/URLHandlers.cs 0 2 0.0%
GUI/Main/MainDownload.cs 0 8 0.0%
GUI/Model/GUIConfiguration.cs 25 33 75.76%
GUI/Main/Main.cs 0 16 0.0%
Files with Coverage Reduction New Missed Lines %
Core/Configuration/JsonConfiguration.cs 1 57.39%
Core/Configuration/Win32RegistryConfiguration.cs 2 42.11%
GUI/Controls/ManageMods.cs 4 0.0%
GUI/Main/Main.cs 4 0.11%
_build/out/CKAN-GUI/Debug/obj/Debug/net48/Resources.Designer.cs 48 5.88%
Totals Coverage Status
Change from base Build 15339637964: 0.04%
Covered Lines: 13712
Relevant Lines: 44281

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality GUI Issues affecting the interactive GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Multi-Select mods and change their label all at once

2 participants