From 2df98832c9b78169ea7d08f9d1a410f351e504ff Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@robotics.uk.to>
Date: Sat, 19 Nov 2016 16:12:03 +0000
Subject: [PATCH] Selecting apps

---
 src/freedombone-controlpanel | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel
index 08eb84c75..275c1c2b0 100755
--- a/src/freedombone-controlpanel
+++ b/src/freedombone-controlpanel
@@ -144,21 +144,18 @@ function passwords_select_user {
 
 function passwords_show_apps {
     SELECTED_APP=
-    select_all_apps=$1
-    applist=""
-    n=1
-    app_index=0
+    i=0
+    W=()
     for a in "${APPS_AVAILABLE[@]}"
     do
-        applist="$applist $n $a off"
-        n=$[n+1]
-        app_index=$[app_index+1]
+        i=$((i+1))
+        W+=($i "$a")
     done
 
     selected_app_index=$(dialog --backtitle $"Freedombone Control Panel" --title $"Select App" --menu $"Select one of the following:" 24 40 17 "${W[@]}" 3>&2 2>&1 1>&3)
 
     if [ $? -eq 0 ]; then
-        SELECTED_APP="${name[$((selected_app_index-1))]}"
+        SELECTED_APP="${APPS_INSTALLED_NAMES[$((selected_app_index-1))]}"
     fi
 }
 
-- 
GitLab