change: parse client from path

This commit is contained in:
aclist committed 2026-10-21 12:40:03 +09:00
1 parent ef1e7d17f5
commit 31b6705017
2 files changed
+14 -4

No files matched your search

+7 -2
View File
@@ -3,6 +3,8 @@ import subprocess
import shutil
import logging
from pathlib import Path
from dzgui.const.constants import (
APP_NAME,
STEAM_CMD,
@@ -29,8 +31,6 @@ def is_steam_running(cmd: str) -> bool:
raise TypeError("Not a valid Steam client selection")
# CHORE: test alternate clients
# TODO: has_flatpak_steam
def is_flatpak_steam_running() -> bool:
if has_cmd(FLATPAK_CMD) is False:
return False
@@ -54,3 +54,8 @@ def has_cmd(cmd: str) -> bool:
if shutil.which(cmd) is not None:
return True
return False
def path_to_steam_cmd(path: Path) -> str:
cmd = FLATPAK_RUN_CMD if FLATPAK_STEAM_PATH in path else STEAM_CMD
return cmd
+7 -2
View File
@@ -11,12 +11,16 @@ from dzgui.api.steam import get_steam_paths
from dzgui.const.constants import (
APP_NAME,
APP_NAME_LOWER,
FLATPAK_RUN_CMD,
FLATPAK_STEAM_PATH,
HERO_PATH,
LEGACY_CONFIG_PATH,
STEAM_CMD,
)
from dzgui.const.boilerplate import config_boilerplate
from dzgui.const.endpoints import STEAM_API_SETUP
from dzgui.config import freedesktop
from dzgui.init.proc import path_to_steam_cmd
from dzgui.init.migrate import migrate_legacy_conf
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
from dzgui.strings import wizard
@@ -499,7 +503,9 @@ class Assistant(Gtk.Assistant):
self.config_values = self.page_migration.migrated_conf
return self.get_final_page()
case SteamPathPage():
self.config_values["default_steam_path"] = page.get_path_from_radio()
path = page.get_path_from_radio()
self.config_values["default_steam_path"] = path
self.config_values["client"] = path_to_steam_cmd(path)
case SteamValidationPage():
self.config_values["steam_api"] = page.get_api_key()
case PreferencesPage():
@@ -507,7 +513,6 @@ class Assistant(Gtk.Assistant):
name, use_miles, client = self.page_prefs.get_prefs()
self.config_values["name"] = name
self.config_values["use_miles"] = use_miles
self.config_values["client"] = client
self.page_shortcuts.set_steam_path(
self.config_values["default_steam_path"]
)