mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 07:02:50 +01:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c92108ac3 | ||
|
|
0f6f1c03ec | ||
|
|
39d8607f57 | ||
|
|
64d784f9a0 | ||
|
|
667203b4f9 | ||
|
|
00369837cb | ||
|
|
9bc5964df2 | ||
|
|
b7b83b3ca5 | ||
|
|
d04c20498a | ||
|
|
572ac5d7ce | ||
|
|
b4125c5a51 | ||
|
|
8bae2d5fb5 | ||
|
|
a85c632902 | ||
|
|
74ecc30692 | ||
|
|
33843becae |
No files matched your search
@@ -90,6 +90,7 @@
|
|||||||
- Rare segfaults when changing maps (threading)
|
- Rare segfaults when changing maps (threading)
|
||||||
- Moved dialogs out of threads
|
- Moved dialogs out of threads
|
||||||
- History table not being in lock-step with state file
|
- History table not being in lock-step with state file
|
||||||
|
- Current keyword filter not being applied when refreshing table
|
||||||
|
|
||||||
### Unreleased
|
### Unreleased
|
||||||
- Load offline mods
|
- Load offline mods
|
||||||
|
|||||||
@@ -346,10 +346,15 @@ def get_details(record: Record) -> Details:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
dlc = rules.dlc_flags
|
dlc = rules.dlc_flags
|
||||||
if dlc == 0:
|
match dlc:
|
||||||
dlc = strings.none
|
case 0:
|
||||||
if dlc == 2:
|
dlc = strings.dlc_none
|
||||||
dlc = strings.dlc_frostline
|
case 2:
|
||||||
|
dlc = strings.dlc_frostline
|
||||||
|
case 3:
|
||||||
|
dlc = strings.dlc_badlands
|
||||||
|
case _:
|
||||||
|
dlc = strings.unspecified
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
dlc = strings.unspecified
|
dlc = strings.unspecified
|
||||||
|
|
||||||
|
|||||||
+16
-9
@@ -151,7 +151,9 @@ def get_remote_signatures(mods: list[str]) -> list[tuple[str, str, int, int]]:
|
|||||||
return hashes
|
return hashes
|
||||||
|
|
||||||
|
|
||||||
def connect_debug(client: str, addr: str, appid: int, name: str, mods: list[str]) -> str:
|
def connect_debug(
|
||||||
|
client: str, addr: str, appid: int, name: str, mods: list[str]
|
||||||
|
) -> str:
|
||||||
concat = concat_mods(mods)
|
concat = concat_mods(mods)
|
||||||
client_args = concat_bash_args(client)
|
client_args = concat_bash_args(client)
|
||||||
params = [
|
params = [
|
||||||
@@ -167,6 +169,7 @@ def connect_debug(client: str, addr: str, appid: int, name: str, mods: list[str]
|
|||||||
client_args.extend(params)
|
client_args.extend(params)
|
||||||
return " ".join(client_args)
|
return " ".join(client_args)
|
||||||
|
|
||||||
|
|
||||||
# TODO: set config to name=user, use official server and no mods,
|
# TODO: set config to name=user, use official server and no mods,
|
||||||
# ensure that formatted string is identical to fixture with same hash
|
# ensure that formatted string is identical to fixture with same hash
|
||||||
def connect(client: str, addr: str, appid: int, name: str, mods: list[str]) -> int:
|
def connect(client: str, addr: str, appid: int, name: str, mods: list[str]) -> int:
|
||||||
@@ -235,14 +238,18 @@ def find_user_id(path: Path) -> str | None:
|
|||||||
try:
|
try:
|
||||||
with open(resolved_path, "r") as f:
|
with open(resolved_path, "r") as f:
|
||||||
v = vdf.load(f)
|
v = vdf.load(f)
|
||||||
# NOTE: beta client
|
users = v["users"]
|
||||||
# /package/beta
|
# NOTE: beta client: /package/beta
|
||||||
if len(v["users"]) == 1:
|
last_user = str(next(iter(users)))
|
||||||
return str(list(v["users"].keys())[0])
|
if len(users) == 1:
|
||||||
for user in v["users"]:
|
return last_user
|
||||||
if v["users"][user]["MostRecent"] == "1":
|
last_stamp = int(users[last_user]["Timestamp"])
|
||||||
return str(user)
|
for user in users:
|
||||||
return None
|
stamp = int(users[user]["Timestamp"])
|
||||||
|
if stamp > last_stamp:
|
||||||
|
last_stamp = stamp
|
||||||
|
last_user = user
|
||||||
|
return last_user
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(e)
|
logger.debug(e)
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -523,6 +523,7 @@ class Controller(GObject.GObject):
|
|||||||
|
|
||||||
def set_start_tab(self) -> None:
|
def set_start_tab(self) -> None:
|
||||||
ind = self.config_man.get_start_tab()
|
ind = self.config_man.get_start_tab()
|
||||||
|
logger.info(f"Setting start tab to index {ind}")
|
||||||
self.get_servers().notebook.set_current_page(ind)
|
self.get_servers().notebook.set_current_page(ind)
|
||||||
|
|
||||||
def get_debug_args(self) -> str:
|
def get_debug_args(self) -> str:
|
||||||
|
|||||||
@@ -90,6 +90,7 @@
|
|||||||
- Rare segfaults when changing maps (threading)
|
- Rare segfaults when changing maps (threading)
|
||||||
- Moved dialogs out of threads
|
- Moved dialogs out of threads
|
||||||
- History table not being in lock-step with state file
|
- History table not being in lock-step with state file
|
||||||
|
- Current keyword filter not being applied when refreshing table
|
||||||
|
|
||||||
### Unreleased
|
### Unreleased
|
||||||
- Load offline mods
|
- Load offline mods
|
||||||
|
|||||||
@@ -259,10 +259,6 @@ class ProxyModelManager:
|
|||||||
def set_cache(self, filters: tuple[str], filtered_rows: list[tuple]) -> None:
|
def set_cache(self, filters: tuple[str], filtered_rows: list[tuple]) -> None:
|
||||||
self.filter_cache[filters] = filtered_rows
|
self.filter_cache[filters] = filtered_rows
|
||||||
|
|
||||||
# @deprecated("Currently unused")
|
|
||||||
# def convert_model_to_list(self, model: "FastInsertListStore") -> list:
|
|
||||||
# return [[el for el in row] for row in model]
|
|
||||||
|
|
||||||
def set_filtered(self, rows: list | None) -> None:
|
def set_filtered(self, rows: list | None) -> None:
|
||||||
if rows is None:
|
if rows is None:
|
||||||
self.filtered = []
|
self.filtered = []
|
||||||
@@ -298,4 +294,6 @@ class ProxyModelManager:
|
|||||||
def push(self, data: list[Any]) -> None:
|
def push(self, data: list[Any]) -> None:
|
||||||
self.wipe_cache()
|
self.wipe_cache()
|
||||||
self.set_control(data)
|
self.set_control(data)
|
||||||
self.filter(FilterMode.INITIAL)
|
cur_keyword = self.filter_man.get_active_keyword()
|
||||||
|
mode = FilterMode.TOGGLE_ON if len(cur_keyword) > 0 else FilterMode.INITIAL
|
||||||
|
self.filter(mode)
|
||||||
@@ -84,6 +84,5 @@ class CalcDist:
|
|||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# TODO: handle failed remote dist
|
|
||||||
haversine = Haversine(local.lat, local.lon, remote.lat, remote.lon)
|
haversine = Haversine(local.lat, local.lon, remote.lat, remote.lon)
|
||||||
return haversine
|
return haversine
|
||||||
+1
-9
@@ -2,14 +2,13 @@ import a2s
|
|||||||
import requests
|
import requests
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from warnings import deprecated
|
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.api.servers import Record
|
from dzgui.api.servers import Record
|
||||||
from dzgui.const.constants import REQUEST_TIMEOUT
|
from dzgui.const.constants import REQUEST_TIMEOUT
|
||||||
from dzgui.const.endpoints import COORDS_API, IP_ECHO
|
from dzgui.const.endpoints import IP_ECHO
|
||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@@ -127,10 +126,3 @@ def is_valid_port(port: str) -> bool:
|
|||||||
if not port.isdigit() or int(port) == 0 or int(port[0]) == 0 or int(port) > 65535:
|
if not port.isdigit() or int(port) == 0 or int(port[0]) == 0 or int(port) > 65535:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@deprecated("use ips.csv")
|
|
||||||
def get_local_coords(ip: str) -> str:
|
|
||||||
url = COORDS_API + "/" + ip
|
|
||||||
# local res=$(curl -Ls "$url" | jq -r '"\(.lat)\n\(.lon)"')
|
|
||||||
return url
|
|
||||||
@@ -168,11 +168,12 @@ none_provided = "None provided"
|
|||||||
disabled = "Disabled"
|
disabled = "Disabled"
|
||||||
enabled = "Enabled"
|
enabled = "Enabled"
|
||||||
null = "-"
|
null = "-"
|
||||||
none = "None"
|
|
||||||
unspecified = "not specified"
|
unspecified = "not specified"
|
||||||
|
|
||||||
# DLC
|
# DLC
|
||||||
dlc_frostline = "Frostline"
|
dlc_frostline = "Frostline"
|
||||||
|
dlc_badlands = "Badlands"
|
||||||
|
dlc_none = "None"
|
||||||
|
|
||||||
# platform
|
# platform
|
||||||
windows = "Windows"
|
windows = "Windows"
|
||||||
|
|||||||
@@ -496,8 +496,7 @@ class Assistant(Gtk.Assistant):
|
|||||||
if page.is_migrated():
|
if page.is_migrated():
|
||||||
sp = page.migrated_conf["default_steam_path"]
|
sp = page.migrated_conf["default_steam_path"]
|
||||||
self.page_shortcuts.set_steam_path(sp)
|
self.page_shortcuts.set_steam_path(sp)
|
||||||
self.write_config(self.page_migration.migrated_conf)
|
self.config_values = self.page_migration.migrated_conf
|
||||||
self.setup_complete = True
|
|
||||||
return self.get_final_page()
|
return self.get_final_page()
|
||||||
case SteamPathPage():
|
case SteamPathPage():
|
||||||
self.config_values["default_steam_path"] = page.get_path_from_radio()
|
self.config_values["default_steam_path"] = page.get_path_from_radio()
|
||||||
@@ -509,11 +508,9 @@ class Assistant(Gtk.Assistant):
|
|||||||
self.config_values["name"] = name
|
self.config_values["name"] = name
|
||||||
self.config_values["use_miles"] = use_miles
|
self.config_values["use_miles"] = use_miles
|
||||||
self.config_values["client"] = client
|
self.config_values["client"] = client
|
||||||
self.write_config(self.config_values)
|
|
||||||
self.page_shortcuts.set_steam_path(
|
self.page_shortcuts.set_steam_path(
|
||||||
self.config_values["default_steam_path"]
|
self.config_values["default_steam_path"]
|
||||||
)
|
)
|
||||||
self.setup_complete = True
|
|
||||||
case ShortcutCreationPage():
|
case ShortcutCreationPage():
|
||||||
page.create_shortcuts()
|
page.create_shortcuts()
|
||||||
case _:
|
case _:
|
||||||
@@ -565,6 +562,10 @@ class Assistant(Gtk.Assistant):
|
|||||||
if not isinstance(page, IntroductionPage):
|
if not isinstance(page, IntroductionPage):
|
||||||
EMITTER.emit("step_pending")
|
EMITTER.emit("step_pending")
|
||||||
|
|
||||||
|
if page == self.page_completion:
|
||||||
|
self.write_config(self.config_values)
|
||||||
|
self.setup_complete = True
|
||||||
|
|
||||||
|
|
||||||
class CheckboxWithLabel(Gtk.Box):
|
class CheckboxWithLabel(Gtk.Box):
|
||||||
def __init__(self, text: str, blurb_text: str) -> None:
|
def __init__(self, text: str, blurb_text: str) -> None:
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
|
|||||||
authors = [
|
authors = [
|
||||||
{name = "aclist"}
|
{name = "aclist"}
|
||||||
]
|
]
|
||||||
version = "7.0.0b22"
|
version = "7.0.0b23"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
"users"
|
||||||
|
{
|
||||||
|
"0"
|
||||||
|
{
|
||||||
|
"AccountName" "STEAMUSER"
|
||||||
|
"PersonaName" "STEAMUSER"
|
||||||
|
"RememberPassword" "0"
|
||||||
|
"WantsOfflineMode" "0"
|
||||||
|
"SkipOfflineModeWarning" "0"
|
||||||
|
"AutoLogin" "1"
|
||||||
|
"Timestamp" "1787904411"
|
||||||
|
}
|
||||||
|
"1"
|
||||||
|
{
|
||||||
|
"AccountName" "STEAMUSER2"
|
||||||
|
"PersonaName" "STEAMUSER2"
|
||||||
|
"RememberPassword" "0"
|
||||||
|
"WantsOfflineMode" "0"
|
||||||
|
"SkipOfflineModeWarning" "0"
|
||||||
|
"AutoLogin" "1"
|
||||||
|
"Timestamp" "1787904647"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
"users"
|
||||||
|
{
|
||||||
|
"0"
|
||||||
|
{
|
||||||
|
"AccountName" "STEAMUSER"
|
||||||
|
"PersonaName" "STEAMUSER"
|
||||||
|
"RememberPassword" "0"
|
||||||
|
"WantsOfflineMode" "0"
|
||||||
|
"SkipOfflineModeWarning" "0"
|
||||||
|
"AutoLogin" "1"
|
||||||
|
"Timestamp" "1797904411"
|
||||||
|
}
|
||||||
|
"1"
|
||||||
|
{
|
||||||
|
"AccountName" "STEAMUSER2"
|
||||||
|
"PersonaName" "STEAMUSER2"
|
||||||
|
"RememberPassword" "0"
|
||||||
|
"WantsOfflineMode" "0"
|
||||||
|
"SkipOfflineModeWarning" "0"
|
||||||
|
"AutoLogin" "1"
|
||||||
|
"Timestamp" "1787904647"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,6 @@
|
|||||||
"SkipOfflineModeWarning" "0"
|
"SkipOfflineModeWarning" "0"
|
||||||
"AllowAutoLogin" "1"
|
"AllowAutoLogin" "1"
|
||||||
"MostRecent" "1"
|
"MostRecent" "1"
|
||||||
"Timestamp" "0"
|
"Timestamp" "10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,8 @@ pytestmark = pytest.mark.apitest
|
|||||||
("api/loginusers_legacy_client.vdf", 0),
|
("api/loginusers_legacy_client.vdf", 0),
|
||||||
("api/loginusers_legacy_client_multiple.vdf", 1),
|
("api/loginusers_legacy_client_multiple.vdf", 1),
|
||||||
("api/loginusers_beta_client.vdf", 0),
|
("api/loginusers_beta_client.vdf", 0),
|
||||||
|
("api/loginusers_beta_client_multiple.vdf", 1),
|
||||||
|
("api/loginusers_beta_client_multiple_2.vdf", 0),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_loginusers(monkeypatch, fixture: str, expect: int) -> None:
|
def test_loginusers(monkeypatch, fixture: str, expect: int) -> None:
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from dzgui.config.xdg import get_xdg_paths
|
||||||
|
|
||||||
|
|
||||||
|
def test_path_fallback(monkeypatch) -> None:
|
||||||
|
envs = ["XDG_DATA_HOME", "XDG_STATE_HOME", "XDG_CONFIG_HOME", "XDG_CACHE_HOME"]
|
||||||
|
for env in envs:
|
||||||
|
monkeypatch.setenv(env, "/etc/dzgui")
|
||||||
|
paths = get_xdg_paths()
|
||||||
|
assert paths["XDG_CONFIG_HOME"] == Path.home().joinpath(".config/dzgui")
|
||||||
|
assert paths["XDG_STATE_HOME"] == Path.home().joinpath(".local/state/dzgui")
|
||||||
|
assert paths["XDG_DATA_HOME"] == Path.home().joinpath(".local/share/dzgui")
|
||||||
|
assert paths["XDG_CACHE_HOME"] == Path.home().joinpath(".cache/dzgui")
|
||||||
Reference in new issue
Block a user