From 5da4d16ed8fa5f2ff9cbcb945195f0835f257f80 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:23:38 +0900 Subject: [PATCH] feat: add tooltips --- CHANGELOG.md | 15 ++++++++++++ README.md | 17 ++++++++------ dzgui.sh | 6 ++--- helpers/funcs | 23 ++++++++----------- helpers/ui.py | 63 +++++++++++++++++++++++++++++++-------------------- 5 files changed, 76 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14a1345..620e8f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [5.6.0-beta.21] 2024-01-06 +### Added +- Add in-app documentation link to Codeberg mirror +- Hover tooltips to most buttons +### Fixed +- Prevent ArrowUp/ArrowDown input when inside keyword field +### Changed +- Update forum URL +- Reword Help section links to include destination +- Update README.md +### Dropped +- Removed temporary mod ID output in debug logs +- Removed Hall of Fame section from button links, moved inside documentation +- Remove unused imports + ## [5.6.0-beta.20] 2024-12-23 ### Added - Output real and resolved mod ids to logs (temporary) diff --git a/README.md b/README.md index d6cf770..93f8559 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,19 @@ ## What this is -DZGUI allows you to connect to both official and modded/community DayZ servers on Linux and provides a graphical interface for doing so. This overcomes certain limitations in the Linux client and helps prepare the game to launch by doing the following: +DZGUI allows you to connect to both official and modded/community DayZ servers on Linux and provides a graphical interface for doing so. -1. Search for and display server metadata in a table (server name, player count, ping, current gametime, distance, IP) +This overcomes certain limitations in the Linux client and helps prepare the game to launch by providing the following: + +1. Search for and display server metadata in a table (server name, player count, ping, queue size, current gametime, distance, IP) 2. Add/delete/manage favorite servers by IP or ID -3. Find and prepare mods being requested by the server (choose from manual or automatic installation) -4. Concatenate launch options to pass to Steam - -Other options include the ability to connect by IP or ID or set a favorite server. +3. Quick-connect to favorite/recent servers +4. Find and prepare mods being requested by servers (choose from manual or automatic installation) +5. Bulk delete/update local mods +6. Concatenate launch options to pass to Steam +7. Connect to mod-enabled LAN servers ## Setup and usage -Refer to the [manual](https://aclist.codeberg.page) for installation and setup instructions, a feature-by-feature breakdown, and Steam integration tutorials. +Refer to the [manual](https://aclist.codeberg.page) for installation and setup instructions. ![Alt text](/images/example.png) diff --git a/dzgui.sh b/dzgui.sh index 2d3b184..e9e2a12 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.6.0-beta.20 +version=5.6.0-beta.21 #CONSTANTS aid=221100 @@ -584,10 +584,10 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="99544ccef6060125509c4b689a808a15" + ["ui.py"]="a2f9134c9b415a2be1d54a7e91065ee0" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="5d69e8e3d7c3b3c499354b0b939ce76b" + ["funcs"]="b928622aa16e966a5098df02bce6dc3b" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" diff --git a/helpers/funcs b/helpers/funcs index ea965b3..b669fc5 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -79,7 +79,8 @@ stable_url="$url_prefix/dzgui" testing_url="$url_prefix/testing" releases_url="$gh_prefix/$author/$repo/releases/download/browser" help_url="https://$author.github.io/dzgui/dzgui" -forum_url="$gh_prefix/$author/$repo/discussions" +help_url2="https://$author.codeberg.page" +forum_url="https://old.reddit.com/r/dzgui" sponsor_url="$gh_prefix/sponsors/$author" battlemetrics_server_url="https://www.battlemetrics.com/servers/dayz" steam_api_url="https://steamcommunity.com/dev/apikey" @@ -1104,21 +1105,21 @@ open_link(){ "Open Battlemetrics API page") url="$battlemetrics_api_url" ;; - "Help file ⧉") + "Documentation/help files (GitHub) ⧉") url="$help_url" ;; - "Report a bug ⧉") + "Documentation/help files (Codeberg mirror) ⧉") + url="$help_url2" + ;; + "Report a bug (GitHub) ⧉") url="$issues_url" ;; - "Forum ⧉") + "DZGUI Subreddit ⧉") url="$forum_url" ;; - "Sponsor ⧉") + "Sponsor (GitHub) ⧉") url="$sponsor_url" ;; - "Hall of fame ⧉") - url="${help_url}#_hall_of_fame" - ;; esac #if [[ $is_steam_deck -eq 1 ]]; then @@ -1167,12 +1168,6 @@ $(print_ip_list | sed 's/"//g') Mods: $(list_mods | sed 's/^/\t/g') DOC - #2024-12-13 - find $workshop_dir -mindepth 1 -maxdepth 1 -type d | awk -F/ '{print $NF}' | sort > "$mod_log" - find $workshop_dir -mindepth 1 -name meta.cpp | while read -r line; do - cat "$line" | awk '/publishedid/ {print $3}' | sed 's/;//g;s/\r//g' - done | sort > "$meta_log" - #END printf "Wrote system log to %s" "$system_log" return 0 } diff --git a/helpers/ui.py b/helpers/ui.py index 38abd1b..02fe315 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -1,22 +1,21 @@ import csv -import gi import json import locale import logging -import math import multiprocessing import os -import re import signal import subprocess import sys import textwrap import threading +from enum import Enum locale.setlocale(locale.LC_ALL, '') + +import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GLib, Gdk, GObject, Pango -from enum import Enum # 5.6.0 app_name = "DZGUI" @@ -274,25 +273,25 @@ class RowType(EnumWithAttrs): "quad_label": "Debug log" } DOCS = { - "label": "Help file ⧉", + "label": "Documentation/help files (GitHub) ⧉", + "tooltip": "Opens the DZGUI documentation in a browser" + } + DOCS_FALLBACK = { + "label": "Documentation/help files (Codeberg mirror) ⧉", "tooltip": "Opens the DZGUI documentation in a browser" } BUGS = { - "label": "Report a bug ⧉", + "label": "Report a bug (GitHub) ⧉", "tooltip": "Opens the DZGUI issue tracker in a browser" } FORUM = { - "label": "Forum ⧉", + "label": "DZGUI Subreddit ⧉", "tooltip": "Opens the DZGUI discussion forum in a browser" } SPONSOR = { - "label": "Sponsor ⧉", + "label": "Sponsor (GitHub) ⧉", "tooltip": "Sponsor the developer of DZGUI" } - HOF = { - "label": "Hall of fame ⧉", - "tooltip": "A list of significant contributors and testers" - } class WindowContext(EnumWithAttrs): @@ -353,10 +352,10 @@ class WindowContext(EnumWithAttrs): RowType.CHANGELOG, RowType.SHOW_LOG, RowType.DOCS, + RowType.DOCS_FALLBACK, RowType.BUGS, RowType.FORUM, RowType.SPONSOR, - RowType.HOF ], "called_by": [] } @@ -416,19 +415,24 @@ class Popup(Enum): class ButtonType(EnumWithAttrs): MAIN_MENU = {"label": "Main menu", - "opens": WindowContext.MAIN_MENU + "opens": WindowContext.MAIN_MENU, + "tooltip": "Search for and connect to servers" } MANAGE = {"label": "Manage", - "opens": WindowContext.MANAGE + "opens": WindowContext.MANAGE, + "tooltip": "Manage/add to saved servers" } OPTIONS = {"label": "Options", - "opens": WindowContext.OPTIONS + "opens": WindowContext.OPTIONS, + "tooltip": "Change settings, list local mods and\nother advanced options" } HELP = {"label": "Help", - "opens": WindowContext.HELP + "opens": WindowContext.HELP, + "tooltip": "Links to documentation" } EXIT = {"label": "Exit", - "opens": None + "opens": None, + "tooltip": "Quits the application" } @@ -906,12 +910,15 @@ class RightPanel(Gtk.Box): self.pack_start(self.filters_vbox, False, False, 0) self.debug_toggle = Gtk.ToggleButton(label="Debug mode") + self.debug_toggle.set_tooltip_text("Used to perform a dry run without\nactually connecting to a server") + if query_config(None, "debug")[0] == '1': self.debug_toggle.set_active(True) self.debug_toggle.connect("toggled", self._on_button_toggled, "Toggle debug mode") set_surrounding_margins(self.debug_toggle, 10) self.question_button = Gtk.Button(label="?") + self.question_button.set_tooltip_text("Opens the keybindings dialog") self.question_button.set_margin_top(10) self.question_button.set_margin_start(50) self.question_button.set_margin_end(50) @@ -954,6 +961,8 @@ class ButtonBox(Gtk.Box): for side_button in ButtonType: button = EnumeratedButton(label=side_button.dict["label"]) button.set_property("button_type", side_button) + button.set_tooltip_text(side_button.dict["tooltip"]) + if is_steam_deck is True: button.set_size_request(10, 10) else: @@ -2436,16 +2445,17 @@ class ModSelectionPanel(Gtk.Box): self.set_orientation(Gtk.Orientation.VERTICAL) labels = [ - "Select all", - "Unselect all", - "Delete selected", - "Highlight stale" + ["label": "Select all", "tooltip": "Bulk selects all mods"], + ["label": "Unselect all", "tooltip": "Bulk unselects all mods"], + ["label": "Delete selected", "tooltip": "Deletes selected mods from the system"], + ["label": "Highlight stale", "tooltip": "Shows locally-installed mods\nwhich are not used by any server\nin your Saved Servers"] ] self.active_button = None for l in labels: - button = Gtk.Button(label=l) + button = Gtk.Button(label=l["label"]) + button.set_tooltip_text(l["tooltip"]) button.set_margin_start(10) button.set_margin_end(10) button.connect("clicked", self._on_button_clicked) @@ -2505,6 +2515,7 @@ class ModSelectionPanel(Gtk.Box): def toggle_select_stale_button(self, bool): if bool is True: button = Gtk.Button(label="Select stale") + button.set_tooltip_text("Bulk selects all currently highlighted mods") button.set_margin_start(10) button.set_margin_end(10) button.connect("clicked", self._on_button_clicked) @@ -2521,7 +2532,6 @@ class ModSelectionPanel(Gtk.Box): (model, pathlist) = treeview.get_selection().get_selected_rows() if bool is False: - default = None for i in range (0, len(mod_store)): path = Gtk.TreePath(i) it = mod_store.get_iter(path) @@ -2540,6 +2550,7 @@ class ModSelectionPanel(Gtk.Box): _colorize(path, red) treeview.toggle_selection(False) self.active_button.set_label("Unhighlight stale") + self.active_button.set_tooltip_text("Clears highlights and reverts\nthe table to a default state") def _iterate_mod_deletion(self, model, pathlist, ct): @@ -2667,6 +2678,10 @@ class FilterPanel(Gtk.Box): match event.keyval: case Gdk.KEY_Escape: GLib.idle_add(self.restore_focus_to_treeview) + case Gdk.KEY_Up: + return True + case Gdk.KEY_Down: + return True case _: return False