mirror of
https://github.com/aclist/dztui.git
synced 2024-12-29 13:52:03 +01:00
fix: clean up leaky dialogs
This commit is contained in:
parent
4beb44efa7
commit
e197e07e84
3 changed files with 17 additions and 12 deletions
6
dzgui.sh
6
dzgui.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
version=5.0.0.rc-36
|
version=5.0.0.rc-37
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
aid=221100
|
aid=221100
|
||||||
|
@ -536,10 +536,10 @@ fetch_dzq(){
|
||||||
fetch_helpers_by_sum(){
|
fetch_helpers_by_sum(){
|
||||||
declare -A sums
|
declare -A sums
|
||||||
sums=(
|
sums=(
|
||||||
["ui.py"]="4cc79aacfc87ded6989e7a7e077a9b23"
|
["ui.py"]="26032cc056ff1ce25660a2ca58cffc81"
|
||||||
["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197"
|
["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197"
|
||||||
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
||||||
["funcs"]="c05444b8db8cb010909eb2763100450a"
|
["funcs"]="4f142d4fe883a6936f94c964dbcf0710"
|
||||||
)
|
)
|
||||||
local author="aclist"
|
local author="aclist"
|
||||||
local repo="dztui"
|
local repo="dztui"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
version=5.0.0.rc-36
|
version=5.0.0.rc-37
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
aid=221100
|
aid=221100
|
||||||
|
@ -89,7 +89,6 @@ else
|
||||||
steam_cmd="flatpak run com.valvesoftware.Steam"
|
steam_cmd="flatpak run com.valvesoftware.Steam"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#TODO: dump servers methods can be merged
|
|
||||||
declare -A funcs=(
|
declare -A funcs=(
|
||||||
["My servers"]="dump_servers"
|
["My servers"]="dump_servers"
|
||||||
["Change player name"]="update_config_val"
|
["Change player name"]="update_config_val"
|
||||||
|
@ -774,8 +773,10 @@ update_favs_from_table(){
|
||||||
local record="$2"
|
local record="$2"
|
||||||
if [[ $context =~ Remove ]]; then
|
if [[ $context =~ Remove ]]; then
|
||||||
remove_from_favs "$record"
|
remove_from_favs "$record"
|
||||||
|
echo "Removed $record from saved servers"
|
||||||
else
|
else
|
||||||
add_to_favs "$record"
|
add_to_favs "$record"
|
||||||
|
echo "Added $record to saved servers"
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -837,6 +838,7 @@ update_config_val(){
|
||||||
declare -n nr=$key
|
declare -n nr=$key
|
||||||
nr="$value"
|
nr="$value"
|
||||||
update_config
|
update_config
|
||||||
|
echo "Updated the key '$key' to '$value'"
|
||||||
return 90
|
return 90
|
||||||
}
|
}
|
||||||
show_log(){
|
show_log(){
|
||||||
|
@ -1163,7 +1165,7 @@ check_timestamps(){
|
||||||
logger INFO "No prior versions file found, creating"
|
logger INFO "No prior versions file found, creating"
|
||||||
update_stamps "$aligned"
|
update_stamps "$aligned"
|
||||||
#force refresh all mods if versions file was missing
|
#force refresh all mods if versions file was missing
|
||||||
printf "%s\n" "${remote_ids[$@]}"
|
printf "%s\n" "${remote_ids[@]}"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ locale.setlocale(locale.LC_ALL, '')
|
||||||
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
|
||||||
|
|
||||||
# 5.0.0-rc.36
|
# 5.0.0-rc.37
|
||||||
app_name = "DZGUI"
|
app_name = "DZGUI"
|
||||||
|
|
||||||
cache = {}
|
cache = {}
|
||||||
|
@ -134,7 +134,7 @@ status_tooltip = {
|
||||||
"Server browser": "Used to browse the global server list",
|
"Server browser": "Used to browse the global server list",
|
||||||
"My saved servers": "Browse your saved servers",
|
"My saved servers": "Browse your saved servers",
|
||||||
"Quick-connect to favorite server": "Connect to your favorite server",
|
"Quick-connect to favorite server": "Connect to your favorite server",
|
||||||
"Recent servers": "Shows the last 10 servers you connected to",
|
"Recent servers": "Shows the last 10 servers you connected to (includes attempts)",
|
||||||
"Connect by IP": "Connect to a server by IP",
|
"Connect by IP": "Connect to a server by IP",
|
||||||
"Connect by ID": "Connect to a server by Battlemetrics ID",
|
"Connect by ID": "Connect to a server by Battlemetrics ID",
|
||||||
"Add server by IP": "Add a server by IP",
|
"Add server by IP": "Add a server by IP",
|
||||||
|
@ -341,7 +341,8 @@ def process_tree_option(input, treeview):
|
||||||
def _background(subproc, args, dialog):
|
def _background(subproc, args, dialog):
|
||||||
def _load():
|
def _load():
|
||||||
wait_dialog.destroy()
|
wait_dialog.destroy()
|
||||||
msg = proc.stdout
|
out = proc.stdout.splitlines()
|
||||||
|
msg = out[-1]
|
||||||
rc = proc.returncode
|
rc = proc.returncode
|
||||||
logger.info("Subprocess returned code %s with message '%s'" %(rc, msg))
|
logger.info("Subprocess returned code %s with message '%s'" %(rc, msg))
|
||||||
process_shell_return_code(transient_parent, msg, rc, input)
|
process_shell_return_code(transient_parent, msg, rc, input)
|
||||||
|
@ -356,7 +357,8 @@ def process_tree_option(input, treeview):
|
||||||
# False is used to bypass wait dialogs
|
# False is used to bypass wait dialogs
|
||||||
proc = call_out(transient_parent, subproc, args)
|
proc = call_out(transient_parent, subproc, args)
|
||||||
rc = proc.returncode
|
rc = proc.returncode
|
||||||
msg = proc.stdout
|
out = proc.stdout.splitlines()
|
||||||
|
msg = out[-1]
|
||||||
process_shell_return_code(transient_parent, msg, rc, input)
|
process_shell_return_code(transient_parent, msg, rc, input)
|
||||||
|
|
||||||
|
|
||||||
|
@ -667,11 +669,12 @@ class TreeView(Gtk.TreeView):
|
||||||
match context_menu_label:
|
match context_menu_label:
|
||||||
case "Add to my servers" | "Remove from favorites":
|
case "Add to my servers" | "Remove from favorites":
|
||||||
record = "%s:%s" %(self.get_column_at_index(6), self.get_column_at_index(7))
|
record = "%s:%s" %(self.get_column_at_index(6), self.get_column_at_index(7))
|
||||||
call_out(parent, context_menu_label, record)
|
proc = call_out(parent, context_menu_label, record)
|
||||||
if context == "Name (My saved servers)":
|
if context == "Name (My saved servers)":
|
||||||
iter = self.get_current_iter()
|
iter = self.get_current_iter()
|
||||||
server_store.remove(iter)
|
server_store.remove(iter)
|
||||||
res = spawn_dialog(parent, "Added %s to favorites" %(record), "NOTIFY")
|
msg = proc.stdout
|
||||||
|
res = spawn_dialog(parent, msg, "NOTIFY")
|
||||||
case "Remove from history":
|
case "Remove from history":
|
||||||
record = "%s:%s" %(self.get_column_at_index(6), self.get_column_at_index(7))
|
record = "%s:%s" %(self.get_column_at_index(6), self.get_column_at_index(7))
|
||||||
call_out(parent, context_menu_label, record)
|
call_out(parent, context_menu_label, record)
|
||||||
|
|
Loading…
Reference in a new issue