fix: fix of previous commit and small refactor

This commit is contained in:
th33xitus
2021-09-12 20:46:11 +02:00
parent 68327262fc
commit 65bf3d5251
4 changed files with 23 additions and 26 deletions

View File

@@ -38,14 +38,14 @@ ms_theme_ui(){
echo -e "| | "
echo -e "| R) [Remove Theme] | "
#echo -e "| | "
quit_footer
back_footer
}
ms_theme_menu(){
ms_theme_ui
while true; do
read -p "${cyan}Install theme:${default} " a; echo
if [ $a = "q" ] || [ $a = "Q" ]; then
if [ $a = "b" ] || [ $a = "B" ]; then
clear && advanced_menu && break
elif [ $a = "r" ] || [ $a = "R" ]; then
ms_theme_delete

View File

@@ -50,6 +50,25 @@ load_klipper_state(){
rollback_klipper
}
rollback_ui(){
top_border
echo -e "| $(title_msg "~~~~~~~~~~~~~ [ Rollback Menu ] ~~~~~~~~~~~~~") | "
hr
echo -e "| If serious errors occured after updating Klipper, | "
echo -e "| you can use this menu to return to the previously | "
echo -e "| used commit from which you have updated. | "
bottom_border
top_border
echo -e "| Active branch: ${green}$PRINT_BRANCH${default} | "
hr
echo -e "| Currently on commit: | "
echo -e "| $CURR_UI | "
hr
echo -e "| Commit last updated from: | "
echo -e "| $PREV_UI | "
back_footer
}
rollback_klipper(){
if [ "$PREVIOUS_COMMIT" != "0" ] && [ "$CURRENT_COMMIT" != "$PREVIOUS_COMMIT" ]; then
while true; do
@@ -66,7 +85,7 @@ rollback_klipper(){
load_klipper_state
break;;
N|n|No|no) clear; advanced_menu; break;;
Q|q) clear; advanced_menu; break;;
B|b) clear; advanced_menu; break;;
*)
print_unkown_cmd
print_msg && clear_msg;;

View File

@@ -151,28 +151,6 @@ switch_menu(){
#############################################################
#############################################################
rollback_ui(){
top_border
echo -e "| $(title_msg "~~~~~~~~~~~~~ [ Rollback Menu ] ~~~~~~~~~~~~~") | "
hr
echo -e "| If serious errors occured after updating Klipper, | "
echo -e "| you can use this menu to return to the previously | "
echo -e "| used commit from which you have updated. | "
bottom_border
top_border
echo -e "| Active branch: ${green}$PRINT_BRANCH${default} | "
hr
echo -e "| Currently on commit: | "
echo -e "| $CURR_UI | "
hr
echo -e "| Commit last updated from: | "
echo -e "| $PREV_UI | "
back_footer
}
#############################################################
#############################################################
migration_ui(){
top_border
echo -e "| $(title_msg "~~~~~~~~~ [ CustomPiOS Migration ] ~~~~~~~~~~") | "

View File

@@ -74,7 +74,7 @@ upload_selection(){
back_footer
while true; do
read -p "${cyan}Please select:${default} " choice
if [ $choice = "q" ] || [ $choice = "Q" ]; then
if [ $choice = "b" ] || [ $choice = "B" ]; then
clear && main_menu && break
elif [ $choice -le ${#logfiles[@]} ]; then
upload_log "${logfiles[$choice]}"