Przeglądaj źródła

etherpad configuration menu style

Bob Mottram 7 lat temu
rodzic
commit
7f027206e6
1 zmienionych plików z 11 dodań i 18 usunięć
  1. 11
    18
      src/freedombone-app-etherpad

+ 11
- 18
src/freedombone-app-etherpad Wyświetl plik

@@ -269,29 +269,22 @@ function etherpad_set_welcome_message {
269 269
 }
270 270
 
271 271
 function configure_interactive_etherpad {
272
+    W=(1 $"Set Title"
273
+       2 $"Set a welcome message")
274
+
272 275
     while true
273 276
     do
274
-        data=$(mktemp 2>/dev/null)
275
-        dialog --backtitle $"Freedombone Control Panel" \
276
-               --title $"Etherpad Settings" \
277
-               --radiolist $"Choose an operation:" 12 70 3 \
278
-               1 $"Set Title" off \
279
-               2 $"Set a welcome message" off \
280
-               3 $"Exit" on 2> "$data"
281
-        sel=$?
282
-        case $sel in
283
-            1) rm -f "$data"
284
-               return;;
285
-            255) rm -f "$data"
286
-                 return;;
287
-        esac
288
-        case $(cat "$data") in
277
+        # shellcheck disable=SC2068
278
+        selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Etherpad" --menu $"Choose an operation, or ESC to exit:" 10 60 2 "${W[@]}" 3>&2 2>&1 1>&3)
279
+
280
+        if [ ! "$selection" ]; then
281
+            break
282
+        fi
283
+
284
+        case $selection in
289 285
             1) etherpad_set_title;;
290 286
             2) etherpad_set_welcome_message;;
291
-            3) rm -f "$data"
292
-               break;;
293 287
         esac
294
-        rm -f "$data"
295 288
     done
296 289
 }
297 290