gnusocial configuration menu style

This commit is contained in:
Bob Mottram 2018-04-04 12:42:18 +01:00
parent 54ec3b2dda
commit 70ef18780a
1 changed files with 15 additions and 21 deletions

View File

@ -303,37 +303,31 @@ function gnusocial_set_expire_months {
}
function configure_interactive_gnusocial {
W=(1 $"Set a background image"
2 $"Set the title"
3 $"Set post expiry period (currently $GNUSOCIAL_EXPIRE_MONTHS months)"
4 $"Select Qvitter user interface"
5 $"Select Pleroma user interface"
6 $"Select Classic user interface")
read_config_param GNUSOCIAL_EXPIRE_MONTHS
while true
do
data=$(mktemp 2>/dev/null)
dialog --backtitle $"Freedombone Control Panel" \
--title $"GNU Social" \
--radiolist $"Choose an operation:" 16 70 7 \
1 $"Set a background image" off \
2 $"Set the title" off \
3 $"Set post expiry period (currently $GNUSOCIAL_EXPIRE_MONTHS months)" off \
4 $"Select Qvitter user interface" off \
5 $"Select Pleroma user interface" off \
6 $"Select Classic user interface" off \
7 $"Exit" on 2> "$data"
sel=$?
case $sel in
1) rm -f "$data"
return;;
255) rm -f "$data"
return;;
esac
case $(cat "$data") in
# shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"GNU Social" --menu $"Choose an operation, or ESC to exit:" 15 60 6 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then
break
fi
case $selection in
1) gnusocial_set_background_image;;
2) gnusocial_set_title;;
3) gnusocial_set_expire_months;;
4) gnusocial_use_qvitter gnusocial;;
5) gnusocial_use_pleroma gnusocial;;
6) gnusocial_use_classic gnusocial;;
7) break;;
esac
rm -f "$data"
done
}