Skip to content

Conversation

@digant73
Copy link
Contributor

@digant73 digant73 commented Nov 30, 2025

Follow up of #17715 to implement #6008

Added multi-selection context menu. The PR is a follow up of #16038 that re-organized the context menu currently limited to a single game selection.
This PR allows to select multiple games from the game list, by the use of usual Shift, CTRL keys and mouse click, and so to provide a context menu for the selected games by a mouse right-click.
The multiple selection is currently supported by the game list in List Mode (see limitations reported below).

Current limitations:

  • Multi-selection is not supported by Grid Mode, This is simply due to the Qt objects currently used for the Grid Mode. It could probably be easily supported by few changes made by main developers. This task remained out of scope in this PR
    - The selection of multiple games in List Mode is allowed by clicking on the game's icon only (see screenshot). This limitation is probably due to other interfering registered actions that main developers could easily update in further PR to fix this minor limitation Fixed by Qt: Relax game_list deselection checks #17799

NOTES:

  • Unfortunately the PR could not be split in other smaller PRs without compromising the usability or making the code even more (e.g. without providing shared methods such as ValidateRemoval() etc.)
  • The existing batch and non-batch removal methods remained perfectly backward compatible. E.g. for batch removal methods, no game list provided means the entire game list is used
  • Back-End GetContentInfo() method (collecting content info and path size) seems not needing the use of a concurrent thread to collect disk usage as needed in Add an entry on Log panel's contextual menu to show the main disk usa… #17715. The method uses disk size info from game list. The scan for disk usage is limited to auxiliary folders such as Savestates, Captures, Recordings, Screenshots not providing huge number of files that could slowdown the GUI. Eventually, the concurrent thread can be added. I simply considered it an overkill

fixes #6008

Changes log:

  • game_list_frame.cpp:

    • Action remove_game present in single-selection context menu moved to DialogRemoveGame() method in order to make it sharable (so reducing code) with the new multi-selection context menu

    • DialogRemoveGame() method based on:

      • Back-End: BE GetContentInfo() method collects all the info (info text, data paths etc.) that will be used by new Front-End methods DialogRemoveGame(), DialogGameInfo() and new BE RemoveContentList() method
      • Front-End: It only displays and manages a dialog box according to the info provided by the BE
    • Added right-click Manage Game->Game Info to display info for the selected content. The related dialog is DialogGameInfo() and it makes use of the shared BE GetContentInfo() method

    • Implemented new methods previously present (with limitations) in main_window.cpp:

      • BatchRemoveHDD1Caches()
      • BatchRemoveAllCaches()
      • BatchRemoveContentList()

      They all are compliant with other similar existing methods in game_list_frame.cpp such as BatchRemovePPUCaches() etc. so they will provide a progress bar for the task in progress

    • Existing BatchActionBySerials() method extended to provide also an action on task finish. It is needed by BatchRemoveContentLists() to finalize the list of titles to be removed from the game list and to refresh the list

    • Some code reduction and more robust checks provided by the use of methods:

      • IsGameRunning()
      • IsEmulatorRunning()
      • ValidateRemoval()
      • ValidateBatchRemoval()

      These methods are largely used by all the batch and non-batch removal methods such as BatchRemovePPUCaches(), RemovePPUCache() etc. allowing to reduce code and to better control preliminary checks

    • Some utility functions created on system_utils.cpp. A lot of them are functions providing emulator's paths avoiding the possibility of mistakes possible when creating paths on-the-fly (unfortunately largely used in all the code).
      Of course the functions have been used only by the new code in this PR

  • main_window.cpp:

    • Following methods replaced by the 3 batch methods provided (reported above) in game_list_frame.cpp:
      • RemoveHDD1Caches()
      • RemoveAllCaches()
      • RemoveSavestates()

Area for multi-selection (covered by the red rectangle):

pr_list


Main context menu:

pr_main_menu


Remove menu:

pr_remove_menu


Manage Game menu:

pr_manage_menu


Game Info dialog:

pr_game_info_dialog


Remove Game dialog:

pr_remove_game_dialog

@Megamouse Megamouse added the GUI label Nov 30, 2025
Copy link
Contributor

@Megamouse Megamouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is way too much code to review in one session.
More will follow at a later time

@digant73
Copy link
Contributor Author

this is way too much code to review in one session. More will follow at a later time

ok, I will book the requested changes and push them in few commits if possible

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] An OSK dialog to delete gamedata files to free space for another, when HDD is full

2 participants