def update(self, pga_game): """Update game informations.""" game = PgaGame(pga_game) if self.search_mode: row = self.get_row_by_slug(game.slug) else: row = self.get_row_by_id(game.id) if not row: raise ValueError("No existing row for game %s" % game.slug) row[COL_ID] = game.id row[COL_SLUG] = game.slug row[COL_NAME] = game.name row[COL_ICON] = game.get_pixbuf(self.icon_type) row[COL_YEAR] = game.year row[COL_RUNNER] = game.runner row[COL_RUNNER_HUMAN_NAME] = game.runner_text row[COL_PLATFORM] = game.platform row[COL_LASTPLAYED] = game.lastplayed row[COL_LASTPLAYED_TEXT] = game.lastplayed_text row[COL_INSTALLED] = game.installed row[COL_INSTALLED_AT] = game.installed_at row[COL_INSTALLED_AT_TEXT] = game.installed_at_text row[COL_PLAYTIME] = game.playtime row[COL_PLAYTIME_TEXT] = game.playtime_text if not self.has_icon(game.slug): self.refresh_icon(game.slug)
def add_game(self, pga_game): """Add a PGA game to the store""" game = PgaGame(pga_game) self.games.append(pga_game) self.store.append( ( game.id, game.slug, game.name, game.get_pixbuf(self.icon_type), game.year, game.runner, game.runner_text, game.platform, game.lastplayed, game.lastplayed_text, game.installed, game.installed_at, game.installed_at_text, game.playtime, game.playtime_text, ) ) if not self.has_icon(game.slug): self.refresh_icon(game.slug)