mirror of
https://github.com/aclist/dztui.git
synced 2026-11-22 09:29:31 +01:00
chore: abstract developers and thanks page
This commit is contained in:
1 parent
17dedd79a7
commit
417801ac41
6 files changed
+25
-60
No files matched your search
@@ -0,0 +1,4 @@
|
||||
page_header = "Developers"
|
||||
paths_label="Resolved XDG paths",
|
||||
prefs_label="Boot preferences",
|
||||
columns=["Key", "Value"]
|
||||
@@ -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
@@ -1,11 +1,5 @@
|
||||
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)
|
||||
class ServerLabels:
|
||||
@@ -32,6 +26,7 @@ class Flags:
|
||||
debug: str
|
||||
map_count: str
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class ModPanelStrings:
|
||||
header: str
|
||||
@@ -103,13 +98,6 @@ class Crumbs:
|
||||
connect: str
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Thanks:
|
||||
header: str
|
||||
description: str
|
||||
users: list[str]
|
||||
|
||||
|
||||
@dataclass(slots=True, frozen=True)
|
||||
class Options:
|
||||
header: str
|
||||
@@ -271,8 +259,6 @@ self_workshop = "Open Steam workshop"
|
||||
settings_updated = "Settings updated!"
|
||||
|
||||
|
||||
|
||||
|
||||
init = Init(
|
||||
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.",
|
||||
@@ -302,33 +288,6 @@ mod_panel = ModPanelStrings(
|
||||
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(
|
||||
header="Options",
|
||||
steam_web="Steam API page",
|
||||
@@ -401,7 +360,6 @@ no_mods = "No local mods found."
|
||||
no_servers = "No server metadata to list."
|
||||
|
||||
|
||||
|
||||
flags = Flags(
|
||||
description="DayZ server browser and mod manager",
|
||||
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(
|
||||
browser="Server Browser",
|
||||
saved="Saved Servers",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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
|
||||
|
||||
@@ -9,9 +10,9 @@ from gi.repository import Gtk
|
||||
|
||||
|
||||
class FilePicker(Gtk.FileChooserDialog):
|
||||
def __init__(self, parent: Gtk.Window) -> None:
|
||||
def __init__(self, parent: Gtk.Window, title: str, placeholder: str) -> None:
|
||||
super().__init__(
|
||||
title=picker.title,
|
||||
title=title,
|
||||
action=Gtk.FileChooserAction.SAVE,
|
||||
transient_for=parent,
|
||||
resizable=True,
|
||||
@@ -20,7 +21,7 @@ class FilePicker(Gtk.FileChooserDialog):
|
||||
self.add_buttons("_Save", Gtk.ResponseType.OK) # type: ignore[no-untyped-call]
|
||||
self.set_default_response(Gtk.ResponseType.OK)
|
||||
|
||||
self.set_current_name(picker.placeholder)
|
||||
self.set_current_name(placeholder)
|
||||
|
||||
def pick_file(self) -> Path | None:
|
||||
res = self.run() # type: ignore[no-untyped-call]
|
||||
@@ -35,6 +36,16 @@ class FilePicker(Gtk.FileChooserDialog):
|
||||
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):
|
||||
def __init__(self, parent: Gtk.Window, title: str) -> None:
|
||||
super().__init__(
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Self, Union, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import NotebookPage
|
||||
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.trees.tree_base import TreeView
|
||||
|
||||
@@ -32,7 +32,7 @@ class Developers(Gtk.ScrolledWindow):
|
||||
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)
|
||||
add_class(heading, "page-heading")
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
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.scrollable_mixin import ScrollableMixin
|
||||
|
||||
|
||||
Reference in new issue
Block a user