chore: abstract developers and thanks page

This commit is contained in:
aclist committed 2026-11-22 14:06:39 +09:00
1 parent 17dedd79a7
commit 417801ac41
6 files changed
+25 -60

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
page_header = "Developers"
paths_label="Resolved XDG paths",
prefs_label="Boot preferences",
columns=["Key", "Value"]
+2
View File
@@ -0,0 +1,2 @@
debug_picker_title = "Save the debug log to a file"
diagnostic_picker_title = "Save system diagnostics to a file"
+1 -53
View File
@@ -1,11 +1,5 @@
from dataclasses import dataclass from dataclasses import dataclass
@dataclass(slots=True, frozen=True)
class DevelopersPage:
header: str
paths_label: str
prefs_label: str
columns: list[str]
@dataclass(slots=True, frozen=True) @dataclass(slots=True, frozen=True)
class ServerLabels: class ServerLabels:
@@ -32,6 +26,7 @@ class Flags:
debug: str debug: str
map_count: str map_count: str
@dataclass(slots=True, frozen=True) @dataclass(slots=True, frozen=True)
class ModPanelStrings: class ModPanelStrings:
header: str header: str
@@ -103,13 +98,6 @@ class Crumbs:
connect: str connect: str
@dataclass(slots=True, frozen=True)
class Thanks:
header: str
description: str
users: list[str]
@dataclass(slots=True, frozen=True) @dataclass(slots=True, frozen=True)
class Options: class Options:
header: str header: str
@@ -271,8 +259,6 @@ self_workshop = "Open Steam workshop"
settings_updated = "Settings updated!" settings_updated = "Settings updated!"
init = Init( init = Init(
is_steam_running="Is Steam running? DZGUI must be run on top of Steam.", is_steam_running="Is Steam running? DZGUI must be run on top of Steam.",
is_dayz_running="Is DayZ already running? DZGUI cannot launch DayZ if another process is using it.", is_dayz_running="Is DayZ already running? DZGUI cannot launch DayZ if another process is using it.",
@@ -302,33 +288,6 @@ mod_panel = ModPanelStrings(
validate_tooltip="Validates selected mods and updates them if necessary", validate_tooltip="Validates selected mods and updates them if necessary",
) )
thanks = Thanks(
header="# Special thanks",
description=(
"This page recognizes beta testers, collaborators, code "
"contributors, and sponsors of the project in alphabetical order.\n"
"If you wish to be removed from this list, please submit a ticket."
),
users=[
"bongjutsu",
"Deku",
"dj3hac",
"finntux",
"GaryBlackbourne",
"jiriks74",
"Johnofwrong",
"MatheusLasserr",
"nolan-perez",
"OnniSaarni",
"scandalouss",
"SnackSBR",
"StevelDusa",
"Thoughtduck216",
],
)
options = Options( options = Options(
header="Options", header="Options",
steam_web="Steam API page", steam_web="Steam API page",
@@ -401,7 +360,6 @@ no_mods = "No local mods found."
no_servers = "No server metadata to list." no_servers = "No server metadata to list."
flags = Flags( flags = Flags(
description="DayZ server browser and mod manager", description="DayZ server browser and mod manager",
version="print version information", version="print version information",
@@ -416,16 +374,6 @@ api_error = (
) )
developers = DevelopersPage(
header="Developers",
paths_label="Resolved XDG paths",
prefs_label="Boot preferences",
columns=["Key", "Value"],
)
server_labels = ServerLabels( server_labels = ServerLabels(
browser="Server Browser", browser="Server Browser",
saved="Saved Servers", saved="Saved Servers",
+15 -4
View File
@@ -1,6 +1,7 @@
from pathlib import Path from pathlib import Path
from dzgui.util.strings import picker from dzgui.const.constants import DEBUG_LOG, SYSTEM_LOG
from dzgui.strings.filepickers import diagnostic_picker_title, debug_picker_title
import gi import gi
@@ -9,9 +10,9 @@ from gi.repository import Gtk
class FilePicker(Gtk.FileChooserDialog): class FilePicker(Gtk.FileChooserDialog):
def __init__(self, parent: Gtk.Window) -> None: def __init__(self, parent: Gtk.Window, title: str, placeholder: str) -> None:
super().__init__( super().__init__(
title=picker.title, title=title,
action=Gtk.FileChooserAction.SAVE, action=Gtk.FileChooserAction.SAVE,
transient_for=parent, transient_for=parent,
resizable=True, resizable=True,
@@ -20,7 +21,7 @@ class FilePicker(Gtk.FileChooserDialog):
self.add_buttons("_Save", Gtk.ResponseType.OK) # type: ignore[no-untyped-call] self.add_buttons("_Save", Gtk.ResponseType.OK) # type: ignore[no-untyped-call]
self.set_default_response(Gtk.ResponseType.OK) self.set_default_response(Gtk.ResponseType.OK)
self.set_current_name(picker.placeholder) self.set_current_name(placeholder)
def pick_file(self) -> Path | None: def pick_file(self) -> Path | None:
res = self.run() # type: ignore[no-untyped-call] res = self.run() # type: ignore[no-untyped-call]
@@ -35,6 +36,16 @@ class FilePicker(Gtk.FileChooserDialog):
return None return None
class DiagnosticLogPicker(FilePicker):
def __init__(self, parent: Gtk.Window) -> None:
super().__init__(parent, diagnostic_picker_title, SYSTEM_LOG)
class DebugLogPicker(FilePicker):
def __init__(self, parent: Gtk.Window) -> None:
super().__init__(parent, debug_picker_title, DEBUG_LOG)
class FolderPicker(Gtk.FileChooserDialog): class FolderPicker(Gtk.FileChooserDialog):
def __init__(self, parent: Gtk.Window, title: str) -> None: def __init__(self, parent: Gtk.Window, title: str) -> None:
super().__init__( super().__init__(
+2 -2
View File
@@ -3,7 +3,7 @@ from typing import Self, Union, TYPE_CHECKING
from dzgui.const.enum import NotebookPage from dzgui.const.enum import NotebookPage
from dzgui.util.css import add_class from dzgui.util.css import add_class
from dzgui.util.strings import developers from dzgui.strings import developers
from dzgui.views.components.labels import BoldLabel from dzgui.views.components.labels import BoldLabel
from dzgui.views.trees.tree_base import TreeView from dzgui.views.trees.tree_base import TreeView
@@ -32,7 +32,7 @@ class Developers(Gtk.ScrolledWindow):
orientation=Gtk.Orientation.VERTICAL, margin_start=10, margin_end=10 orientation=Gtk.Orientation.VERTICAL, margin_start=10, margin_end=10
) )
heading = Gtk.Label(label=developers.header) heading = Gtk.Label(label=developers.page_header)
heading.set_halign(Gtk.Align.CENTER) heading.set_halign(Gtk.Align.CENTER)
add_class(heading, "page-heading") add_class(heading, "page-heading")
+1 -1
View File
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from dzgui.util.format import format_pango from dzgui.util.format import format_pango
from dzgui.util.strings import thanks from dzgui.strings import thanks
from dzgui.views.mixins.help_menu_mixin import HelpMenuMixin from dzgui.views.mixins.help_menu_mixin import HelpMenuMixin
from dzgui.views.mixins.scrollable_mixin import ScrollableMixin from dzgui.views.mixins.scrollable_mixin import ScrollableMixin