result="$y $x"
}
-gsu_infobox()
-{
- _get_geometry
- dialog --infobox "$1" $result
-}
-
-gsu_checklist_all_on()
-{
- local header="$1"
- local items="$2"
- local i state opts num=0
-
- _get_geometry
- ops="$result 16"
- for i in $items; do
- let num++
- opts+=" $i $num on"
- done
- result=$(dialog --checklist "$header" $opts 3>&1 1>&2 2>&3 3>&-)
- ret="$?"
-}
-
-gsu_radiolist()
-{
- local header="$1"
- local selected_item="$2"
- local items="$3"
- local i state ops num=0
-
- _get_geometry
- ops="$result 16"
- for i in $items; do
- let num++
- if [[ "$i" == "$selected_item" ]]; then
- state="on"
- else
- state="off"
- fi
- ops+=" $i $num $state"
- done
- result=$(dialog --radiolist "$header" $ops 3>&1 1>&2 2>&3 3>&-)
- ret="$?"
-}
-
gsu_inputbox()
{
local g text="$1" init="$2"
rm -f "$tmp"
}
-gsu_cmd_output_box()
-{
- local tmp="$(mktemp)"
-
- if (($? != 0)); then
- dialog --msgbox "mktemp error" 0 0
- return
- fi
- $@ > "$tmp" 2>&1
- echo "exit code: $?" >> "$tmp"
- gsu_textbox "$tmp"
- rm -f "$tmp"
-}
-
-gsu_yesno()
-{
- local text="$1"
-
- _get_geometry
- dialog --yesno "$text" $result
- ret=$?
- if (($ret == 0)); then
- result="yes"
- elif (($ret == 1)); then
- result="no"
- else
- result=
- fi
-}
-
gsu_menu()
{
local header="${1:-root}"