mirror of
https://github.com/aclist/dztui.git
synced 2026-08-29 19:27:13 +02:00
Merge branch 'dzgui' into prerelease/6.0.0
This commit is contained in:
commit
22e92e67a7
1
dzgui.sh
1
dzgui.sh
@ -691,6 +691,7 @@ get_response_code(){
|
|||||||
local url="$1"
|
local url="$1"
|
||||||
curl -Ls -I -o /dev/null -w "%{http_code}" "$url"
|
curl -Ls -I -o /dev/null -w "%{http_code}" "$url"
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_ip_db(){
|
fetch_ip_db(){
|
||||||
parse_dl_url(){
|
parse_dl_url(){
|
||||||
curl -Ls "$url" \
|
curl -Ls "$url" \
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
version="6.0.0"
|
version="6.0.0"
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
@ -396,6 +397,7 @@ get_dist(){
|
|||||||
logger INFO "Distance: $dist km"
|
logger INFO "Distance: $dist km"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
query_config(){
|
query_config(){
|
||||||
[[ -n $2 ]] && local key=$2
|
[[ -n $2 ]] && local key=$2
|
||||||
keys=(
|
keys=(
|
||||||
@ -421,6 +423,7 @@ query_config(){
|
|||||||
echo "${!i}"
|
echo "${!i}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
align_versions_file(){
|
align_versions_file(){
|
||||||
shift
|
shift
|
||||||
local mod="$1"
|
local mod="$1"
|
||||||
@ -482,6 +485,9 @@ test_cooldown(){
|
|||||||
redact(){
|
redact(){
|
||||||
sed 's@\(/home/\)[^/]*@\1REDACTED@g'
|
sed 's@\(/home/\)[^/]*@\1REDACTED@g'
|
||||||
}
|
}
|
||||||
|
redact(){
|
||||||
|
sed 's@\(/home/\)[^/]*@\1REDACTED@g'
|
||||||
|
}
|
||||||
logger(){
|
logger(){
|
||||||
local date="$(date "+%F %T,%3N")"
|
local date="$(date "+%F %T,%3N")"
|
||||||
local tag="$1"
|
local tag="$1"
|
||||||
|
|||||||
@ -1343,7 +1343,6 @@ class ScrollableTree(Gtk.ScrolledWindow):
|
|||||||
self.treeview = TreeView()
|
self.treeview = TreeView()
|
||||||
self.add(self.treeview)
|
self.add(self.treeview)
|
||||||
|
|
||||||
|
|
||||||
class RightPanel(Gtk.Box):
|
class RightPanel(Gtk.Box):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(spacing=6, orientation=Gtk.Orientation.VERTICAL)
|
super().__init__(spacing=6, orientation=Gtk.Orientation.VERTICAL)
|
||||||
@ -2745,7 +2744,8 @@ class TreeView(Gtk.TreeView):
|
|||||||
if column_title == "Map":
|
if column_title == "Map":
|
||||||
column.set_fixed_width(300)
|
column.set_fixed_width(300)
|
||||||
|
|
||||||
self.append_column(column)
|
if i != 10:
|
||||||
|
self.append_column(column)
|
||||||
|
|
||||||
@update_window_labels
|
@update_window_labels
|
||||||
def _update_multi_column(self, mode: RowType, port: int = 27016) -> None:
|
def _update_multi_column(self, mode: RowType, port: int = 27016) -> None:
|
||||||
@ -4657,6 +4657,7 @@ class App(Gtk.Application):
|
|||||||
self.win = OuterWindow()
|
self.win = OuterWindow()
|
||||||
self.win.set_icon_name("{app_name_lower}")
|
self.win.set_icon_name("{app_name_lower}")
|
||||||
|
|
||||||
|
|
||||||
accel = Gtk.AccelGroup()
|
accel = Gtk.AccelGroup()
|
||||||
accel.connect(
|
accel.connect(
|
||||||
Gdk.KEY_q,
|
Gdk.KEY_q,
|
||||||
@ -4684,6 +4685,35 @@ class App(Gtk.Application):
|
|||||||
self.win.halt_proc_and_quit()
|
self.win.halt_proc_and_quit()
|
||||||
|
|
||||||
|
|
||||||
|
def save_res_and_quit(window):
|
||||||
|
if window.props.is_maximized:
|
||||||
|
Gtk.main_quit()
|
||||||
|
return
|
||||||
|
rect = window.get_size()
|
||||||
|
|
||||||
|
def write_json(rect):
|
||||||
|
data = {"res": { "width": rect.width, "height": rect.height } }
|
||||||
|
j = json.dumps(data, indent=2)
|
||||||
|
with open(res_path, "w") as outfile:
|
||||||
|
outfile.write(j)
|
||||||
|
logger.info("Wrote initial window size to '%s'" %(res_path))
|
||||||
|
|
||||||
|
if os.path.isfile(res_path):
|
||||||
|
with open(res_path, "r") as infile:
|
||||||
|
try:
|
||||||
|
data = json.load(infile)
|
||||||
|
data["res"]["width"] = rect.width
|
||||||
|
data["res"]["height"] = rect.height
|
||||||
|
with open(res_path, "w") as outfile:
|
||||||
|
outfile.write(json.dumps(data, indent=2))
|
||||||
|
except json.decoder.JSONDecodeError:
|
||||||
|
logger.critical("JSON decode error in '%s'" %(res_path))
|
||||||
|
write_json(rect)
|
||||||
|
else:
|
||||||
|
write_json(rect)
|
||||||
|
|
||||||
|
Gtk.main_quit()
|
||||||
|
|
||||||
class ModSelectionPanel(Gtk.Box):
|
class ModSelectionPanel(Gtk.Box):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(spacing=6)
|
super().__init__(spacing=6)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user