Make the ui more consistant and less verbose.

This commit is contained in:
Storm Dragon 2020-07-07 17:57:46 -04:00
parent c73e4e613e
commit 0aecfda4ad

View File

@ -30,7 +30,7 @@ inputbox() {
# Returns: text entered by the user # Returns: text entered by the user
# Args 1, Instructions for box. # Args 1, Instructions for box.
# args: 2 initial text (optional) # args: 2 initial text (optional)
dialog --backtitle "$(gettext "Enter text and press enter.")" \ dialog --backtitle "Stormux" \
--clear \ --clear \
--inputbox "$1" 0 0 "$2" --stdout --inputbox "$1" 0 0 "$2" --stdout
} }
@ -39,7 +39,7 @@ passwordbox() {
# Returns: text entered by the user # Returns: text entered by the user
# Args 1, Instructions for box. # Args 1, Instructions for box.
# args: 2 initial text (optional) # args: 2 initial text (optional)
dialog --backtitle "$(gettext "Enter text and press enter.")" \ dialog --backtitle "Stormux" \
--clear \ --clear \
--passwordbox "$1" 0 0 "$2" --stdout --passwordbox "$1" 0 0 "$2" --stdout
} }
@ -65,7 +65,7 @@ yesno() {
# Args: Question to user. # Args: Question to user.
# Called in if $(yesno) == "Yes" # Called in if $(yesno) == "Yes"
# Or variable=$(yesno) # Or variable=$(yesno)
dialog --clear --backtitle "$(gettext "Press 'Enter' for \"yes\" or 'Escape' for \"no\".")" --yesno "$*" 10 80 --stdout dialog --clear --backtitle "Stormux" --yesno "$*" 10 80 --stdout
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo "Yes" echo "Yes"
else else
@ -80,7 +80,7 @@ menulist() {
for i in "${@}" ; do for i in "${@}" ; do
menuList+=("$i" "$i") menuList+=("$i" "$i")
done done
dialog --backtitle "Use the up and down arrow keys to find the option you want, then press enter to select it." \ dialog --backtitle "Stormux" \
--clear \ --clear \
--no-tags \ --no-tags \
--menu "Please select an option" 0 0 0 ${menuList[@]} --stdout --menu "Please select an option" 0 0 0 ${menuList[@]} --stdout