From bb31ccbf5df86f2ce230ea38bfafffa918f22e1c Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:24:13 +0900 Subject: [PATCH 1/2] docs: update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 51a6ff0..5732eb9 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,7 @@ Other options include the ability to connect by IP or ID or set a favorite serv Refer to the [manual](https://aclist.github.io/dzgui/dzgui.html) for installation and setup instructions, a feature-by-feature breakdown, and Steam integration tutorials. ![Alt text](/images/example.png) + +## Attribution + +Geolocation records from [DB-IP](https://db-ip.com) under [CC 4.0 license](https://creativecommons.org/licenses/by/4.0/) From dce4ad75db1eb70354825fe0409360a4572cc3aa Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:59:42 +0900 Subject: [PATCH 2/2] chore: update geolocation records --- CHANGELOG.md | 11 +++++++++++ dzgui.sh | 12 ++++-------- helpers/funcs | 7 ++----- helpers/ui.py | 44 ++++++++++++++++++++++---------------------- 4 files changed, 39 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea87f05..b11f3b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [5.2.3] 2024-04-19 +### Added +- Added Debug Mode button to main menu + +### Changed +- Reworded debug mode notification dialog +- Updated geolocation records + +### Dropped +- Dropped seen_news key from configs + ## [5.2.2] 2024-04-18 ### Added - Cover artwork/icons for Steam "Recent Games" and tree view diff --git a/dzgui.sh b/dzgui.sh index f9a0a6b..f557313 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.2.2 +version=5.2.3 #CONSTANTS aid=221100 @@ -109,7 +109,6 @@ setup_state_files(){ print_config_vals(){ local keys=( "branch" - "seen_news" "name" "fav_server" "fav_label" @@ -192,9 +191,6 @@ debug="$debug" #Toggle stable/testing branch branch="$branch" -#Last seen news item -seen_news="$seen_news" - #Steam API key steam_api="$steam_api" @@ -537,10 +533,10 @@ fetch_helpers_by_sum(){ source "$config_file" declare -A sums sums=( - ["ui.py"]="7b9dc3cd70c9d388536c03d18d3ba0b5" + ["ui.py"]="1e692d9c658aba4402c1c998263f6184" ["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="35db0238f3bb8691107aefd2aee51d0f" + ["funcs"]="47ba5f1b5da5d1e7f42a5a088b29ec9d" ) local author="aclist" local repo="dztui" @@ -583,7 +579,7 @@ fetch_helpers_by_sum(){ } fetch_geo_file(){ # for binary releases - local geo_sum="e7f3b25223ac4dfd5e30a0b55bb3ff6c" + local geo_sum="7b6668eb4535bb432acb42016ba9cc47" local km_sum="b038fdb8f655798207bd28de3a004706" local gzip="$helpers_path/ips.csv.gz" if [[ ! -f $geo_file ]] || [[ $(get_hash $geo_file) != $geo_sum ]]; then diff --git a/helpers/funcs b/helpers/funcs index 0034dda..d7f1ac0 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -o pipefail -version=5.2.2 +version=5.2.3 #CONSTANTS aid=221100 @@ -653,9 +653,6 @@ debug="$debug" #Toggle stable/testing branch branch="$branch" -#Last seen news item -seen_news="$seen_news" - #Steam API key steam_api="$steam_api" @@ -1269,7 +1266,7 @@ launch(){ update_symlinks if [[ $debug -eq 1 ]]; then local launch_options="$steam_cmd -applaunch $aid -connect=$ip:$gameport -nolauncher -nosplash -name=$name -skipintro \"-mod=$concat\"" - printf "Dry-run mode: these options would have been used to launch the game: $launch_options" + printf "Debug mode: these options would have been used to launch the game: $launch_options" return 0 fi echo "$concat" > "$_cache_launch" diff --git a/helpers/ui.py b/helpers/ui.py index c712238..519278a 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -18,7 +18,7 @@ locale.setlocale(locale.LC_ALL, '') gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GLib, Gdk, GObject, Pango -# 5.2.2 +# 5.2.3 app_name = "DZGUI" start_time = 0 @@ -493,14 +493,29 @@ class RightPanel(Gtk.Box): self.pack_start(self.button_vbox, False, False, 0) self.pack_start(self.filters_vbox, False, False, 0) + self.debug_toggle = Gtk.ToggleButton(label="Debug mode") + 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_margin_top(10) self.question_button.set_margin_start(50) self.question_button.set_margin_end(50) self.question_button.connect("clicked", self._on_button_clicked) + + self.pack_start(self.debug_toggle, False, True, 0) if is_steam_deck is False: self.pack_start(self.question_button, False, True, 0) + def _on_button_toggled(self, button, command): + grid = self.get_parent() + transient_parent = grid.get_parent() + call_out(transient_parent, "toggle", command) + grid.update_right_statusbar() + grid.scrollable_treelist.treeview.grab_focus() + def _on_button_clicked(self, button): grid = self.get_parent() grid.scrollable_treelist.treeview.spawn_keys_dialog(button) @@ -838,6 +853,12 @@ class TreeView(Gtk.TreeView): window = self.get_outer_window() grid = self.get_outer_grid() match event.keyval: + case Gdk.KEY_d: + debug = grid.right_panel.debug_toggle + if debug.get_active(): + debug.set_active(False) + else: + debug.set_active(True) case Gdk.KEY_Right: grid.right_panel.focus_button_box() case Gdk.KEY_question: @@ -855,14 +876,6 @@ class TreeView(Gtk.TreeView): cur_proc = grid.scrollable_treelist.treeview.current_proc if event.state is Gdk.ModifierType.CONTROL_MASK: match event.keyval: - case Gdk.KEY_d: - if self.get_first_col() == "Mod": - return - debug = grid.right_panel.filters_vbox.debug_toggle - if debug.get_active(): - debug.set_active(False) - else: - debug.set_active(True) case Gdk.KEY_l: self._on_button_release(self, event) case Gdk.KEY_r: @@ -1675,11 +1688,6 @@ class FilterPanel(Gtk.Box): self.maps_combo.connect("changed", self._on_map_changed) self.maps_combo.connect("key-press-event", self._on_esc_pressed) - self.debug_toggle = Gtk.ToggleButton(label="Debug mode") - 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.pack_start(self.filters_label, False, False, True) self.pack_start(self.keyword_entry, False, False, True) @@ -1688,14 +1696,6 @@ class FilterPanel(Gtk.Box): for i, check in enumerate(checks[0:]): self.pack_start(checks[i], False, False, True) - self.pack_start(self.debug_toggle, False, False, 0) - - def _on_button_toggled(self, button, command): - transient_parent = self.get_outer_window() - grid = self.get_outer_grid() - call_out(transient_parent, "toggle", command) - grid.update_right_statusbar() - grid.scrollable_treelist.treeview.grab_focus() def grab_keyword_focus(self): self.keyword_entry.grab_focus()