コード例 #1
0
 def add_game(self, game):
     pixbuf = get_pixbuf_for_game(game['slug'], self.icon_type,
                                  game['installed'])
     name = game['name'].replace('&', "&")
     self.store.append(
         (game['id'], game['slug'], name, pixbuf, str(game['year']),
          game['runner'], game['installed']))
コード例 #2
0
    def add_game(self, game):
        pixbuf = get_pixbuf_for_game(game['slug'], self.icon_type,
                                     game['installed'])
        name = game['name'].replace('&', "&")
        runner = None
        platform = ''
        platform_name = ''
        runner_name = game['runner']
        runner_human_name = ''
        if runner_name:
            game_inst = Game(game['id'])
            if not game_inst.is_installed:
                return
            if runner_name in self.runner_names:
                runner_human_name = self.runner_names[runner_name]
            else:
                runner = runners.import_runner(runner_name)
                runner_human_name = runner.human_name
                self.runner_names[runner_name] = runner_human_name
            platform = game_inst.get_platform()
            if platform:
                platform_name = platform.replace(' / ', ' ')

        lastplayed = ''
        if game['lastplayed']:
            lastplayed = time.strftime("%c",
                                       time.localtime(game['lastplayed']))

        self.store.append(
            (game['id'], game['slug'], name, pixbuf, str(game['year'] or ''),
             runner_name, runner_human_name, platform, platform_name,
             lastplayed, game['installed']))
コード例 #3
0
ファイル: gameviews.py プロジェクト: Freso/lutris
 def set_icon_type(self, icon_type):
     if icon_type != self.icon_type:
         self.icon_type = icon_type
         for row in self.store:
             row[COL_ICON] = get_pixbuf_for_game(
                 row[COL_SLUG], icon_type, is_installed=row[COL_INSTALLED]
             )
         self.emit('icons-changed', icon_type)  # Obsolete, only for GridView
コード例 #4
0
ファイル: gameviews.py プロジェクト: Alphascrypt/lutris
 def set_icon_type(self, icon_type):
     if icon_type != self.icon_type:
         self.icon_type = icon_type
         for row in self.store:
             row[COL_ICON] = get_pixbuf_for_game(
                 row[COL_SLUG], icon_type, is_installed=row[COL_INSTALLED])
         self.emit('icons-changed',
                   icon_type)  # Obsolete, only for GridView
コード例 #5
0
ファイル: config_dialogs.py プロジェクト: steevp/lutris
 def _set_image(self, image_format):
     assert image_format in ('banner', 'icon')
     image = Gtk.Image()
     game_slug = self.game.slug if self.game else ''
     image.set_from_pixbuf(get_pixbuf_for_game(game_slug, image_format))
     if image_format == 'banner':
         self.banner_button.set_image(image)
     else:
         self.icon_button.set_image(image)
コード例 #6
0
ファイル: config_dialogs.py プロジェクト: RobLoach/lutris
 def _set_image(self, image_format):
     assert image_format in ('banner', 'icon')
     image = Gtk.Image()
     game_slug = self.game.slug if self.game else ''
     image.set_from_pixbuf(get_pixbuf_for_game(game_slug, image_format))
     if image_format == 'banner':
         self.banner_button.set_image(image)
     else:
         self.icon_button.set_image(image)
コード例 #7
0
ファイル: gameviews.py プロジェクト: Freso/lutris
 def update_image(self, game_id, is_installed=False):
     """Update game icon."""
     row = self.get_row_by_id(game_id)
     if row:
         game_slug = row[COL_SLUG]
         # get_pixbuf_for_game.cache_clear()
         game_pixpuf = get_pixbuf_for_game(game_slug,
                                           self.game_store.icon_type,
                                           is_installed)
         row[COL_ICON] = game_pixpuf
         row[COL_INSTALLED] = is_installed
         if type(self) is GameGridView:
             GLib.idle_add(self.queue_draw)
コード例 #8
0
ファイル: gameviews.py プロジェクト: Freso/lutris
 def add_game(self, game):
     pixbuf = get_pixbuf_for_game(game['slug'], self.icon_type,
                                  game['installed'])
     name = game['name'].replace('&', "&")
     self.store.append((
         game['id'],
         game['slug'],
         name,
         pixbuf,
         str(game['year']),
         game['runner'],
         game['installed']
     ))
コード例 #9
0
ファイル: gameviews.py プロジェクト: Alphascrypt/lutris
 def update_image(self, game_id, is_installed=False):
     """Update game icon."""
     row = self.get_row_by_id(game_id)
     if row:
         game_slug = row[COL_SLUG]
         # get_pixbuf_for_game.cache_clear()
         game_pixpuf = get_pixbuf_for_game(game_slug,
                                           self.game_store.icon_type,
                                           is_installed)
         row[COL_ICON] = game_pixpuf
         row[COL_INSTALLED] = is_installed
         if type(self) is GameGridView:
             GLib.idle_add(self.queue_draw)
コード例 #10
0
ファイル: gameviews.py プロジェクト: Alphascrypt/lutris
    def add_game(self, game):
        pixbuf = get_pixbuf_for_game(game['slug'], self.icon_type,
                                     game['installed'])
        name = game['name'].replace('&', "&")
        platform = game['platform']
        runner = None
        runner_name = game['runner']
        runner_human_name = ''
        if runner_name:
            runner = runners.import_runner(runner_name)
            runner_human_name = runner.human_name
        if not platform and runner:
            platform = str(runner.platform or '')

        self.store.append(
            (game['id'], game['slug'], name, pixbuf, str(game['year']),
             runner_name, runner_human_name, platform, game['installed']))
コード例 #11
0
ファイル: gameviews.py プロジェクト: RobLoach/lutris
    def add_game(self, game):
        pixbuf = get_pixbuf_for_game(game['slug'], self.icon_type,
                                     game['installed'])
        name = game['name'].replace('&', "&")
        runner = None
        platform = ''
        runner_name = game['runner']
        runner_human_name = ''
        if runner_name:
            game_inst = Game(game['id'])
            if not game_inst.is_installed:
                return
            if runner_name in self.runner_names:
                runner_human_name = self.runner_names[runner_name]
            else:
                runner = runners.import_runner(runner_name)
                runner_human_name = runner.human_name
                self.runner_names[runner_name] = runner_human_name
            platform = game_inst.platform

        lastplayed = ''
        if game['lastplayed']:
            lastplayed = time.strftime("%c", time.localtime(game['lastplayed']))

        self.store.append((
            game['id'],
            game['slug'],
            name,
            pixbuf,
            str(game['year'] or ''),
            runner_name,
            runner_human_name,
            platform,
            lastplayed,
            game['installed']
        ))
コード例 #12
0
ファイル: flowbox.py プロジェクト: notjuliee/lutris
 def set_image_pixbuf(self):
     pixbuf = get_pixbuf_for_game(self.slug,
                                  self.icon_type,
                                  self.installed)
     self.image.set_from_pixbuf(pixbuf)
コード例 #13
0
ファイル: config_dialogs.py プロジェクト: steevp/lutris
 def _set_icon_image(self):
     image = Gtk.Image()
     game_slug = self.game.slug if self.game else ''
     image.set_from_pixbuf(get_pixbuf_for_game(game_slug, 'banner'))
     self.banner_button.set_image(image)
コード例 #14
0
ファイル: config_dialogs.py プロジェクト: RobLoach/lutris
 def _set_icon_image(self):
     image = Gtk.Image()
     game_slug = self.game.slug if self.game else ''
     image.set_from_pixbuf(get_pixbuf_for_game(game_slug, 'banner'))
     self.banner_button.set_image(image)