Procházet zdrojové kódy

Different menu style

Bob Mottram před 7 roky
rodič
revize
e96027b8d3
1 změnil soubory, kde provedl 30 přidání a 37 odebrání
  1. 30
    37
      src/freedombone-controlpanel

+ 30
- 37
src/freedombone-controlpanel Zobrazit soubor

@@ -2275,41 +2275,37 @@ function menu_app_settings {
2275 2275
 function menu_top_level {
2276 2276
     while true
2277 2277
     do
2278
-        data=$(mktemp 2>/dev/null)
2279
-        dialog --backtitle $"Freedombone Control Panel" \
2280
-               --title $"Control Panel" \
2281
-               --radiolist $"Choose an operation:" 30 70 22 \
2282
-               1 $"About this system" off \
2283
-               2 $"Passwords" off \
2284
-               3 $"Backup and Restore" off \
2285
-               4 $"Show Firewall" off \
2286
-               5 $"Verify Tripwire Code" off \
2287
-               6 $"Reset Tripwire" off \
2288
-               7 $"App Settings" off \
2289
-               8 $"Add/Remove Apps" off \
2290
-               9 $"Logging on/off" off \
2291
-               10 $"Ping enable/disable" off \
2292
-               11 $"Manage Users" off \
2293
-               12 $"Email Menu" off \
2294
-               13 $"Domain or User Blocking" off \
2295
-               14 $"Security Settings" off \
2296
-               15 $"Change the name of this system" off \
2297
-               16 $"Set a static local IP address" off \
2298
-               17 $"Wifi menu" off \
2299
-               18 $"Add Clacks" off \
2300
-               19 $"Check for updates" off \
2301
-               20 $"Power off the system" off \
2302
-               21 $"Restart the system" off \
2303
-               22 $"Exit" on 2> "$data"
2304
-        sel=$?
2305
-        case $sel in
2306
-            1) rm -f "$data"
2307
-               exit 1;;
2308
-            255) rm -f "$data"
2309
-                 exit 1;;
2310
-        esac
2278
+        W=(1 $"About this system"
2279
+           2 $"Passwords"
2280
+           3 $"Backup and Restore"
2281
+           4 $"Show Firewall"
2282
+           5 $"Verify Tripwire Code"
2283
+           6 $"Reset Tripwire"
2284
+           7 $"App Settings"
2285
+           8 $"Add/Remove Apps"
2286
+           9 $"Logging on/off"
2287
+           10 $"Ping enable/disable"
2288
+           11 $"Manage Users"
2289
+           12 $"Email Menu"
2290
+           13 $"Domain or User Blocking"
2291
+           14 $"Security Settings"
2292
+           15 $"Change the name of this system"
2293
+           16 $"Set a static local IP address"
2294
+           17 $"Wifi menu"
2295
+           18 $"Add Clacks"
2296
+           19 $"Check for updates"
2297
+           20 $"Power off the system"
2298
+           21 $"Restart the system")
2299
+
2300
+        # shellcheck disable=SC2068
2301
+        selection=$(dialog --backtitle $"Freedombone Control Panel" --title $"Control Panel" --menu $"Choose an operation, or ESC to exit:" 24 40 17 "${W[@]}" 3>&2 2>&1 1>&3)
2302
+        if [ ! "$selection" ]; then
2303
+            break
2304
+        fi
2305
+
2311 2306
         please_wait
2312
-        case $(cat "$data") in
2307
+
2308
+        case $selection in
2313 2309
             1) show_about;;
2314 2310
             2) view_or_change_passwords;;
2315 2311
             3) menu_backup_restore;;
@@ -2335,10 +2331,7 @@ function menu_top_level {
2335 2331
             19) check_for_updates;;
2336 2332
             20) shut_down_system;;
2337 2333
             21) restart_system;;
2338
-            22) rm -f "$data"
2339
-                break;;
2340 2334
         esac
2341
-        rm -f "$data"
2342 2335
     done
2343 2336
 }
2344 2337