Hopefully improve progressbars and update messages with yad.

This commit is contained in:
Storm Dragon
2025-08-05 03:36:34 -04:00
parent 8e24b73720
commit 6317b2098b
2 changed files with 64 additions and 7 deletions

View File

@@ -53,9 +53,19 @@ download() {
fi
# Skip if the item is in cache.
[[ -e "${cache}/${dest}" ]] && continue
if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" 2>&1 | agm_progressbox "Audio Game Manager" "Downloading \"$dest\"..."; then
agm_infobox "Audio Game Manager" "Audio Game Manager" "Could not download \"$dest\". Installation cannot continue."
exit 1
if [[ "$dialogType" == "yad" ]]; then
# Use curl's progress bar with better accessibility for yad
if ! curl -L4 -C - --retry 10 --progress-bar --output "${cache}/${dest}" "${i}" 2>&1 | \
sed -u 's/.*\r\([0-9]*\)%.*/\1/' | agm_progress_with_percent "Audio Game Manager" "Downloading \"$dest\"..."; then
agm_infobox "Audio Game Manager" "Audio Game Manager" "Could not download \"$dest\". Installation cannot continue."
exit 1
fi
else
# Use the original method for dialog (console)
if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" 2>&1 | agm_progressbox "Audio Game Manager" "Downloading \"$dest\"..."; then
agm_infobox "Audio Game Manager" "Audio Game Manager" "Could not download \"$dest\". Installation cannot continue."
exit 1
fi
fi
local downloadError=1
case "${dest##*.}" in