Beispiel #1
0
 def on_icon_loaded(self, _store, game_slug, media_type):
     if not self.has_icon(game_slug):
         logger.warning("%s has not icon", game_slug)
         return
     if media_type != self.icon_type:
         logger.debug("%s type does not match %s", media_type,
                      self.icon_type)
         return
     for pga_game in pga.get_games_by_slug(game_slug):
         logger.debug("Updating %s", pga_game["id"])
         GLib.idle_add(self.update, pga_game)
Beispiel #2
0
 def on_icon_loaded(self, _store, game_slug, media_type):
     if not self.has_icon(game_slug):
         logger.debug("%s has no %s", game_slug, media_type)
         return
     if media_type != self.icon_type:
         return
     if self.search_mode:
         GLib.idle_add(self.update_icon, game_slug)
         return
     for pga_game in pga.get_games_by_slug(game_slug):
         logger.debug("Updating %s", pga_game["id"])
         GLib.idle_add(self.update, pga_game)
Beispiel #3
0
 def get_selected_game(self, selected_item):
     selected_game = None
     model = self.get_model()
     game_id = model.get_value(selected_item, COL_ID)
     game_slug = model.get_value(selected_item, COL_SLUG)
     pga_game = pga.get_games_by_slug(game_slug)
     if game_id > 0:
         selected_game = Game(game_id)
     elif pga_game:
         selected_game = Game(pga_game[0]["id"])
     else:
         selected_game = Game(game_id)
         selected_game.id = game_id
         selected_game.slug = game_slug
         selected_game.name = model.get_value(selected_item, COL_NAME)
         selected_game.installed = model.get_value(selected_item,
                                                   COL_INSTALLED)
     return selected_game