mirror of
https://github.com/lutris/lutris
synced 2024-09-15 22:09:55 +00:00
Get missing games in a separate thread during startup
This commit is contained in:
parent
992d421a0e
commit
8558b96cc5
|
@ -32,6 +32,7 @@ from lutris.scanners.lutris import add_to_path_cache, get_missing_game_ids, remo
|
|||
from lutris.services.base import BaseService
|
||||
from lutris.services.lutris import LutrisService
|
||||
from lutris.util import datapath
|
||||
from lutris.util.jobs import AsyncCall
|
||||
from lutris.util.log import logger
|
||||
from lutris.util.system import update_desktop_icons
|
||||
from lutris.util.wine.wine import esync_display_limit_warning, fsync_display_support_warning
|
||||
|
@ -248,7 +249,7 @@ class LutrisWindow(Gtk.ApplicationWindow,
|
|||
def on_load(self, widget, data=None):
|
||||
"""Finish initializing the view"""
|
||||
self._bind_zoom_adjustment()
|
||||
self.get_missing_games()
|
||||
AsyncCall(get_missing_game_ids, self.on_get_missing_game_ids)
|
||||
self.current_view.grab_focus()
|
||||
|
||||
def on_sidebar_realize(self, widget, data=None):
|
||||
|
@ -414,8 +415,15 @@ class LutrisWindow(Gtk.ApplicationWindow,
|
|||
"""Return a list of currently running games"""
|
||||
return games_db.get_games_by_ids([game.id for game in self.application.running_games])
|
||||
|
||||
def get_missing_games(self):
|
||||
missing_ids = get_missing_game_ids()
|
||||
def on_get_missing_game_ids(self, missing_ids, error):
|
||||
if error:
|
||||
logger.error(str(error))
|
||||
return
|
||||
self.get_missing_games(missing_ids)
|
||||
|
||||
def get_missing_games(self, missing_ids:list=None) -> list:
|
||||
if missing_ids is None:
|
||||
missing_ids = get_missing_game_ids()
|
||||
missing_games = games_db.get_games_by_ids(missing_ids)
|
||||
if missing_games:
|
||||
self.sidebar.missing_row.show()
|
||||
|
|
|
@ -88,7 +88,6 @@ def _get_simple_vulkan_support_error(config, option_key, feature):
|
|||
if not LINUX_SYSTEM.is_vulkan_supported():
|
||||
return _("<b>Error</b> Vulkan is not installed or is not supported by your system, "
|
||||
"so %s is not available.") % feature
|
||||
|
||||
return None
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue