Shorten some main function names, remove specifics for user wm configs

This commit is contained in:
natemaia
2018-12-13 23:22:22 -08:00
parent ba91ed8b79
commit 529166b83c
5 changed files with 195 additions and 195 deletions

View File

@ -19,43 +19,43 @@ readonly DBG="/tmp/debuglog" # Built-in error log
main()
{
if [[ $CURRENT_MENU != "main" ]]; then
SELECTED=1
CURRENT_MENU="main"
if [[ $SAVED ]]; then
SELECTED=$((SAVED + 1))
unset SAVED
else
SELECTED=1
fi
CURRENT_MENU="main"
elif (( SELECTED < 9 )); then
elif (( SELECTED < 8 )); then
((SELECTED++)) # increment the highlighted menu item
fi
tput civis
SELECTED=$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_PrepTitle " --default-item $SELECTED --menu "$_PrepBody" 0 0 0 \
"1" "$_PrepShowDev" "2" "$_PrepParts" "3" "$_PrepLUKS" "4" "$_PrepLVM" \
"5" "$_PrepMount" "6" "$_PrepConfig" "7" "Check Choices" "8" "$_PrepInstall" \
"9" "$_Done")
--title " $_PrepTitle " --default-item $SELECTED \
--menu "$_PrepBody" 0 0 0 \
"1" "$_PrepShowDev" "2" "$_PrepParts" \
"3" "$_PrepLUKS" "4" "$_PrepLVM" \
"5" "$_PrepMount" "6" "$_PrepConfig" \
"7" "Check Choices" "8" "$_PrepInstall")
# if trying to install the system, make sure the partitions are mounted
# and that the needed config variables and user variables have been set up
if [[ $SELECTED ]]; then
if [[ $SELECTED -eq 8 || $SELECTED -eq 6 ]]; then
{ [[ $SELECTED -eq 8 ]] && preinstall_checks 1 || preinstall_checks; } || return 1
elif [[ ($SELECTED -eq 2 || $SELECTED -eq 5) && $WARN != true ]]; then
if (( SELECTED == 8 )); then
preinstall_checks 1 || return 1
elif (( SELECTED == 6 )); then
preinstall_checks || return 1
elif (( SELECTED == 2 || SELECTED == 5 )) && [[ $WARN != true ]]; then
msgbox "$_PrepTitle" "$_WarnMount" && WARN=true
fi
fi
# setting $SELECTED to ($SELECTED - 1) when failing keeps the highlight
case $SELECTED in
1) device_tree ;;
2) partition || SELECTED=1 ;;
3) luks_menu || SELECTED=2 ;;
4) lvm_menu || SELECTED=3 ;;
5) select_partitions || SELECTED=4 ;;
6) configure_settings || SELECTED=5 ;;
7) display_settings ;;
2) partition || SELECTED=$((SELECTED - 1)) ;;
3) luks_menu || SELECTED=$((SELECTED - 1)) ;;
4) lvm_menu || SELECTED=$((SELECTED - 1)) ;;
5) mnt_menu || SELECTED=$((SELECTED - 1)) ;;
6) cfg_menu || SELECTED=$((SELECTED - 1)) ;;
7) show_cfg ;;
8) install ;;
*) yesno "$_CloseInst" "$_CloseInstBody" "Exit" "Back" && die
esac