Update text on startup dialog

This commit is contained in:
Mathieu Comandon 2023-09-15 16:47:31 -07:00
parent 38f7283eed
commit fcbba61b85
2 changed files with 7 additions and 0 deletions

View file

@ -334,6 +334,8 @@ class LutrisInitDialog(Gtk.Dialog):
def show_progress(self):
self.progress.set_fraction(self.runtime_updater.percentage_completed())
if self.runtime_updater.status_text and self.label.get_text() != self.runtime_updater.status_text:
self.label.set_text(self.runtime_updater.status_text)
return True
def init_cb(self, _result, error: Exception):

View file

@ -2,6 +2,7 @@
import concurrent.futures
import os
import time
from gettext import gettext as _
from gi.repository import GLib
@ -269,11 +270,13 @@ class RuntimeUpdater:
runner_path = os.path.join(settings.RUNNER_DIR, name, "-".join([upstream_runner["version"], upstream_runner["architecture"]]))
if system.path_exists(runner_path):
continue
self.status_text = _(f"Updating {name}")
archive_download_path = os.path.join(settings.CACHE_DIR, os.path.basename(upstream_runner["url"]))
downloader = Downloader(upstream_runner["url"], archive_download_path)
downloader.start()
self.downloaders = {"wine": downloader}
downloader.join()
self.status_text = _(f"Extracting {name}")
extract_archive(archive_download_path, runner_path)
@ -289,7 +292,9 @@ class RuntimeUpdater:
logger.debug("Skipping runtime %s for %s", name, remote_runtime["architecture"])
continue
runtime = Runtime(remote_runtime["name"], self)
self.status_text = _(f"Updating {remote_runtime['name']}")
if remote_runtime["url"]:
downloader = runtime.download(remote_runtime)
if downloader:
self.downloaders[runtime] = downloader