X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=blobdiff_plain;f=handlers%2Feasydialog.sh;h=b96a5c1df5c511f11f6ae3c21d8b5292d6f883fd;hp=1ae3c830b2338e6c340b82cb501be6d33596def4;hb=91f3eb464817461dea895b180f7f79d67289ff21;hpb=06566455cf8262233d4ebf243002132326c66504 diff --git a/handlers/easydialog.sh b/handlers/easydialog.sh index 1ae3c83..b96a5c1 100644 --- a/handlers/easydialog.sh +++ b/handlers/easydialog.sh @@ -81,15 +81,20 @@ _genericListBox() { local temp=$(mktemp -t) || exit 1 trap "rm -f $temp" 0 REPLY= - $DIALOG $HELP --backtitle "$BACKTITLE" --title "$title" \ + $DIALOG $HELP $_DEFAULT --backtitle "$BACKTITLE" --title "$title" \ $box "$text" $HEIGHT $WIDTH 10 \ "$@" 2> $temp local status=$? [ $status = 0 ] && REPLY=$(_listReplyHook $temp $box) rm -f $temp + _DEFAULT= return $status } +setDefault() { + _DEFAULT="--default-item $1" +} + menuBox() { _genericListBox --menu "$@" } @@ -169,9 +174,9 @@ displayForm() { for ((i=0; i < $_form_items ; i++)); do label=${_form_labels[$i]} text=${_form_text[$i]} - if [ "$text" == "" ]; then - text='_empty_' - fi +# if [ "$text" == "" ]; then +# text='_empty_' +# fi echo -n -e "$form $label $xpos 1 '$text' $xpos $max_length 30 30" let "xpos += _form_gap" done