From 1463e400292fc42745a02536b5def37007fd57f8 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Wed, 16 Feb 2022 13:55:03 -0300 Subject: [PATCH] Remove --threebuttons option --- scripts/common.sh | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index 8d4cb14..6a7d270 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -14,7 +14,7 @@ useDialog() { useDialogListOrMenu "$@" exit fi - inputbox=false; passwordbox=false; infobox=false; threebuttons=false; yesno=false + inputbox=false; passwordbox=false; infobox=false str=$(getLastArgument "$@") if [ "$str" = "VALUES" ]; then argc="$#"; i=1 @@ -25,9 +25,6 @@ useDialog() { [ "$item" = "--inputbox" ] && inputbox=true [ "$item" = "--passwordbox" ] && passwordbox=true [ "$item" = "--infobox" ] && infobox=true - [ "$item" = "--threebuttons" ] && threebuttons=true - [ "$item" = "--yesno" ] && yesno=true - [ "$yesno" = true ] && args+=("$item") ((i++)) done fi @@ -38,9 +35,6 @@ useDialog() { height=$((height+2)) fi [ $infobox = true ] && height=$((height-2)) - if [ "$threebuttons" = true ]; then - set -- --yes-label "$2" --extra-button --extra-label "$3" --no-label "$4" "${args[@]}" - fi formatOptions "$@" if [ "$found" = false ]; then dialog "$@" ${height} ${width} @@ -55,7 +49,7 @@ useWhiptail() { exit fi [ "$1" = "--infobox" ] && tty | grep -q "/dev/pts" && local TERM=ansi - inputbox=false; infobox=false; threebuttons=false; yesno=false + inputbox=false; infobox=false str=$(getLastArgument "$@") if [ "$str" = "VALUES" ]; then argc="$#"; i=1 @@ -65,9 +59,6 @@ useWhiptail() { fi [ "$item" = "--inputbox" ] && inputbox=true [ "$item" = "--infobox" ] && infobox=true - [ "$item" = "--threebuttons" ] && threebuttons=true - [ "$item" = "--yesno" ] && yesno=true - [ "$yesno" = true ] && args+=("$item") ((i++)) done fi @@ -75,20 +66,12 @@ useWhiptail() { height=$(calcHeightWhiptail "$str") [ $inputbox = true ] && [ "$width" -lt 30 ] && width=$((width+5)) [ $infobox = true ] && height=$((height-1)) - if [ "$threebuttons" = true ]; then - set -- --yes-button "$2" --no-button "$3" "${args[@]}" - fi formatOptions "$@" if [ "$found" = false ]; then height=0; width=0 whiptail "$@" ${height} ${width} else whiptail "${options[@]}" - retVal=$? - if [ "$threebuttons" = true ]; then - [ $retVal -eq 1 ] && return 3 - fi - return $retVal fi }