diff --git a/dzgui.sh b/dzgui.sh index 7f1ab2f..d95bb3a 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -569,7 +569,7 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="4663cdda7bf91a0c594103d6f4382f15" + ["ui.py"]="353e6fcb8d2c674a3720c0ab8a2b3fd6" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["funcs"]="5eae515ea2cac2ab38212a529415e86b" diff --git a/helpers/ui.py b/helpers/ui.py index a6ba4ea..6ef843d 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -12,7 +12,6 @@ import subprocess import sys import textwrap import threading -import time locale.setlocale(locale.LC_ALL, '') gi.require_version("Gtk", "3.0") @@ -22,7 +21,6 @@ from enum import Enum # 5.6.0 app_name = "DZGUI" -start_time = 0 cache = {} config_vals = [] @@ -874,15 +872,11 @@ class TreeView(Gtk.TreeView): def refresh_player_count(self): parent = self.get_outer_window() - global start_time - then = start_time - now = time.monotonic() - diff = now - then - cooldown = 30 - math.floor(diff) - if ((start_time > 0) and (now - then) < 30): - spawn_dialog(parent, "Global refresh cooldown not met. Wait %s second(s)." %(str(cooldown)), Popup.NOTIFY) - return - start_time = now + cooldown = call_out(self, "test_cooldown", "", "") + if cooldown.returncode == 1: + spawn_dialog(self.get_outer_window(), cooldown.stdout, Popup.NOTIFY) + return 1 + call_out(self, "start_cooldown", "", "") thread = threading.Thread(target=self._background_player_count, args=()) thread.start()