X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Feasydialog.sh;h=bb7e8e3a8f97fc9aa2494916269b5cf09846312a;hb=ca8ae79915bb9c891e2f6b5a3094ebfd3303442b;hp=18cb7c31c96e7506d785859eaabc1ad5ccda8f83;hpb=a116f435ce8b97fdbea9fd25f91517b1fb850881;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/easydialog.sh b/handlers/easydialog.sh index 18cb7c3..bb7e8e3 100644 --- a/handlers/easydialog.sh +++ b/handlers/easydialog.sh @@ -157,11 +157,13 @@ listBegin() { _menu_items=0 _menu_text= _menu_labels= + _menu_status= } listItem() { _menu_labels[$_menu_items]=$1 _menu_text[$_menu_items]=$2 + _menu_status[$_menu_items]=$3 # available only for checklist let "_menu_items += 1" } @@ -175,6 +177,9 @@ listDisplay() { local temp=$(mktemp -t) || exit 1 trap "rm -f $temp" 0 + local label + local text + local status ( echo -ne " $HELP $_DEFAULT " echo -ne " --backtitle '$BACKTITLE' " @@ -184,7 +189,8 @@ listDisplay() { for ((i=0; i < $_menu_items ; i++)); do label=${_menu_labels[$i]} text=${_menu_text[$i]} - echo -ne " $label '$text' " + status=${_menu_status[$i]} + echo -ne " $label '$text' $status " done ) | xargs $DIALOG 2> $temp @@ -238,6 +244,7 @@ formDisplay() { ) | xargs $DIALOG 2> $temp local status=$? + REPLY= if [ $status = 0 ]; then IFS=$'' REPLY=`cat $temp`