chore: abstract mod panel strings

This commit is contained in:
aclist committed 2026-11-22 15:02:20 +09:00
1 parent f2025dd48d
commit d4c4268eaa
3 files changed
+32 -58

No files matched your search

+12 -15
View File
@@ -2,9 +2,10 @@ from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from dzgui.strings import mod_panel
from dzgui.strings import rows
from dzgui.strings import side_buttons
from dzgui.util import strings
from dzgui.strings import rows
class Port(Enum):
@@ -227,29 +228,25 @@ class RowType(Enum):
class ModButton(Enum):
SELECT_ALL = ModButtonMeta(
strings.mod_panel.select_all, strings.mod_panel.select_all_tooltip
)
UNSELECT_ALL = ModButtonMeta(
strings.mod_panel.unselect_all, strings.mod_panel.unselect_all_tooltip
)
SELECT_ALL = ModButtonMeta(mod_panel.select_all, mod_panel.select_all_tooltip)
UNSELECT_ALL = ModButtonMeta(mod_panel.unselect_all, mod_panel.unselect_all_tooltip)
HIGHLIGHT_STALE = ModButtonMeta(
strings.mod_panel.highlight_stale, strings.mod_panel.highlight_stale_tooltip
mod_panel.highlight_stale, mod_panel.highlight_stale_tooltip
)
UNHIGHLIGHT_STALE = ModButtonMeta(
strings.mod_panel.unhighlight_stale, strings.mod_panel.unhighlight_stale_tooltip
mod_panel.unhighlight_stale, mod_panel.unhighlight_stale_tooltip
)
UNSUB_SELECTED = ModButtonMeta(
strings.mod_panel.unsub_selected,
strings.mod_panel.unsub_selected_tooltip,
mod_panel.unsub_selected,
mod_panel.unsub_selected_tooltip,
)
SELECT_STALE = ModButtonMeta(
strings.mod_panel.select_stale,
strings.mod_panel.select_stale_tooltip,
mod_panel.select_stale,
mod_panel.select_stale_tooltip,
)
VALIDATE = ModButtonMeta(
strings.mod_panel.validate,
strings.mod_panel.validate_tooltip,
mod_panel.validate,
mod_panel.validate_tooltip,
)
@property
+20
View File
@@ -0,0 +1,20 @@
bulk_select = "Bulk selects all currently highlighted mods"
clear_highlights = "Clears highlights and reverts the table to a default state"
header = "Mod actions"
highlight_stale = "Highlight stale"
highlight_stale_tooltip = (
"Shows locally-installed mods which are not \n"
"used by any server in your Saved Servers"
)
select_all = "Select all"
select_all_tooltip = "Bulk selects all mods"
select_stale = "Select stale"
select_stale_tooltip = "Only selects highlighted stale mods"
unhighlight_stale = "Unhighlight stale"
unhighlight_stale_tooltip = "Clears highlight from stale mods"
unselect_all = "Unselect all"
unselect_all_tooltip = "Bulk unselects all mods"
unsub_selected = "Unsubscribe selected"
unsub_selected_tooltip = "Unsubscribes from selected mods"
validate = "Validate selected"
validate_tooltip = "Validates selected mods and updates them if necessary"
-43
View File
@@ -9,27 +9,6 @@ class ServerLabels:
lan: str
@dataclass(slots=True, frozen=True)
class ModPanelStrings:
header: str
unhighlight_stale: str
unhighlight_stale_tooltip: str
highlight_stale: str
highlight_stale_tooltip: str
unsub_selected: str
unsub_selected_tooltip: str
unselect_all: str
unselect_all_tooltip: str
select_all: str
select_all_tooltip: str
bulk_select: str
clear_highlights: str
select_stale: str
select_stale_tooltip: str
validate: str
validate_tooltip: str
@dataclass(slots=True, frozen=True)
class Dialog:
querying: str
@@ -233,28 +212,6 @@ init = Init(
requires_steam="Your chosen client (Steam/Flatpak Steam) must be installed on the system.",
)
mod_panel = ModPanelStrings(
header="Mod actions",
unhighlight_stale="Unhighlight stale",
unhighlight_stale_tooltip="Clears highlight from stale mods",
highlight_stale="Highlight stale",
highlight_stale_tooltip=(
"Shows locally-installed mods which are not \n"
"used by any server in your Saved Servers"
),
unsub_selected="Unsubscribe selected",
unsub_selected_tooltip="Unsubscribes from selected mods",
unselect_all="Unselect all",
unselect_all_tooltip="Bulk unselects all mods",
select_all="Select all",
select_all_tooltip="Bulk selects all mods",
bulk_select="Bulk selects all currently highlighted mods",
clear_highlights="Clears highlights and reverts the table to a default state",
select_stale="Select stale",
select_stale_tooltip="Only selects highlighted stale mods",
validate="Validate selected",
validate_tooltip="Validates selected mods and updates them if necessary",
)
options = Options(
header="Options",