diff options
-rw-r--r-- | src/core/libs/lib-ui.sh | 11 | ||||
-rw-r--r-- | src/core/procedures/interactive | 8 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 6b8393f..bc32aaf 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -116,6 +116,7 @@ ask_number () # $1 default item (set to 'no' for none) # $2 title # shift;shift; $@ list of options. first tag. then name. (eg tagA itemA "tag B" 'item B' ) +# the response will be echoed to stdout. but also $ANSWER_OPTION will be set. take that because the former method seems to not work. ask_option () { [ "$var_UI_TYPE" = dia ] && { _dia_ask_option "$@" ; return $? ; } @@ -173,7 +174,8 @@ _dia_ask_option () DIA_MENU_TITLE=$2 shift 2 _dia_DIALOG $DEFAULT --title " $DIA_MENU_TITLE " --menu "$DIA_MENU_TEXT" 16 55 8 "$@" 2>$ANSWER - cat $ANSWER + ANSWER_OPTION=`cat $ANSWER` + echo $ANSWER_OPTION } @@ -195,10 +197,9 @@ _cli_ask_option () done [ -n "$DEFAULT" ] && echo -n " > [ $DEFAULT ] " [ -z "$DEFAULT" ] && echo -n " > " - read answ - echo - [ -z "$answ" -a -n "$DEFAULT" ] && answ="$DEFAULT" - echo "$answ" + read ANSWER_OPTION + [ -z "$ANSWER_OPTION" -a -n "$DEFAULT" ] && ANSWER_OPTION="$DEFAULT" + echo "$ANSWER_OPTION" } diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive index 6e7d203..82b2d26 100644 --- a/src/core/procedures/interactive +++ b/src/core/procedures/interactive @@ -64,7 +64,7 @@ mainmenu() { default=no [ -n "$NEXTITEM" ] && default="$NEXTITEM" - answer=`ask_option $default "MAIN MENU" \ + ask_option $default "MAIN MENU" \ "0" "Select Source" \ "1" "Set Clock" \ "2" "Prepare Hard Drive" \ @@ -72,9 +72,9 @@ mainmenu() "4" "Install Packages" \ "5" "Configure System" \ "6" "Install Bootloader" \ - "7" "Exit Install"` - NEXTITEM="$answer" - case $answer in + "7" "Exit Install" + NEXTITEM="$ANSWER_OPTION" + case $ANSWER_OPTION in "0") execute worker select_source; ret=$? if [ $ret -eq 0 -a "$var_PKG_SOURCE_TYPE" = "ftp" ]; then |