Add umu update channel (not fully implemented yet)

This commit is contained in:
Mathieu Comandon 2024-03-26 13:05:15 -07:00
parent f4b370c38a
commit e513e442a6
5 changed files with 25 additions and 21 deletions

View file

@ -10,7 +10,7 @@ from lutris.gui.config.base_config_box import BaseConfigBox
from lutris.gui.dialogs import NoticeDialog
from lutris.runtime import RuntimeUpdater
from lutris.services.lutris import sync_media
from lutris.settings import UPDATE_CHANNEL_STABLE, UPDATE_CHANNEL_UNSUPPORTED
from lutris.settings import UPDATE_CHANNEL_STABLE, UPDATE_CHANNEL_UMU, UPDATE_CHANNEL_UNSUPPORTED
from lutris.util import system
from lutris.util.jobs import AsyncCall
from lutris.util.log import logger
@ -61,6 +61,18 @@ class UpdatesBox(BaseConfigBox):
markup, active=update_channel == UPDATE_CHANNEL_STABLE, group=None
)
markup = _(
"<b>Umu</b>:\n"
"Umu enables the use of Proton and Pressure Vessel outside of Steam. \n"
"It uses its own version of Proton which automatically applies game fixes.\n"
"Updates to Proton will be automatically downloaded when a game is launched"
"\n"
"<b>WARNING: This feature is still under heavy development</b>"
)
umu_channel_radio_button = self._get_radio_button(
markup, active=update_channel == UPDATE_CHANNEL_UMU, group=stable_channel_radio_button
)
markup = _(
"<b>Self-maintained</b>:\n"
"Wine updates are no longer delivered automatically and you have full responsibility "
@ -74,8 +86,9 @@ class UpdatesBox(BaseConfigBox):
)
# Safer to connect these after the active property has been initialized on all radio buttons
stable_channel_radio_button.connect("toggled", self.on_update_channel_toggled, UPDATE_CHANNEL_STABLE)
umu_channel_radio_button.connect("toggled", self.on_update_channel_toggled, UPDATE_CHANNEL_UMU)
unsupported_channel_radio_button.connect("toggled", self.on_update_channel_toggled, UPDATE_CHANNEL_UNSUPPORTED)
return (stable_channel_radio_button, unsupported_channel_radio_button)
return (stable_channel_radio_button, umu_channel_radio_button, unsupported_channel_radio_button)
def get_wine_update_texts(self):
wine_version_info = get_default_wine_runner_version_info()
@ -198,12 +211,12 @@ class UpdatesBox(BaseConfigBox):
if component_updaters:
def on_complete(_result):
if len(component_updaters) == 1:
update_box.show_completion_markup("", _("1 component has been updated."))
# the 'icons' updater always shows as updated even when it's not
component_names = [updater.name for updater in component_updaters if updater.name != "icons"]
if len(component_names) == 1:
update_box.show_completion_markup("", _("%s has been updated.") % component_names[0])
else:
update_box.show_completion_markup(
"", _("%d components have been updated.") % len(component_updaters)
)
update_box.show_completion_markup("", _("%s have been updated.") % ", ".join(component_names))
started = window.install_runtime_component_updates(
component_updaters, updater, completion_function=on_complete, error_function=update_box.show_error
@ -221,7 +234,7 @@ class UpdatesBox(BaseConfigBox):
if not checkbox.get_active():
return
last_setting = settings.read_setting("wine-update-channel", UPDATE_CHANNEL_STABLE)
if last_setting == UPDATE_CHANNEL_STABLE and value == UPDATE_CHANNEL_UNSUPPORTED:
if last_setting != UPDATE_CHANNEL_UNSUPPORTED and value == UPDATE_CHANNEL_UNSUPPORTED:
NoticeDialog(
_("Without the Wine-GE updates enabled, we can no longer provide support on Github and Discord."),
parent=self.get_toplevel(),

View file

@ -297,16 +297,11 @@ class LutrisInstaller: # pylint: disable=too-many-instance-attributes
self.script["game"].update(lutris_config)
configpath = write_game_config(self.slug, self.get_game_config())
runner_inst = import_runner(self.runner)()
if self.service:
service_id = self.service.id
else:
service_id = None
self.game_id = add_or_update(
name=self.game_name,
runner=self.runner,
slug=self.game_slug,
platform=runner_inst.get_platform(),
platform=import_runner(self.runner)().get_platform(),
directory=self.interpreter.target_path,
installed=1,
hidden=0,
@ -314,7 +309,7 @@ class LutrisInstaller: # pylint: disable=too-many-instance-attributes
parent_slug=self.requires,
year=self.year,
configpath=configpath,
service=service_id,
service=self.service.id if self.service else None,
service_id=self.service_appid,
id=self.game_id,
discord_id=self.discord_id,

View file

@ -178,7 +178,7 @@ def winekill(prefix, arch=WINE_DEFAULT_ARCH, wine_path=None, env=None, initial_p
initial_pids = initial_pids or []
if not env:
env = {"WINEARCH": arch, "WINEPREFIX": prefix}
env = {"WINEARCH": arch, "WINEPREFIX": prefix}
if proton.is_proton_path(wine_path):
command = [proton.get_umu_path(), "runinprefix", "wineboot", "-e"]
env["GAMEID"] = proton.DEFAULT_GAMEID

View file

@ -166,11 +166,6 @@ class RuntimeUpdater:
if not self.update_runtime:
logger.warning("Runtime updates are disabled. This configuration is not supported.")
if not self.update_runners:
logger.warning(
"Wine updates have been disabled. To receive support on Github or Discord, "
"switch back to the stable channel"
)
if not check_stale_runtime_versions():
self.update_runtime = False

View file

@ -64,6 +64,7 @@ DEFAULT_RESOLUTION_WIDTH = sio.read_setting("default_resolution_width", default=
DEFAULT_RESOLUTION_HEIGHT = sio.read_setting("default_resolution_height", default="720")
UPDATE_CHANNEL_STABLE = "stable"
UPDATE_CHANNEL_UMU = "umu"
UPDATE_CHANNEL_UNSUPPORTED = "self-maintained"
read_setting = sio.read_setting