From 1464ea0613549c3b31d0371606dd2dd73efca8d7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 17 Mar 2018 21:45:53 +0000 Subject: [PATCH] Wifi menu style --- src/freedombone-controlpanel | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 3882fdf9..3f5903c6 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -2202,31 +2202,24 @@ function menu_wifi { fi fi - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"Wifi Menu" \ - --radiolist $"${status_str}\\n\\nChoose an operation:" 14 70 6 \ - 1 $"Enable or disable Wifi" off \ - 2 $"Configure wifi networks" off \ - 3 $"Manually edit wifi networks file" off \ - 4 $"Hotspot settings" 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 + W=(1 $"Enable or disable Wifi" + 2 $"Configure wifi networks" + 3 $"Manually edit wifi networks file" + 4 $"Hotspot settings") + + # shellcheck disable=SC2068 + selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Wifi Menu" --menu $"${status_str}\\n\\nChoose an operation, or ESC for main menu:" 14 70 6 "${W[@]}" 3>&2 2>&1 1>&3) + + if [ ! "$selection" ]; then + break + fi + + case $selection in 1) wifi_enable;; 2) wifi_settings;; 3) wifi_edit_networks;; 4) hotspot_settings;; - 5) rm -f "$data" - break;; esac - rm -f "$data" done } @@ -2299,6 +2292,7 @@ function menu_top_level { # shellcheck disable=SC2068 selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Administrator Control Panel" --menu $"Choose an operation, or ESC to exit:" 28 60 28 "${W[@]}" 3>&2 2>&1 1>&3) + if [ ! "$selection" ]; then break fi