1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-28 21:32:36 +01:00

fix: check for helpers sooner

This commit is contained in:
aclist 2024-01-31 16:59:25 +09:00
parent 419919ffdc
commit 3c679aadaa
3 changed files with 12 additions and 9 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -o pipefail
version=5.0.0.rc-41
version=5.0.0.rc-42
#CONSTANTS
aid=221100
@ -548,14 +548,16 @@ fetch_dzq(){
fetch_helpers_by_sum(){
declare -A sums
sums=(
["ui.py"]="cf1542c215b72ded42a3b52068e0653f"
["ui.py"]="2331665f5a2fb55cc030621812a309ea"
["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197"
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
["funcs"]="c1b73598bddde3fc3b9c9d12061a5b83"
["funcs"]="3f7f374117dd2bbc55e1d055d903cff2"
)
local author="aclist"
local repo="dztui"
local branch="$branch"
#TODO: update to 'dzgui' for first time setup
[[ -z $branch ]] && branch="testing"
local file
local sum
local full_path
@ -565,6 +567,7 @@ fetch_helpers_by_sum(){
sum="${sums[$i]}"
full_path="$helpers_path/$file"
url="https://raw.githubusercontent.com/$author/$repo/$branch/helpers/$file"
echo "$url" >> $HOME/log
if [[ -f "$full_path" ]] && [[ $(get_hash "$full_path") == $sum ]]; then
logger INFO "$file is current"
else
@ -815,6 +818,7 @@ initial_setup(){
watcher_deps
check_architecture
test_connection
fetch_helpers > >(pdialog "Checking helper files")
varcheck
source "$config_file"
lock
@ -824,7 +828,6 @@ initial_setup(){
steam_deps
migrate_files
stale_symlinks
fetch_helpers > >(pdialog "Checking helper files")
local_latlon
is_steam_running
is_dzg_downloading

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -o pipefail
version=5.0.0.rc-41
version=5.0.0.rc-42
#CONSTANTS
aid=221100

View file

@ -16,7 +16,7 @@ locale.setlocale(locale.LC_ALL, '')
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib, Gdk, GObject, Pango
# 5.0.0-rc.41
# 5.0.0-rc.42
app_name = "DZGUI"
cache = {}
@ -663,7 +663,7 @@ class TreeView(Gtk.TreeView):
logger.info("User clicked context menu '%s'" %(context_menu_label))
match context_menu_label:
case "Add to my servers" | "Remove from favorites":
case "Add to my servers" | "Remove from my servers":
record = "%s:%s" %(self.get_column_at_index(6), self.get_column_at_index(7))
proc = call_out(parent, context_menu_label, record)
if context == "Name (My saved servers)":
@ -722,7 +722,7 @@ class TreeView(Gtk.TreeView):
mod_context_items = ["Open in Steam Workshop", "Delete mod"]
subcontext_items = {"Server browser": ["Add to my servers", "Copy IP to clipboard", "Show server-side mods"],
"My saved servers": ["Remove from favorites", "Copy IP to clipboard", "Show server-side mods"],
"My saved servers": ["Remove from my servers", "Copy IP to clipboard", "Show server-side mods"],
"Recent servers": ["Remove from history", "Copy IP to clipboard", "Show server-side mods"],
}
# submenu hierarchy https://stackoverflow.com/questions/52847909/how-to-add-a-sub-menu-to-a-gtk-menu
@ -740,7 +740,7 @@ class TreeView(Gtk.TreeView):
record = "%s:%s" %(self.get_column_at_index(6), self.get_column_at_index(7))
proc = call_out(widget, "is_in_favs", record)
if proc.returncode == 0:
item = "Remove from favorites"
item = "Remove from my servers"
item = Gtk.MenuItem(label=item)
item.connect("activate", self._on_menu_click)
self.menu.append(item)