summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-11 20:49:12 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-11 20:49:12 +0100
commitd2270c1cb1f117c23a6c669469145f2352e30d0d (patch)
treead754ac6515dc35e69eaa0ba19410688f956267c /src/core
parent21f4084ace35f45c20154f657c3ce79c962abe91 (diff)
fix for ask_yesno height (maybe) + todo updates + debugging added to several ui functions + bootloader worker refactoring
Diffstat (limited to 'src/core')
-rw-r--r--src/core/libs/lib-ui.sh13
-rw-r--r--src/core/procedures/interactive23
2 files changed, 24 insertions, 12 deletions
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh
index 927ba96..340cdb5 100644
--- a/src/core/libs/lib-ui.sh
+++ b/src/core/libs/lib-ui.sh
@@ -190,6 +190,7 @@ _dia_ask_option ()
ret=$?
ANSWER_OPTION=`cat $ANSWER`
echo $ANSWER_OPTION
+ debug "User choose $ANSWER_OPTION"
return $ret
}
@@ -215,6 +216,7 @@ _cli_ask_option ()
[ -z "$DEFAULT" ] && echo -n " > "
read ANSWER_OPTION
[ -z "$ANSWER_OPTION" -a -n "$DEFAULT" ] && ANSWER_OPTION="$DEFAULT"
+ debug "User choose $ANSWER_OPTION"
echo "$ANSWER_OPTION"
}
@@ -242,7 +244,12 @@ _dia_follow_progress ()
_dia_ask_yesno ()
{
- dialog --yesno "$1" 10 55 # returns 0 for yes, 1 for no
+ height=$((`echo -e "$1" | wc -l` +7))
+ dialog --yesno "$1" $height 55 # returns 0 for yes, 1 for no
+ ret=$?
+ [ $ret -eq 0 ] && debug "User picked YES"
+ [ $ret -gt 0 ] && debug "User picked NO"
+ return $ret
}
@@ -272,8 +279,10 @@ _cli_ask_yesno ()
answer=`tr '[:upper:]' '[:lower:]' <<< $answer`
if [ "$answer" = y -o "$answer" = yes ]
then
+ debug "User picked YES"
return 0
else
+ debug "User picked NO"
return 1
fi
}
@@ -284,6 +293,7 @@ _cli_ask_string ()
echo -n "$@: "
read answ
echo "$answ"
+ debug "User entered: $answ"
[ -z "$answ" ] && return 1
return 0
}
@@ -308,6 +318,7 @@ _cli_ask_number ()
fi
done
echo "$answ"
+ debug "user entered: $answ"
[ -z "$answ" ] && return 1
return 0
}
diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive
index 721cf7a..93aade4 100644
--- a/src/core/procedures/interactive
+++ b/src/core/procedures/interactive
@@ -38,7 +38,7 @@ start_process ()
S_INSTALL=0 # package installation
S_CONFIG=0 # configuration editing
S_GRUB=0 # TODO: kill this - if using grub
- S_BOOT="" # bootloader installed (set to loader name instead of 1)
+ S_BOOT="" # bootloader installed
var_UI_TYPE=dia
@@ -73,7 +73,7 @@ mainmenu()
"5" "Configure System" \
"6" "Install Bootloader" \
"7" "Exit Install"
- NEXTITEM="$ANSWER_OPTION"
+ NEXTITEM="$ANSWER_OPTION" #TODO: set next item always current+1 after succesfull finish of each phase/worker, if relevant
case $ANSWER_OPTION in
"0")
execute worker select_source; ret=$?
@@ -100,10 +100,7 @@ mainmenu()
"5")
execute worker configure_system && S_CONFIG=1 && { execute worker mkinitcpio; execute worker locales; } ;;
"6")
- ask_option no "Which bootloader would you like to use? Grub is the Arch default." \
- "GRUB" "Use the GRUB bootloader (default)" \
- "None" "\Zb\Z1Warning\Z0\ZB: you must install your own bootloader!"
- execute worker install_bootloader "$ANSWER_OPTION";;
+ execute worker install_bootloader && S_BOOT=1 ;;
"7")
notify "If the install finished successfully, you can now type 'reboot' to restart the system." && stop_installer ;;
*)
@@ -246,15 +243,19 @@ worker_select_mirror ()
interactive_select_mirror
}
-# $1 which one
+
worker_install_bootloader ()
{
- bl=`tr '[:upper:]' '[:lower:]' <<< "$1"`
- log "User picked bootloader $bl ..."
- [ "$bl" = grub ] && interactive_install_grub && S_BOOT=grub
- [ "$bl" != grub ] && S_BOOT="$bl"
+ ask_option Grub "Which bootloader would you like to use? Grub is the Arch default." \
+ "Grub" "Use the GRUB bootloader (default)" \
+ "None" "\Zb\Z1Warning\Z0\ZB: you must install your own bootloader!"
+
+ bl=`tr '[:upper:]' '[:lower:]' <<< "$ANSWER_OPTION"`
+ [ "$bl" != grub ] && return 0
+ interactive_install_grub
}
+
worker_auto_network ()
{
[ $S_NET -eq 0 ] && return 1