chore: clear typehinting errors

This commit is contained in:
aclist 2026-05-12 18:36:25 +09:00
parent f7fe62e661
commit 897186faa0
9 changed files with 32 additions and 18 deletions

View File

@ -87,7 +87,7 @@ def get_remote_signatures(mods: list[str]) -> list[tuple[str, str, int, int]]:
return hashes
# 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
def connect(addr: str, appid: int, name: str, mods: list[str]) -> None:
concat = concat_mods(mods)

View File

@ -1,6 +1,7 @@
import shutil
# import shutil
from pathlib import Path
def uninstall(path: Path) -> None:
pass
# TODO: use xdg object?

View File

@ -4,7 +4,7 @@ import subprocess
import sys
from importlib import resources
from packaging.version import Version, InvalidVersion
from packaging.version import Version
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, REQUEST_TIMEOUT
from dzgui.const.endpoints import GITHUB_RELEASES, CODEBERG_RELEASES

View File

@ -28,6 +28,8 @@ from dzgui.init.prereqs import has_steam_client
from dzgui.init.proc import has_cmd
from dzgui.init.update import allow_updates, check_updates
from dzgui.strings import init
from dzgui.util.map_count import get_map_count
from dzgui.util.deck import is_steam_deck, is_game_mode
from dzgui.util.localize import set_locale
@ -126,7 +128,7 @@ def main() -> None:
if _is_steam_deck is False:
# TODO: sudo escalation dialog
count = get_map_count()
# count = get_map_count()
# TODO: move into module
if has_steam_client() is False:
EarlyAlertDialog(init.requires_steam)
@ -147,7 +149,6 @@ def main() -> None:
tool = cmd
break
# TODO: push is_game_mode to preconnect dialog
prefs = UserPrefs(
is_steam_deck=_is_steam_deck,
is_game_mode=_is_game_mode,
@ -160,6 +161,5 @@ def main() -> None:
foreground_cmd=tool,
)
# TODO: drop allow updates
# TODO: strings
print("All OK. Loading UI...")
print(init.all_ok)
App(prefs)

View File

@ -30,10 +30,9 @@ from dzgui.const.constants import (
APPID_DAYZ_EXP,
APPNAME_DAYZ,
APPNAME_DAYZ_EXP,
DAYZ_BINARY,
)
from dzgui.const.enum import NotebookPage, Preferences
from dzgui.init.proc import foreground, is_dayz_running, is_steam_running, is_running
from dzgui.init.proc import foreground, is_dayz_running, is_steam_running
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
from dzgui.strings.dialogs import waiting_for_launch, waiting_for_mods
from dzgui.strings.server_mods import checkmark, resync

View File

@ -1,8 +1,12 @@
from typing import Callable, Literal, Self, TYPE_CHECKING
from typing import Callable, Self, TYPE_CHECKING
from dzgui.util.clip import copy_clipboard
from dzgui.util.format import pluralize
from dzgui.util.strings import alert_button_tooltip, atomic_buttons, connect_panel
from dzgui.util.strings import (
alert_button_tooltip,
atomic_buttons,
connect_panel,
)
from dzgui.const.constants import (
CLIPBOARD,
INPUT_KEYBOARD,
@ -163,6 +167,12 @@ class SteamTextButton(SteamConnectButton):
self.set_label(label)
class SteamWorkshopButton(SteamTextButton):
def __init__(self) -> None:
super().__init__(label="Steam Workshop")
self.set_tooltip_text("connect to workshop")
class AddButton(IconTextButton):
def __init__(self) -> None:
super().__init__(icon=LIST_ADD, label=connect_panel.add)

View File

@ -50,8 +50,6 @@ class WorkshopLinkDialog(GenericDialog):
def _on_button_clicked(self, button: Gtk.Button, uid: str) -> None:
# TODO: currently checks user id on instantiation
self.controller.open_user_workshop(uid)
# client = self.controller.query_config(Preferences.CLIENT)
# open_user_workshop(uid, client)
def _on_dialog_response(self, dialog: Self, resp: Gtk.ResponseType) -> None:
match resp:

View File

@ -145,11 +145,18 @@ class Options(Gtk.Box):
self.force_button.set_sensitive(False)
eb = InfoEventBox(strings.options.dl_eventbox, controller)
eb2 = InfoEventBox(strings.options.force_eventbox, controller)
# eb2 = InfoEventBox(strings.options.force_eventbox, controller)
from dzgui.views.components.buttons import SteamWorkshopButton
workshop_button = SteamWorkshopButton() # label=strings.self_workshop)
workshop_button.connect(
"clicked", lambda _: self.controller.open_user_workshop(self.uid)
)
mod_rows = [
[LeftLabel(strings.options.install_mode), self.mod_install_toggle, eb],
[LeftLabel(strings.options.force_update), self.force_button, eb2],
[LeftLabel("Steam Workshop"), workshop_button, eb],
# [LeftLabel(strings.options.install_mode), self.mod_install_toggle, eb],
# [LeftLabel(strings.options.force_update), self.force_button, eb2],
]
self.dayz_version_label = Gtk.Label(label=strings.null)

View File

@ -21,7 +21,6 @@ def keys():
"fav_server",
"fav_label",
"name",
"branch",
"fullscreen",
"steam_api",
"auto_install",
@ -29,7 +28,7 @@ def keys():
"client",
"ip_list",
"use_miles",
"start_tab"
"start_tab",
]