Kaynağa Gözat

list of app names

Bob Mottram 7 yıl önce
ebeveyn
işleme
007c45c5a3
1 değiştirilmiş dosya ile 4 ekleme ve 9 silme
  1. 4
    9
      src/freedombone-controlpanel

+ 4
- 9
src/freedombone-controlpanel Dosyayı Görüntüle

1894
 function menu_app_settings {
1894
 function menu_app_settings {
1895
     detect_installable_apps
1895
     detect_installable_apps
1896
 
1896
 
1897
-    applist=""
1897
+    W=()
1898
     appnames=()
1898
     appnames=()
1899
     n=1
1899
     n=1
1900
     app_index=0
1900
     app_index=0
1903
     do
1903
     do
1904
         if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
1904
         if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
1905
             if [[ $(function_exists "configure_interactive_${a}") == "1" ]]; then
1905
             if [[ $(function_exists "configure_interactive_${a}") == "1" ]]; then
1906
-                applist="$applist $n $a off"
1906
+                W+=("$n" "$a")
1907
                 n=$((n+1))
1907
                 n=$((n+1))
1908
                 appnames+=("$a")
1908
                 appnames+=("$a")
1909
             fi
1909
             fi
1913
     if [ $n -le 1 ]; then
1913
     if [ $n -le 1 ]; then
1914
         return
1914
         return
1915
     fi
1915
     fi
1916
-    backstr=$'Exit'
1917
-    applist="$applist $n $backstr on"
1918
-    appnames+=("Exit")
1919
 
1916
 
1920
     # shellcheck disable=SC2086
1917
     # shellcheck disable=SC2086
1921
     choice=$(dialog --stdout --backtitle $"Freedombone" \
1918
     choice=$(dialog --stdout --backtitle $"Freedombone" \
1922
                     --title $"Change settings for an App" \
1919
                     --title $"Change settings for an App" \
1923
                     --menu $'Choose:' \
1920
                     --menu $'Choose:' \
1924
-                    26 40 30 $applist 3>&2 2>&1 1>&3)
1921
+                    26 40 30 "${W[@]}" 3>&2 2>&1 1>&3)
1925
 
1922
 
1926
     # shellcheck disable=SC2181
1923
     # shellcheck disable=SC2181
1927
     if [ "$choice" ]; then
1924
     if [ "$choice" ]; then
1928
         app_index=$((choice-1))
1925
         app_index=$((choice-1))
1929
         chosen_app=${appnames[$app_index]}
1926
         chosen_app=${appnames[$app_index]}
1930
-        if [[ $chosen_app != "Exit" ]]; then
1931
-            "configure_interactive_${chosen_app}"
1932
-        fi
1927
+        "configure_interactive_${chosen_app}"
1933
     fi
1928
     fi
1934
 }
1929
 }
1935
 
1930