Compare commits

..

No commits in common. "c0015c05ecc61ec13f7d6ca43bfe35947beeb8d8" and "c947bc2c9b80b43d65b541b2b02fb1a2e874315f" have entirely different histories.

9 changed files with 19 additions and 58 deletions

View File

@ -139,9 +139,6 @@ def get_remote_signatures(mods: list[str]) -> list[tuple[str, str, int, int]]:
j = r.json()
rows = j["response"]["publishedfiledetails"]
for row in rows:
# NOTE: not a valid published file
if row["result"] == 9:
continue
title = str(row["title"])
_id = str(row["publishedfileid"])
time = int(row["time_updated"])
@ -208,11 +205,9 @@ def launch_offline(
proc = subprocess.run([*client_args, *params])
return proc.returncode
def find_loginusers(path: Path) -> Path:
return path / "config" / "loginusers.vdf"
def find_user_id(path: Path) -> str | None:
resolved_path = find_loginusers(path)
try:
@ -231,6 +226,7 @@ def find_user_id(path: Path) -> str | None:
return None
def find_user_id_32(path: Path) -> int:
uid = find_user_id(path)
if uid is None:

View File

@ -86,7 +86,6 @@ class Prerequisites:
mods: list[list[str]]
game_mode: bool
is_last_server: bool
invalid_mods: list[tuple[str, str]]
allows_downloads: tuple[bool, str]
@ -192,9 +191,6 @@ class ConnectionManager:
is_last = self.is_last_server()
# TODO: strings
invalid_mods = [(mod[0], mod[1]) for mod in remote_mods if mod[2] == "Invalid mod"]
prereqs = Prerequisites(
name=info.server_name,
appid=info.game_id,
@ -210,7 +206,6 @@ class ConnectionManager:
mods=remote_mods,
game_mode=game_mode,
is_last_server=is_last,
invalid_mods=invalid_mods,
allows_downloads=allows_downloads,
)
@ -266,11 +261,6 @@ class ConnectionManager:
for mod in alpha_mods:
if any(mod[1] in tuple for tuple in missing_mods):
mod[2] = resync
for mod in alpha_mods:
# NOTE: if the mod is neither synched or out of date, it is a malformed mod
if mod[2] == "":
# TODO: strings
mod[2] = "Invalid mod"
return alpha_mods, missing_mods

View File

@ -2,7 +2,7 @@ import logging
import signal
import warnings
from typing import TYPE_CHECKING, Literal, Self
from typing import TYPE_CHECKING, Literal
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, STEAM_ICON
from dzgui.const.enum import NotebookPage
@ -54,12 +54,10 @@ class OuterWindow(Gtk.Window):
MainController.register_widget("window", self)
# NOTE: steam deck taskbar may occlude elements
self.is_deck = MainController.get_prefs().is_steam_deck
if not self.is_deck:
if MainController.get_prefs().is_steam_deck is False:
self.set_titlebar(self.hb)
self.connect("delete-event", self._on_delete_event)
self.connect("realize", self._on_realize)
self.grid = Grid()
self.add(self.grid)
@ -75,10 +73,6 @@ class OuterWindow(Gtk.Window):
MainController.loaded = True
MainController.populate_model(MainController.get_active_treeview())
def _on_realize(self, window: Self) -> None:
if self.is_deck:
self.maximize()
def _on_delete_event(self, window: "OuterWindow", event: Gdk.EventKey) -> None:
self.halt_proc_and_quit()

View File

@ -37,11 +37,7 @@ class CursorMixin:
end = len(model) - 1
else:
return False
try:
cur_row = self.get_focused_row_index() # type: ignore
except Exception:
return False
cur_row = self.get_focused_row_index() # type: ignore
if position == CursorPosition.DOWN:
if cur_row == end:

View File

@ -103,4 +103,4 @@ class Keybindings(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
return grid
def grab_content_area(self) -> None:
self.grab_focus()
self.box.grab_focus()

View File

@ -521,6 +521,3 @@ class OfflineLoader(Gtk.Box):
self.mission_frame.present_folder_changed(mission)
return
self.offline_man.launch(appid, mission, local_mods, custom_folder, custom_mods)
def grab_content_area(self) -> None:
self.local_frame.tree.grab_focus()

View File

@ -20,13 +20,11 @@ from dzgui.const.enum import Preferences, ServerTab
from dzgui.strings import errors, options
from dzgui.util import strings, css, open_links
from dzgui.views.components.box import VBox
from dzgui.views.components.labels import LeftLabel
from dzgui.views.components.buttons import WebButton
from dzgui.views.components.frame import HeadingFrame
from dzgui.views.components.misc import ClientCombo
from dzgui.views.dialogs.generic import ExceptionDialog
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin
import gi
@ -46,9 +44,10 @@ class ShortHBox(Gtk.Box):
self.pack_start(widget, NO_EXPAND, NO_FILL, NO_PADDING)
class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
class Options(Gtk.Box):
def __init__(self, controller: "Controller"):
super().__init__(
orientation=Gtk.Orientation.VERTICAL,
margin_start=10,
margin_end=10,
)
@ -61,6 +60,11 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
self.DEFAULT_WIDTH = 1
self.DEFAULT_HEIGHT = 1
label = Gtk.Label(label=strings.options.header)
label.set_halign(Gtk.Align.CENTER)
css.add_class(label, "page-heading")
self.add(label)
self.steam_entry: Gtk.Entry
self.steam = WebButton(label=strings.options.steam_web)
@ -161,16 +165,9 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
grid.attach(frame, col, row, self.DEFAULT_WIDTH, self.DEFAULT_HEIGHT)
row += 1
label = Gtk.Label(label=strings.options.header)
label.set_halign(Gtk.Align.CENTER)
css.add_class(label, "page-heading")
box = VBox()
box.add(label)
box.add(grid)
self.add(box)
self.connect("key-press-event", self._on_keypress)
self.scrollable = Gtk.ScrolledWindow(vexpand=True)
self.scrollable.add(grid)
self.add(self.scrollable)
def get_client_name(self) -> str:
model = self.client_combo.get_model()
@ -445,4 +442,4 @@ class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore
widget.set_visibility(state)
def grab_content_area(self) -> None:
self.grab_focus()
return

View File

@ -239,15 +239,6 @@ class PreConnectionAssistant(Gtk.Box):
)
"""Errors"""
if len(prereqs.invalid_mods) > 0:
pairs = [": ".join(sub) for sub in prereqs.invalid_mods]
lines = "\n".join(pairs)
msg = (
"Server has invalid mods that are not recognized by Steam.\n"
"Contact the server owner and include these mod IDs in your report:\n"
f"{lines}"
)
errors.append(msg)
if prereqs.binary_missing:
errors.append(
f"Remote server is running the build '{prereqs.build}', but it is not installed.\n{resync_msg}"
@ -284,10 +275,10 @@ class PreConnectionAssistant(Gtk.Box):
allows_dl, running_app = prereqs.allows_downloads
if len(prereqs.mods) > 0 and allows_dl is False:
msg = (
f"The app '{running_app}' is currently running in Steam, but background downloads are not enabled.\n"
f"The game '{running_app}' is currently running in Steam, but background downloads are not enabled.\n"
"Either stop the game first, or update your global Steam settings or the game's local settings.\n"
"Otherwise, mods may be queued for download but never update."
)
)
warnings.append(msg)
self.add_warnings(warnings)

View File

@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
authors = [
{name = "aclist"}
]
version = "7.0.0b21"
version = "7.0.0b20"
license = "GPL-3.0-or-later"
license-files = ["LICENSE"]
readme = "README.md"