koel configuration menu style

This commit is contained in:
Bob Mottram 2018-04-04 12:50:32 +01:00
parent 4f87aedfd6
commit 383619b029
1 changed files with 13 additions and 20 deletions

View File

@ -272,33 +272,26 @@ function format_music_drive {
function configure_interactive_koel {
W=(1 $"Import music from directory"
2 $"Import music from USB drive"
3 $"Export music to USB drive"
4 $"Format a USB drive for music storage")
while true
do
data=$(mktemp 2>/dev/null)
dialog --backtitle $"Freedombone Control Panel" \
--title $"Koel" \
--radiolist $"Choose an operation:" 12 70 5 \
1 $"Import music from directory" off \
2 $"Import music from USB drive" off \
3 $"Export music to USB drive" off \
4 $"Format a USB drive for music storage" off \
5 $"Exit" on 2> "$data"
sel=$?
case $sel in
1) rm -f "$data"
break;;
255) rm -f "$data"
break;;
esac
case $(cat "$data") in
# shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Koel" --menu $"Choose an operation, or ESC to exit:" 12 60 4 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then
break
fi
case $selection in
1) koel_import_from_directory;;
2) koel_import_from_usb;;
3) koel_export_to_usb;;
4) format_music_drive;;
5) rm -f "$data"
break;;
esac
rm -f "$data"
done
}