Add "no compessable files found" dialog

This commit is contained in:
icenine451 2024-06-26 12:43:33 -04:00
parent 7022193212
commit 00ee6e1279

View file

@ -855,29 +855,33 @@ configurator_compress_multiple_games_dialog() {
find_compatible_games "$1" find_compatible_games "$1"
if [[ ! "$target_selection" == "everything" ]]; then # If the user chose to not auto-compress everything if [[ ! $(echo "${#all_compressable_games[@]}") == "0" ]]; then
choice=$(zenity \ if [[ ! "$target_selection" == "everything" ]]; then # If the user chose to not auto-compress everything
--list --width=1200 --height=720 --title "RetroDECK Configurator - RetroDECK: Compression Tool" \ choice=$(zenity \
--checklist --hide-column=3 --ok-label="Compress Selected" --extra-button="Compress All" \ --list --width=1200 --height=720 --title "RetroDECK Configurator - RetroDECK: Compression Tool" \
--separator="," --print-column=3 \ --checklist --hide-column=3 --ok-label="Compress Selected" --extra-button="Compress All" \
--text="Choose which games to compress:" \ --separator="," --print-column=3 \
--column "Compress?" \ --text="Choose which games to compress:" \
--column "Game" \ --column "Compress?" \
--column "Game Full Path" \ --column "Game" \
"${compressable_games_list[@]}") --column "Game Full Path" \
"${compressable_games_list[@]}")
local rc=$? local rc=$?
if [[ $rc == "0" && ! -z $choice ]]; then # User clicked "Compress Selected" with at least one game selected if [[ $rc == "0" && ! -z $choice ]]; then # User clicked "Compress Selected" with at least one game selected
IFS="," read -ra games_to_compress <<< "$choice" IFS="," read -ra games_to_compress <<< "$choice"
local total_games_to_compress=${#games_to_compress[@]} local total_games_to_compress=${#games_to_compress[@]}
local games_left_to_compress=$total_games_to_compress local games_left_to_compress=$total_games_to_compress
elif [[ ! -z $choice ]]; then # User clicked "Compress All" elif [[ ! -z $choice ]]; then # User clicked "Compress All"
games_to_compress=("${all_compressable_games[@]}")
local total_games_to_compress=${#all_compressable_games[@]}
local games_left_to_compress=$total_games_to_compress
fi
else # The user chose to auto-compress everything
games_to_compress=("${all_compressable_games[@]}") games_to_compress=("${all_compressable_games[@]}")
local total_games_to_compress=${#all_compressable_games[@]}
local games_left_to_compress=$total_games_to_compress
fi fi
else # The user chose to auto-compress everything else
games_to_compress=("${all_compressable_games[@]}") configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "No compressable files were found."
fi fi
if [[ ! $(echo "${#games_to_compress[@]}") == "0" ]]; then if [[ ! $(echo "${#games_to_compress[@]}") == "0" ]]; then