script: rename general_ui and separate dialog
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
#ui total width = 57 chars
|
#ui total width = 57 chars
|
||||||
top_border(){
|
top_border(){
|
||||||
echo -e "/=======================================================\\"
|
echo -e "/=======================================================\\"
|
||||||
@@ -48,11 +49,8 @@ print_header(){
|
|||||||
|
|
||||||
do_action(){
|
do_action(){
|
||||||
clear && print_header
|
clear && print_header
|
||||||
### $1 is the action the user wants to fire
|
|
||||||
$1
|
$1
|
||||||
print_msg && clear_msg
|
print_msg && clear_msg
|
||||||
### $2 is the menu the user usually gets directed back to after an action is completed
|
|
||||||
$2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deny_action(){
|
deny_action(){
|
||||||
@@ -62,30 +60,4 @@ deny_action(){
|
|||||||
$1
|
$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
|
|
||||||
}
|
|
||||||
27
scripts/ui/update_dialog.sh
Normal file
27
scripts/ui/update_dialog.sh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#######################################
|
||||||
|
# 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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user