diff --git a/lutris/__init__.py b/lutris/__init__.py index 2355deff6..a1a03d0c1 100644 --- a/lutris/__init__.py +++ b/lutris/__init__.py @@ -1,3 +1,3 @@ """Main Lutris package""" -__version__ = "0.5.17" +__version__ = "0.5.15" diff --git a/lutris/gui/config/updates_box.py b/lutris/gui/config/updates_box.py index 343a2c324..96444b078 100644 --- a/lutris/gui/config/updates_box.py +++ b/lutris/gui/config/updates_box.py @@ -204,6 +204,7 @@ class UpdatesBox(BaseConfigBox): def get_updater(): updater = RuntimeUpdater() updater.update_runtime = True + updater.update_runners = False return updater self._trigger_updates(get_updater, self.update_runtime_box) diff --git a/lutris/gui/lutriswindow.py b/lutris/gui/lutriswindow.py index b88dfc3ce..69a7da30c 100644 --- a/lutris/gui/lutriswindow.py +++ b/lutris/gui/lutriswindow.py @@ -63,9 +63,11 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU viewtype_icon = GtkTemplate.Child() download_revealer: Gtk.Revealer = GtkTemplate.Child() game_view_spinner: Gtk.Spinner = GtkTemplate.Child() - notification_revealer: Gtk.Revealer = GtkTemplate.Child() + login_notification_revealer: Gtk.Revealer = GtkTemplate.Child() lutris_log_in_label: Gtk.Label = GtkTemplate.Child() turn_on_library_sync_label: Gtk.Label = GtkTemplate.Child() + version_notification_revealer: Gtk.Revealer = GtkTemplate.Child() + version_ignore_label: Gtk.Label = GtkTemplate.Child() def __init__(self, application, **kwargs): width = int(settings.read_setting("width") or self.default_width) @@ -847,7 +849,7 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU else: show_notification = False - self.notification_revealer.set_reveal_child(show_notification) + self.login_notification_revealer.set_reveal_child(show_notification) @GtkTemplate.Callback def on_lutris_log_in_label_activate_link(self, _label, _url): @@ -859,6 +861,9 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU self.sync_library(force=True) self.update_notification() + def on_version_ignore_label_activate_link(self, _label, _url): + self.version_notification_revealer.set_reveal_child(False) + def on_service_games_updated(self, service): """Request a view update when service games are loaded""" if self.service and service.id == self.service.id: @@ -1194,7 +1199,8 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU which can easily block.""" runtime_updater = RuntimeUpdater(force=force_updates) component_updaters = runtime_updater.create_component_updaters() - return component_updaters, runtime_updater + supported_client_version = runtime_updater.check_client_versions() + return component_updaters, runtime_updater, supported_client_version def create_runtime_updater_cb(result, error): """Picks up the component updates when we know what they are, and begins the installation. @@ -1203,7 +1209,11 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU if error: logger.exception("Failed to obtain updates from Lutris.net: %s", error) else: - component_updaters, runtime_updater = result + component_updaters, runtime_updater, supported_client_version = result + + if supported_client_version: + self.version_notification_revealer.set_reveal_child(True) + if component_updaters: self.install_runtime_component_updates(component_updaters, runtime_updater) else: diff --git a/lutris/runtime.py b/lutris/runtime.py index b06fa745d..7d9734964 100644 --- a/lutris/runtime.py +++ b/lutris/runtime.py @@ -5,7 +5,7 @@ import os import threading import time from gettext import gettext as _ -from typing import Any, Dict, List +from typing import Any, Dict, List, Optional from lutris import settings from lutris.api import ( @@ -22,6 +22,7 @@ from lutris.util.extract import extract_archive from lutris.util.jobs import AsyncCall from lutris.util.linux import LINUX_SYSTEM from lutris.util.log import logger +from lutris.util.strings import parse_version from lutris.util.wine.d3d_extras import D3DExtrasManager from lutris.util.wine.dgvoodoo2 import dgvoodoo2Manager from lutris.util.wine.dxvk import DXVKManager @@ -153,6 +154,8 @@ class RuntimeUpdater: """Class handling the runtime updates""" def __init__(self, force: bool = False): + self.runtime_versions = None + if RUNTIME_DISABLED: logger.warning("Runtime disabled by environment variable. Re-enable runtime before submitting issues.") self.update_runtime = False @@ -172,6 +175,9 @@ class RuntimeUpdater: self.update_runtime = False self.update_runners = False + if self.has_updates: + self.runtime_versions = download_runtime_versions() + @property def has_updates(self): return self.update_runtime or self.update_runners @@ -184,20 +190,28 @@ class RuntimeUpdater: This method also downloads fresh runner versions on each call, so we call this on a worker thread, instead of blocking the UI.""" - if not self.has_updates: + if not self.runtime_versions: return [] - runtime_versions = download_runtime_versions() updaters: List[ComponentUpdater] = [] if self.update_runtime: - updaters += self._get_runtime_updaters(runtime_versions) + updaters += self._get_runtime_updaters(self.runtime_versions) if self.update_runners: - updaters += self._get_runner_updaters(runtime_versions) + updaters += self._get_runner_updaters(self.runtime_versions) return [u for u in updaters if u.should_update] + def check_client_versions(self) -> Optional[str]: + if self.runtime_versions and not os.environ.get("LUTRIS_NO_CLIENT_VERSION_CHECK"): + client_version = self.runtime_versions.get("client_version") + if client_version: + if parse_version(client_version) > parse_version(settings.VERSION): + return client_version + + return None + @staticmethod def _get_runtime_updaters(runtime_versions: Dict[str, Any]) -> List[ComponentUpdater]: """Launch the update process""" diff --git a/share/lutris/ui/lutris-window.ui b/share/lutris/ui/lutris-window.ui index 2d2f68840..47e1215fe 100644 --- a/share/lutris/ui/lutris-window.ui +++ b/share/lutris/ui/lutris-window.ui @@ -97,18 +97,17 @@ True vertical - + True False none - True - + True False 6 - + True False Login to <a href="https://lutris.net/">Lutris.net</a> to view your game library @@ -163,6 +162,57 @@ 0 + + + True + False + none + + + True + False + 6 + + + True + True + This is not the currently supported version of Lutris. + True + + + False + True + 0 + + + + + True + True + <a href="">Ignore</a> + True + + + + False + True + end + 2 + + + + + + + + False + True + 1 + + True @@ -210,7 +260,7 @@ True True - 1 + 2 @@ -225,7 +275,7 @@ False True - 2 + 3