mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
feat: abstract base server dialog
This commit is contained in:
1 parent
6393265935
commit
55e6af8fe2
11 files changed
+110
-112
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import re
|
||||
|
||||
from dzgui.util.localize import number
|
||||
from dzgui.util.strings import no_mods, no_servers
|
||||
from dzgui.util.strings import no_mods, no_servers, workshop
|
||||
|
||||
import gi
|
||||
|
||||
@@ -51,6 +51,11 @@ def format_mods(size: int, mods: int) -> str:
|
||||
return f"Found {mods:n} {plural} taking up {l_size} MiB. {suffix}"
|
||||
|
||||
|
||||
def format_server_mods(mods: int) -> str:
|
||||
plural = pluralize("mods", mods)
|
||||
return f"Found {mods:n} {plural}. {workshop}"
|
||||
|
||||
|
||||
def format_player_count(model: Gtk.TreeModel | None, control: list) -> str:
|
||||
players = 0
|
||||
hits: int
|
||||
@@ -66,7 +71,9 @@ def format_player_count(model: Gtk.TreeModel | None, control: list) -> str:
|
||||
players_pretty = pluralize("players", players)
|
||||
hidden = control_total - hits
|
||||
hidden_pretty = f" ({hidden:n} hidden)" if hidden > 0 else ""
|
||||
status = f"Showing {hits:n} {hits_pretty}{hidden_pretty}, {players:n} {players_pretty}."
|
||||
status = (
|
||||
f"Showing {hits:n} {hits_pretty}{hidden_pretty}, {players:n} {players_pretty}."
|
||||
)
|
||||
return status
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ _id = "ID"
|
||||
add_note = "Add note"
|
||||
edit_note = "Edit note"
|
||||
show_mods = "Show server-side mods"
|
||||
show_details = "Server details"
|
||||
show_details = "Show server details"
|
||||
refresh_players = "Refresh player count"
|
||||
open_workshop = "Open in Steam Workshop"
|
||||
delete_mod = "Delete mod"
|
||||
|
||||
Reference in new issue
Block a user