def on_service_synced(self, sync_results, _extra): """Called when games are imported""" window = get_main_window(self) if not window: logger.warning("Unable to get main window") return added_games, original_games = sync_results skipped_import = len(original_games) - len(added_games) if added_games: added_message = "%s game%s imported. " % ( len(added_games), "s were" if len(added_games) > 1 else " was" ) else: added_message = "No games were added. " if skipped_import: skipped_message = "%s game%s already in the library" % ( skipped_import, "s are" if skipped_import > 1 else " is" ) else: skipped_message = "" send_notification("Games imported", added_message + skipped_message) for game_id in added_games: window.game_store.add_or_update(game_id)
def on_service_synced(self, sync_results, _extra): """Called when games are imported""" window = get_main_window(self) if not window: logger.warning("Unable to get main window") return if not sync_results: logger.error("No sync results were passed") return added_games, original_games = sync_results skipped_import = len(original_games) - len(added_games) if added_games: added_message = gettext.ngettext( "%d game was imported. ", "%d games were imported. ", len(added_games)) % len(added_games) else: added_message = _("No games were added. ") if skipped_import: skipped_message = gettext.ngettext( "%s game is already in the library", "%s games are already in the library", skipped_import) % skipped_import else: skipped_message = "" send_notification(_("Games imported"), added_message + skipped_message) for game_id in added_games: window.game_store.add_or_update(game_id)
def on_service_synced(self, games, _extra): """Called when games are imported""" window = get_main_window(self) if not window: logger.warning("Unable to get main window") return if games: send_notification( "Games imported", "%s game%s imported to Lutris" % (len(games), "s were" if len(games) > 1 else " was")) for game_id in games: window.game_store.add_or_update(game_id)
def on_service_synced(self, games, _extra): """Called when games are imported""" window = get_main_window(self) if not window: logger.warning("Unable to get main window") return if games: send_notification( "Games imported", "%s game%s imported to Lutris" % (len(games), "s were" if len(games) > 1 else " was") ) window.game_store.add_games_by_ids(games) GLib.idle_add(window.view.queue_draw)
def on_service_synced(self, games, _extra): """Called when games are imported""" window = get_main_window(self) if not window: logger.warning("Unable to get main window") return if games: send_notification( "Games imported", "%s game%s imported to Lutris" % (len(games), "s were" if len(games) > 1 else " was") ) for game_id in games: window.game_store.add_or_update(game_id)
def on_preferences_clicked(self, button): SystemConfigDialog(get_main_window(button))