mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 20:22:37 +01:00
change: parse client from path
This commit is contained in:
1 parent
ef1e7d17f5
commit
31b6705017
2 files changed
+14
-4
No files matched your search
+7
-2
@@ -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
|
||||
@@ -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"]
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user