Get the restore app name

This commit is contained in:
Bob Mottram 2016-10-24 18:20:17 +01:00
parent d1de9d191b
commit a1fcbfe42c
1 changed files with 17 additions and 3 deletions

View File

@ -912,23 +912,34 @@ function restore_data_from_storage {
while true
do
app_list=()
n=1
applist="$n $AllStr off"
n=$[n+1]
app_list+=("$AllStr")
util_index=0
for a in "${utils_installed[@]}"
do
applist="$applist $n $a off"
app_name=${utils_installed[util_index]}
n=$[n+1]
util_index=$[util_index+1]
app_list+=("$app_name")
done
app_index=0
for a in "${APPS_INSTALLED_NAMES[@]}"
do
applist="$applist $n $a off"
n=$[n+1]
app_name=${APPS_INSTALLED_NAMES[app_index]}
app_index=$[app_index+1]
app_list+=("$app_name")
done
applist="$applist $n $ExitStr on"
n=$[n+1]
app_list+=("$ExitStr")
choices=$(dialog --stdout --backtitle $"Freedombone" \
--title $"Restore apps" \
@ -937,10 +948,12 @@ function restore_data_from_storage {
sel=$?
case $sel in
1) break;;
255) break;;
1) return;;
255) return;;
esac
app_name=$(cat $data)
selected_index=$(cat $data)
selected_index=$[selected_index-1]
app_name=${app_list[$selected_index]}
# exit
if [[ "$app_name" == "$ExitStr" ]]; then
@ -948,6 +961,7 @@ function restore_data_from_storage {
fi
clear
echo $"Selected $app_name"
# Restore all
if [[ "$app_name" == "$AllStr" ]]; then