Selecting apps on the user control panel

This commit is contained in:
Bob Mottram 2018-05-24 13:17:11 +01:00
parent 8861e41128
commit 6781dba015
1 changed files with 9 additions and 16 deletions

View File

@ -812,7 +812,7 @@ function sign_keys {
function menu_run_client_app { function menu_run_client_app {
detect_installable_apps detect_installable_apps
applist="" W=()
appnames=() appnames=()
n=1 n=1
app_index=0 app_index=0
@ -821,7 +821,7 @@ function menu_run_client_app {
do do
if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
if [[ $(function_exists "run_client_${a}") == "1" ]]; then if [[ $(function_exists "run_client_${a}") == "1" ]]; then
applist="$applist $n $a off" W+=("$n" "$a")
n=$((n+1)) n=$((n+1))
appnames+=("$a") appnames+=("$a")
fi fi
@ -831,24 +831,17 @@ function menu_run_client_app {
if [ $n -le 1 ]; then if [ $n -le 1 ]; then
return return
fi fi
backstr=$'Exit'
applist="$applist $n $backstr on"
appnames+=("Exit")
# shellcheck disable=SC2086 # shellcheck disable=SC2086
choice=$(dialog --stdout --backtitle $"Freedombone" \ selection=$(dialog --backtitle $"Freedombone" --title $"Run an App" --menu $"Choose an operation, or ESC for main menu:" 16 70 20 "${W[@]}" 3>&2 2>&1 1>&3)
--title $"Run an App" \
--radiolist $'Choose:' \
16 40 20 $applist)
# shellcheck disable=SC2181 if [ ! "$selection" ]; then
if [ $? -eq 0 ]; then return
app_index=$((choice-1)) fi
app_index=$((selection-1))
chosen_app=${appnames[$app_index]} chosen_app=${appnames[$app_index]}
if [[ $chosen_app != "Exit" ]]; then
"run_client_${chosen_app}" "run_client_${chosen_app}"
fi
fi
} }
function show_your_email_address { function show_your_email_address {