示例#1
0
 def get_displayed_entries(self):
     """Return a dictionary of actions that should be shown for a game"""
     return {
         "add": not self.game.is_installed and not self.game.is_search_result,
         "install": not self.game.is_installed,
         "play": self.game.is_installed and not self.is_game_running,
         "stop": self.is_game_running,
         "show_logs": self.game.is_installed,
         "configure": bool(self.game.is_installed),
         "install_more": self.game.is_installed and not self.game.is_search_result,
         "execute-script": bool(
             self.game.is_installed
             and self.game.runner.system_config.get("manual_command")
         ),
         "desktop-shortcut": (
             self.game.is_installed
             and not xdgshortcuts.desktop_launcher_exists(self.game.slug, self.game.id)
         ),
         "menu-shortcut": (
             self.game.is_installed
             and not xdgshortcuts.menu_launcher_exists(self.game.slug, self.game.id)
         ),
         "rm-desktop-shortcut": bool(
             self.game.is_installed
             and xdgshortcuts.desktop_launcher_exists(self.game.slug, self.game.id)
         ),
         "rm-menu-shortcut": bool(
             self.game.is_installed
             and xdgshortcuts.menu_launcher_exists(self.game.slug, self.game.id)
         ),
         "browse": self.game.is_installed and self.game.runner_name != "browser",
         "remove": not self.game.is_search_result,
         "view": True
     }
示例#2
0
 def get_displayed_entries(self):
     """Return a dictionary of actions that should be shown for a game"""
     return {
         "add": not self.game.is_installed and not self.game.is_search_result,
         "install": not self.game.is_installed,
         "play": self.game.is_installed and not self.is_game_running,
         "stop": self.is_game_running,
         "show_logs": self.game.is_installed,
         "configure": bool(self.game.is_installed),
         "install_more": self.game.is_installed and not self.game.is_search_result,
         "execute-script": bool(
             self.game.is_installed
             and self.game.runner.system_config.get("manual_command")
         ),
         "desktop-shortcut": (
             self.game.is_installed
             and not xdgshortcuts.desktop_launcher_exists(self.game.slug, self.game.id)
         ),
         "menu-shortcut": (
             self.game.is_installed
             and not xdgshortcuts.menu_launcher_exists(self.game.slug, self.game.id)
         ),
         "rm-desktop-shortcut": bool(
             self.game.is_installed
             and xdgshortcuts.desktop_launcher_exists(self.game.slug, self.game.id)
         ),
         "rm-menu-shortcut": bool(
             self.game.is_installed
             and xdgshortcuts.menu_launcher_exists(self.game.slug, self.game.id)
         ),
         "browse": self.game.is_installed and self.game.runner_name != "browser",
         "remove": not self.game.is_search_result,
         "view": True
     }
示例#3
0
 def get_displayed_entries(self):
     """Return a dictionary of actions that should be shown for a game"""
     return {
         "add":
         not self.game.is_installed,
         "duplicate":
         True,
         "install":
         not self.game.is_installed,
         "play":
         self.game.is_installed and not self.is_game_running,
         "update":
         self.game.is_updatable,
         "install_dlcs":
         self.game.is_updatable,
         "stop":
         self.is_game_running,
         "configure":
         bool(self.game.is_installed),
         "browse":
         self.game.is_installed and self.game.runner_name != "browser",
         "show_logs":
         self.game.is_installed,
         "favorite":
         not self.game.is_favorite,
         "deletefavorite":
         self.game.is_favorite,
         "install_more":
         not self.game.service and self.game.is_installed,
         "execute-script":
         bool(self.game.is_installed and self.game.runner
              and self.game.runner.system_config.get("manual_command")),
         "desktop-shortcut": (self.game.is_installed
                              and not xdgshortcuts.desktop_launcher_exists(
                                  self.game.slug, self.game.id)),
         "menu-shortcut": (self.game.is_installed
                           and not xdgshortcuts.menu_launcher_exists(
                               self.game.slug, self.game.id)),
         "rm-desktop-shortcut":
         bool(self.game.is_installed
              and xdgshortcuts.desktop_launcher_exists(
                  self.game.slug, self.game.id)),
         "rm-menu-shortcut":
         bool(self.game.is_installed and xdgshortcuts.menu_launcher_exists(
             self.game.slug, self.game.id)),
         "remove":
         True,
         "view":
         True,
         "hide":
         self.game.is_installed and not self.game.is_hidden,
         "unhide":
         self.game.is_hidden,
     }
示例#4
0
 def get_hidden_entries(game):
     """Return a dictionary of actions that should be hidden for a game"""
     return {
         "add": game.is_installed,
         "install": game.is_installed,
         "install_more": not game.is_installed,
         "play": not game.is_installed,
         "configure": not game.is_installed,
         "desktop-shortcut": (
             not game.is_installed or xdgshortcuts.desktop_launcher_exists(game.slug, game.id)
         ),
         "menu-shortcut": (
             not game.is_installed or xdgshortcuts.menu_launcher_exists(game.slug, game.id)
         ),
         "rm-desktop-shortcut": (
             not game.is_installed or not xdgshortcuts.desktop_launcher_exists(game.slug, game.id)
         ),
         "rm-menu-shortcut": (
             not game.is_installed or not xdgshortcuts.menu_launcher_exists(game.slug, game.id)
         ),
         "browse": not game.is_installed or game.runner_name == "browser",
     }
def migrate():
    for game in [Game(pga_game["id"]) for pga_game in pga.get_games()]:
        if xdgshortcuts.desktop_launcher_exists(game.slug, game.id):
            xdgshortcuts.create_launcher(game.slug, game.id, game.name, desktop=True)
        if xdgshortcuts.menu_launcher_exists(game.slug, game.id):
            xdgshortcuts.create_launcher(game.slug, game.id, game.name, menu=True)