Hopefully improve progressbars and update messages with yad.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user