script: Move functions

hove print_kiauh_version and kiauh_update_dialog to general_ui and functions

main_menu performance improvements
This commit is contained in:
Yifei Ding
2021-11-12 14:44:05 -08:00
parent 980f6d5ddd
commit 90208f6480
4 changed files with 80 additions and 50 deletions

View File

@@ -61,3 +61,31 @@ deny_action(){
print_msg && clear_msg
$1
}
#######################################
# description Advise user to update KIAUH
# Globals:
# KIAUH_WHIPTAIL_NORMAL_HEIGHT
# KIAUH_WHIPTAIL_NORMAL_WIDTH
# RET
# Arguments:
# None
#######################################
kiauh_update_dialog() {
whiptail --title "New KIAUH update available!" \
--yesno \
"View Changelog: https://git.io/JnmlX
It is recommended to keep KIAUH up to date. Updates usually contain bugfixes, \
important changes or new features. Please consider updating!
Do you want to update now?" \
"$KIAUH_WHIPTAIL_NORMAL_HEIGHT" "$KIAUH_WHIPTAIL_NORMAL_WIDTH"
local out=$?
if [ $out -eq 0 ]; then
do_action "update_kiauh"
else
deny_action "kiauh_update_dialog"
fi
}