Feature: Introduce platform_mode in Preferences and use it to select installers - #739
Draft
GB609 wants to merge 2 commits into
Draft
Feature: Introduce platform_mode in Preferences and use it to select installers#739GB609 wants to merge 2 commits into
platform_mode in Preferences and use it to select installers#739GB609 wants to merge 2 commits into
Conversation
GB609
marked this pull request as draft
May 12, 2026 08:08
Collaborator
Author
|
I'm missing a few chunks of code for a working integration. I'll put the PR to draft for now and come back to it once i've added the missing parts. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a partial implementation of the final platform selection feature:
It is now possible to set up globally if linux or windows installers shall be used (applies for games supporting both).
Additionally, pure windows games will be shown or hidden depending on the value of
platform_modethat was picked.The code in this PR is complete enough to have a working state in master - the new preference is used. So a basic way to chose exists now. Users going from git directly could use/test the current state without having to wait for a release.
This new setting replaces the previous option
show_windows_games. Code to migrate the property value was added and will apply when Minigalaxy loads its config.json:show_windows_gamesexists as a key, take the value and then remove the keyTruebefore, applyplatform_mode=linux,windowsFalse, applyplatform_mode=linuxNEW modes:
platform_mode=linux: Show all games supporting a native linux version. Any additional support for windows is ignored and won't even be given as a choice to pick from. This is the current behaviour whenshow_windows_games=Falseplatform_mode=linux,windows: Show all games supporting at least one of the given platforms.Use/prefer the linux installers where available.
platform_mode=windows,linux: Show all games supporting at least one of the given platforms.Use/prefer the windows installers where available.
platform_mode=windows: The inverse ofplatform_mode=linux. In theory, pure linux games would be hidden (if such games exist, although rare). Aside from that, for games that support both, it will later have the effect that the linux version won't be offered for download at all (icon to change is hidden).The difference between the two "Prefer" variants gets more pronounced and important when selection per game is added as well since it will then impact the default and the icon visibility. For now (without the per-game icons), "Prefer Windows" is effectively the same as "Windows only" because there are literally close to zero pure linux games on GOG (if at all).
This PR also includes a few code refactorings to reduce nesting levels and complexity.
Open bugs:
State
Downloading a game and then changing the preferred platform BEFORE it has finished downloading or before it is installed, will likely utterly confuse MG and have it try to e.g. resume windows-started downloads with linux files (effectively a restart), or try to use wine for shell scripts.
I haven't added extra code to accomodate this situation, as the current state is intermediate.
It works as in the master branch starts ups and is capable of downloading and installing according to the selected preferences. But changing the pref should best be done only when MG is idle. The rest will be dealt with in the next 1-2 PRs.
Wine
I have temporarily removed part of the
shutil.which("wine")check in preferences which could result in an error dialog and the reverting ofshow_windows_games. I plan to instead just make the game's main button disabled when there's no wine (plus add a suitable tooltip)Checklist