Beispiel #1
0
def init_lutris():
    """Run full initialization of Lutris"""
    logger.info("Initializing lutris")
    runners.inject_runners(load_json_runners())
    # Load runner names and platforms
    runners.RUNNER_NAMES = runners.get_runner_names()
    runners.RUNNER_PLATFORMS = runners.get_platforms()
    init_dirs()
    try:
        syncdb()
    except sqlite3.DatabaseError:
        raise RuntimeError(
            "Failed to open database file in %s. Try renaming this file and relaunch Lutris" %
            settings.PGA_DB
        )
    for service in DEFAULT_SERVICES:
        if not settings.read_setting(service, section="services"):
            settings.write_setting(service, True, section="services")

    if os.environ.get("LUTRIS_SKIP_INIT"):
        logger.info("Skipping initialization")
        return
    runtime_updater = RuntimeUpdater()
    components_to_update = runtime_updater.update()
    if components_to_update:
        while runtime_updater.current_updates:
            time.sleep(0.3)
    fetch_dxvk_versions()
    dxvk_manager = DXVKManager()
    if not dxvk_manager.is_available():
        logger.info("DXVK %s not available, downloading...", dxvk_manager.version)
        dxvk_manager.download()
    logger.info("Runtime updated. Initialization complete.")
Beispiel #2
0
def init_lutris():
    """Run full initialization of Lutris"""
    logger.info("Starting Lutris %s", settings.VERSION)
    runners.inject_runners(load_json_runners())
    # Load runner names and platforms
    runners.RUNNER_NAMES = runners.get_runner_names()
    runners.RUNNER_PLATFORMS = runners.get_platforms()
    init_dirs()
    try:
        syncdb()
    except sqlite3.DatabaseError:
        raise RuntimeError(
            "Failed to open database file in %s. Try renaming this file and relaunch Lutris"
            % settings.PGA_DB)
    for service in DEFAULT_SERVICES:
        if not settings.read_setting(service, section="services"):
            settings.write_setting(service, True, section="services")
Beispiel #3
0
    def on_realize(self, widget):
        self.active_platforms = games_db.get_used_platforms()
        self.runners = sorted(runners.__all__)
        self.platforms = sorted(runners.get_platforms())
        self.categories = categories_db.get_categories()

        self.add(
            SidebarRow(
                "all",
                "category",
                _("Games"),
                Gtk.Image.new_from_icon_name("applications-games-symbolic", Gtk.IconSize.MENU)
            )
        )

        self.add(
            SidebarRow(
                "recent",
                "dynamic_category",
                _("Recent"),
                Gtk.Image.new_from_icon_name("document-open-recent-symbolic", Gtk.IconSize.MENU)
            )
        )

        self.add(
            SidebarRow(
                "favorite",
                "category",
                _("Favorites"),
                Gtk.Image.new_from_icon_name("favorite-symbolic", Gtk.IconSize.MENU)
            )
        )

        self.running_row = SidebarRow(
            "running",
            "dynamic_category",
            _("Running"),
            Gtk.Image.new_from_icon_name("media-playback-start-symbolic", Gtk.IconSize.MENU)
        )
        # I wanted this to be on top but it really messes with the headers when showing/hiding the row.
        self.add(self.running_row)

        service_classes = services.get_services()
        for service_name in service_classes:
            service = service_classes[service_name]()
            row_class = OnlineServiceSidebarRow if service.online else ServiceSidebarRow
            service_row = row_class(service)
            self.service_rows[service_name] = service_row
            self.add(service_row)

        for runner_name in self.runners:
            icon_name = runner_name.lower().replace(" ", "") + "-symbolic"
            runner = runners.import_runner(runner_name)()
            self.add(RunnerSidebarRow(
                runner_name,
                "runner",
                runner.human_name,
                self.get_sidebar_icon(icon_name),
                application=self.application
            ))

        for platform in self.platforms:
            icon_name = (platform.lower().replace(" ", "").replace("/", "_") + "-symbolic")
            self.add(SidebarRow(platform, "platform", platform, self.get_sidebar_icon(icon_name)))

        self.update()
        for row in self.get_children():
            if row.type == self.selected_row_type and row.id == self.selected_row_id:
                self.select_row(row)
                break
        self.show_all()
        self.running_row.hide()