Ver código fonte

peertube configuration menu style

Bob Mottram 7 anos atrás
pai
commit
56825ad323
1 arquivos alterados com 13 adições e 18 exclusões
  1. 13
    18
      src/freedombone-app-peertube

+ 13
- 18
src/freedombone-app-peertube Ver arquivo

@@ -382,31 +382,26 @@ function peertube_import_videos {
382 382
 }
383 383
 
384 384
 function configure_interactive_peertube {
385
+    W=(1 $"Set administrator email address"
386
+       2 $"Disable or enable signups"
387
+       3 $"Import videos from YouTube/Vimeo/Dailymotion"
388
+       4 $"Import video from file")
389
+
385 390
     while true
386 391
     do
387
-        data=$(mktemp 2>/dev/null)
388
-        dialog --backtitle $"Freedombone Control Panel" \
389
-               --title $"PeerTube" \
390
-               --radiolist $"Choose an operation:" 12 70 6 \
391
-               1 $"Set administrator email address" off \
392
-               2 $"Disable or enable signups" off \
393
-               3 $"Import videos from YouTube/Vimeo/Dailymotion" off \
394
-               4 $"Import video from file" off \
395
-               5 $"Exit" on 2> "$data"
396
-        sel=$?
397
-        case $sel in
398
-            1) break;;
399
-            255) break;;
400
-        esac
401
-        case $(cat "$data") in
392
+        # shellcheck disable=SC2068
393
+        selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"PeerTube" --menu $"Choose an operation, or ESC to exit:" 24 60 24 "${W[@]}" 3>&2 2>&1 1>&3)
394
+
395
+        if [ ! "$selection" ]; then
396
+            break
397
+        fi
398
+
399
+        case $selection in
402 400
             1) peertube_set_admin_email;;
403 401
             2) peertube_disable_signups;;
404 402
             3) peertube_import_videos;;
405 403
             4) peertube_import_from_file;;
406
-            5) rm -f "$data"
407
-               break;;
408 404
         esac
409
-        rm -f "$data"
410 405
     done
411 406
 }
412 407