mirror of
https://github.com/lutris/lutris
synced 2024-10-14 19:53:53 +00:00
Use AsyncCall to obtain updates and DLC.
Round-tripping to the GOG servers can take a little while.
This commit is contained in:
parent
2b8703346a
commit
2b9358e7f2
|
@ -846,21 +846,31 @@ class Application(Gtk.Application):
|
||||||
def on_game_install_update(self, game):
|
def on_game_install_update(self, game):
|
||||||
service = get_enabled_services()[game.service]()
|
service = get_enabled_services()[game.service]()
|
||||||
db_game = games_db.get_game_by_field(game.id, "id")
|
db_game = games_db.get_game_by_field(game.id, "id")
|
||||||
installers = service.get_update_installers(db_game)
|
|
||||||
if installers:
|
def on_installers_ready(installers, error):
|
||||||
self.show_installer_window(installers, service, game.appid, installation_kind=InstallationKind.UPDATE)
|
if error:
|
||||||
else:
|
ErrorDialog(error, parent=self.window)
|
||||||
ErrorDialog(_("No updates found"), parent=self.window)
|
elif installers:
|
||||||
|
self.show_installer_window(installers, service, game.appid, installation_kind=InstallationKind.UPDATE)
|
||||||
|
else:
|
||||||
|
ErrorDialog(_("No updates found"), parent=self.window)
|
||||||
|
|
||||||
|
AsyncCall(service.get_update_installers, on_installers_ready, db_game)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def on_game_install_dlc(self, game):
|
def on_game_install_dlc(self, game):
|
||||||
service = get_enabled_services()[game.service]()
|
service = get_enabled_services()[game.service]()
|
||||||
db_game = games_db.get_game_by_field(game.id, "id")
|
db_game = games_db.get_game_by_field(game.id, "id")
|
||||||
installers = service.get_dlc_installers_runner(db_game, db_game["runner"])
|
|
||||||
if installers:
|
def on_installers_ready(installers, error):
|
||||||
self.show_installer_window(installers, service, game.appid, installation_kind=InstallationKind.DLC)
|
if error:
|
||||||
else:
|
ErrorDialog(error, parent=self.window)
|
||||||
ErrorDialog(_("No DLC found"), parent=self.window)
|
elif installers:
|
||||||
|
self.show_installer_window(installers, service, game.appid, installation_kind=InstallationKind.DLC)
|
||||||
|
else:
|
||||||
|
ErrorDialog(_("No DLC found"), parent=self.window)
|
||||||
|
|
||||||
|
AsyncCall(service.get_dlc_installers_runner, on_installers_ready, db_game, db_game["runner"])
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def get_launch_ui_delegate(self):
|
def get_launch_ui_delegate(self):
|
||||||
|
|
Loading…
Reference in a new issue