while true; do
local _info_rendered _info_line _info_trimmed _info_label
local -a yad_cmd
_info_rendered=$(printf '%b' "$_INFO_TXT")
# Build yad command so informational text is rendered as stacked labels
yad_cmd=(
--form
--image="/opt/rtd/modules/oem-bundle-manager.mod/image/banner.png"
--image-on-top
--title="${_title}"
--columns=1
)
while IFS= read -r _info_line; do
_info_trimmed="${_info_line#"${_info_line%%[![:space:]]*}"}"
_info_trimmed="${_info_trimmed%"${_info_trimmed##*[![:space:]]}"}"
[[ -z "$_info_trimmed" ]] && continue
_info_label="${_info_trimmed//:/\\:}"
yad_cmd+=(--field="$_info_label":LBL)
done <<< "$_info_rendered"
yad_cmd+=(
--width=700
--height=360
--button="Add Bundles to this computer:0"
--button="Remove Bundles from this computer:2"
--button="Information abount this tool:3"
--button="Quit:1"
--buttons-layout=center
)
# Display the yad form and capture the selected button
selection=$(yad "${yad_cmd[@]}")
ret=$?
# Handle the user's selection
case $ret in
0) software::display_bundle_install_choices_gtk --zenity ;;
1) clear && echo "[Quit]" | tee -a "${_log_file}" ; break ;;
2) software::display_bundle_removal_choices_gtk --zenity;;
3) zenity::display_info "$_ABOUT" ;;
252) clear && echo "[ESC]" | tee -a "${_log_file}" && break ;;
*) clear && echo "[Unknown Request]" | tee -a "$${_log_file}" && break ;;
esac
unset _ret
done