1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2025-01-17 14:28:05 +01:00

feat: add tooltips

This commit is contained in:
aclist 2025-01-06 17:23:38 +09:00
parent 2158635e64
commit 5da4d16ed8
5 changed files with 76 additions and 48 deletions

View file

@ -1,5 +1,20 @@
# Changelog # 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 ## [5.6.0-beta.20] 2024-12-23
### Added ### Added
- Output real and resolved mod ids to logs (temporary) - Output real and resolved mod ids to logs (temporary)

View file

@ -1,16 +1,19 @@
## What this is ## 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 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) 3. Quick-connect to favorite/recent servers
4. Concatenate launch options to pass to Steam 4. Find and prepare mods being requested by servers (choose from manual or automatic installation)
5. Bulk delete/update local mods
Other options include the ability to connect by IP or ID or set a favorite server. 6. Concatenate launch options to pass to Steam
7. Connect to mod-enabled LAN servers
## Setup and usage ## 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) ![Alt text](/images/example.png)

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -o pipefail set -o pipefail
version=5.6.0-beta.20 version=5.6.0-beta.21
#CONSTANTS #CONSTANTS
aid=221100 aid=221100
@ -584,10 +584,10 @@ fetch_helpers_by_sum(){
[[ -f "$config_file" ]] && source "$config_file" [[ -f "$config_file" ]] && source "$config_file"
declare -A sums declare -A sums
sums=( sums=(
["ui.py"]="99544ccef6060125509c4b689a808a15" ["ui.py"]="a2f9134c9b415a2be1d54a7e91065ee0"
["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
["funcs"]="5d69e8e3d7c3b3c499354b0b939ce76b" ["funcs"]="b928622aa16e966a5098df02bce6dc3b"
["lan"]="c62e84ddd1457b71a85ad21da662b9af" ["lan"]="c62e84ddd1457b71a85ad21da662b9af"
) )
local author="aclist" local author="aclist"

View file

@ -79,7 +79,8 @@ stable_url="$url_prefix/dzgui"
testing_url="$url_prefix/testing" testing_url="$url_prefix/testing"
releases_url="$gh_prefix/$author/$repo/releases/download/browser" releases_url="$gh_prefix/$author/$repo/releases/download/browser"
help_url="https://$author.github.io/dzgui/dzgui" 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" sponsor_url="$gh_prefix/sponsors/$author"
battlemetrics_server_url="https://www.battlemetrics.com/servers/dayz" battlemetrics_server_url="https://www.battlemetrics.com/servers/dayz"
steam_api_url="https://steamcommunity.com/dev/apikey" steam_api_url="https://steamcommunity.com/dev/apikey"
@ -1104,21 +1105,21 @@ open_link(){
"Open Battlemetrics API page") "Open Battlemetrics API page")
url="$battlemetrics_api_url" url="$battlemetrics_api_url"
;; ;;
"Help file ⧉") "Documentation/help files (GitHub) ⧉")
url="$help_url" url="$help_url"
;; ;;
"Report a bug ⧉") "Documentation/help files (Codeberg mirror) ⧉")
url="$help_url2"
;;
"Report a bug (GitHub) ⧉")
url="$issues_url" url="$issues_url"
;; ;;
"Forum ⧉") "DZGUI Subreddit ⧉")
url="$forum_url" url="$forum_url"
;; ;;
"Sponsor ⧉") "Sponsor (GitHub) ⧉")
url="$sponsor_url" url="$sponsor_url"
;; ;;
"Hall of fame ⧉")
url="${help_url}#_hall_of_fame"
;;
esac esac
#if [[ $is_steam_deck -eq 1 ]]; then #if [[ $is_steam_deck -eq 1 ]]; then
@ -1167,12 +1168,6 @@ $(print_ip_list | sed 's/"//g')
Mods: Mods:
$(list_mods | sed 's/^/\t/g') $(list_mods | sed 's/^/\t/g')
DOC 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" printf "Wrote system log to %s" "$system_log"
return 0 return 0
} }

View file

@ -1,22 +1,21 @@
import csv import csv
import gi
import json import json
import locale import locale
import logging import logging
import math
import multiprocessing import multiprocessing
import os import os
import re
import signal import signal
import subprocess import subprocess
import sys import sys
import textwrap import textwrap
import threading import threading
from enum import Enum
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib, Gdk, GObject, Pango from gi.repository import Gtk, GLib, Gdk, GObject, Pango
from enum import Enum
# 5.6.0 # 5.6.0
app_name = "DZGUI" app_name = "DZGUI"
@ -274,25 +273,25 @@ class RowType(EnumWithAttrs):
"quad_label": "Debug log" "quad_label": "Debug log"
} }
DOCS = { 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" "tooltip": "Opens the DZGUI documentation in a browser"
} }
BUGS = { BUGS = {
"label": "Report a bug ⧉", "label": "Report a bug (GitHub)",
"tooltip": "Opens the DZGUI issue tracker in a browser" "tooltip": "Opens the DZGUI issue tracker in a browser"
} }
FORUM = { FORUM = {
"label": "Forum", "label": "DZGUI Subreddit",
"tooltip": "Opens the DZGUI discussion forum in a browser" "tooltip": "Opens the DZGUI discussion forum in a browser"
} }
SPONSOR = { SPONSOR = {
"label": "Sponsor", "label": "Sponsor (GitHub)",
"tooltip": "Sponsor the developer of DZGUI" "tooltip": "Sponsor the developer of DZGUI"
} }
HOF = {
"label": "Hall of fame ⧉",
"tooltip": "A list of significant contributors and testers"
}
class WindowContext(EnumWithAttrs): class WindowContext(EnumWithAttrs):
@ -353,10 +352,10 @@ class WindowContext(EnumWithAttrs):
RowType.CHANGELOG, RowType.CHANGELOG,
RowType.SHOW_LOG, RowType.SHOW_LOG,
RowType.DOCS, RowType.DOCS,
RowType.DOCS_FALLBACK,
RowType.BUGS, RowType.BUGS,
RowType.FORUM, RowType.FORUM,
RowType.SPONSOR, RowType.SPONSOR,
RowType.HOF
], ],
"called_by": [] "called_by": []
} }
@ -416,19 +415,24 @@ class Popup(Enum):
class ButtonType(EnumWithAttrs): class ButtonType(EnumWithAttrs):
MAIN_MENU = {"label": "Main menu", MAIN_MENU = {"label": "Main menu",
"opens": WindowContext.MAIN_MENU "opens": WindowContext.MAIN_MENU,
"tooltip": "Search for and connect to servers"
} }
MANAGE = {"label": "Manage", MANAGE = {"label": "Manage",
"opens": WindowContext.MANAGE "opens": WindowContext.MANAGE,
"tooltip": "Manage/add to saved servers"
} }
OPTIONS = {"label": "Options", OPTIONS = {"label": "Options",
"opens": WindowContext.OPTIONS "opens": WindowContext.OPTIONS,
"tooltip": "Change settings, list local mods and\nother advanced options"
} }
HELP = {"label": "Help", HELP = {"label": "Help",
"opens": WindowContext.HELP "opens": WindowContext.HELP,
"tooltip": "Links to documentation"
} }
EXIT = {"label": "Exit", 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.pack_start(self.filters_vbox, False, False, 0)
self.debug_toggle = Gtk.ToggleButton(label="Debug mode") 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': if query_config(None, "debug")[0] == '1':
self.debug_toggle.set_active(True) self.debug_toggle.set_active(True)
self.debug_toggle.connect("toggled", self._on_button_toggled, "Toggle debug mode") self.debug_toggle.connect("toggled", self._on_button_toggled, "Toggle debug mode")
set_surrounding_margins(self.debug_toggle, 10) set_surrounding_margins(self.debug_toggle, 10)
self.question_button = Gtk.Button(label="?") 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_top(10)
self.question_button.set_margin_start(50) self.question_button.set_margin_start(50)
self.question_button.set_margin_end(50) self.question_button.set_margin_end(50)
@ -954,6 +961,8 @@ class ButtonBox(Gtk.Box):
for side_button in ButtonType: for side_button in ButtonType:
button = EnumeratedButton(label=side_button.dict["label"]) button = EnumeratedButton(label=side_button.dict["label"])
button.set_property("button_type", side_button) button.set_property("button_type", side_button)
button.set_tooltip_text(side_button.dict["tooltip"])
if is_steam_deck is True: if is_steam_deck is True:
button.set_size_request(10, 10) button.set_size_request(10, 10)
else: else:
@ -2436,16 +2445,17 @@ class ModSelectionPanel(Gtk.Box):
self.set_orientation(Gtk.Orientation.VERTICAL) self.set_orientation(Gtk.Orientation.VERTICAL)
labels = [ labels = [
"Select all", ["label": "Select all", "tooltip": "Bulk selects all mods"],
"Unselect all", ["label": "Unselect all", "tooltip": "Bulk unselects all mods"],
"Delete selected", ["label": "Delete selected", "tooltip": "Deletes selected mods from the system"],
"Highlight stale" ["label": "Highlight stale", "tooltip": "Shows locally-installed mods\nwhich are not used by any server\nin your Saved Servers"]
] ]
self.active_button = None self.active_button = None
for l in labels: 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_start(10)
button.set_margin_end(10) button.set_margin_end(10)
button.connect("clicked", self._on_button_clicked) button.connect("clicked", self._on_button_clicked)
@ -2505,6 +2515,7 @@ class ModSelectionPanel(Gtk.Box):
def toggle_select_stale_button(self, bool): def toggle_select_stale_button(self, bool):
if bool is True: if bool is True:
button = Gtk.Button(label="Select stale") button = Gtk.Button(label="Select stale")
button.set_tooltip_text("Bulk selects all currently highlighted mods")
button.set_margin_start(10) button.set_margin_start(10)
button.set_margin_end(10) button.set_margin_end(10)
button.connect("clicked", self._on_button_clicked) button.connect("clicked", self._on_button_clicked)
@ -2521,7 +2532,6 @@ class ModSelectionPanel(Gtk.Box):
(model, pathlist) = treeview.get_selection().get_selected_rows() (model, pathlist) = treeview.get_selection().get_selected_rows()
if bool is False: if bool is False:
default = None
for i in range (0, len(mod_store)): for i in range (0, len(mod_store)):
path = Gtk.TreePath(i) path = Gtk.TreePath(i)
it = mod_store.get_iter(path) it = mod_store.get_iter(path)
@ -2540,6 +2550,7 @@ class ModSelectionPanel(Gtk.Box):
_colorize(path, red) _colorize(path, red)
treeview.toggle_selection(False) treeview.toggle_selection(False)
self.active_button.set_label("Unhighlight stale") 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): def _iterate_mod_deletion(self, model, pathlist, ct):
@ -2667,6 +2678,10 @@ class FilterPanel(Gtk.Box):
match event.keyval: match event.keyval:
case Gdk.KEY_Escape: case Gdk.KEY_Escape:
GLib.idle_add(self.restore_focus_to_treeview) GLib.idle_add(self.restore_focus_to_treeview)
case Gdk.KEY_Up:
return True
case Gdk.KEY_Down:
return True
case _: case _:
return False return False