1if [ ! "$_MEDIA_ANY_SUBR" ]; then _MEDIA_ANY_SUBR=1
2#
3# Copyright (c) 2012-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/media/any.subr 251236 2013-06-01 23:58:44Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." media/any.subr
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/struct.subr
--- 53 unchanged lines hidden (view full) ---
89 local height width rows
90 eval f_dialog_menu_size height width rows \
91 \"\$title\" \
92 \"\$btitle\" \
93 \"\$prompt\" \
94 \"\$hline\" \
95 $menu_list
96
97 local mtag
98 while :; do
99 mtag=$( eval $DIALOG \
100 --title \"\$title\" \
101 --backtitle \"\$btitle\" \
102 --hline \"\$hline\" \
103 --ok-label \"\$msg_ok\" \
104 --cancel-label \"\$msg_cancel\" \
105 --help-button \
106 --help-label \"\$msg_help\" \
107 ${USE_XDIALOG:+--help \"\"} \
108 --menu \"\$prompt\" \
109 $height $width $rows \
110 $menu_list \
111 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
112 )
113 local retval=$?
114 f_dialog_data_sanitize mtag
115 f_dprintf "retval=%s mtag=[%s]" $retval "$mtag"
116
117 if [ $retval -eq 2 ]; then
118 # The Help button was pressed
119 f_show_help "$MEDIA_HELPFILE"
120 continue
121 elif [ $retval -ne 0 ]; then
122 return $FAILURE
--- 29 unchanged lines hidden ---
2#
3# Copyright (c) 2012-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/media/any.subr 251236 2013-06-01 23:58:44Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." media/any.subr
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/struct.subr
--- 53 unchanged lines hidden (view full) ---
89 local height width rows
90 eval f_dialog_menu_size height width rows \
91 \"\$title\" \
92 \"\$btitle\" \
93 \"\$prompt\" \
94 \"\$hline\" \
95 $menu_list
96
97 local mtag
98 while :; do
99 mtag=$( eval $DIALOG \
100 --title \"\$title\" \
101 --backtitle \"\$btitle\" \
102 --hline \"\$hline\" \
103 --ok-label \"\$msg_ok\" \
104 --cancel-label \"\$msg_cancel\" \
105 --help-button \
106 --help-label \"\$msg_help\" \
107 ${USE_XDIALOG:+--help \"\"} \
108 --menu \"\$prompt\" \
109 $height $width $rows \
110 $menu_list \
111 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
112 )
113 local retval=$?
114 f_dialog_data_sanitize mtag
115 f_dprintf "retval=%s mtag=[%s]" $retval "$mtag"
116
117 if [ $retval -eq 2 ]; then
118 # The Help button was pressed
119 f_show_help "$MEDIA_HELPFILE"
120 continue
121 elif [ $retval -ne 0 ]; then
122 return $FAILURE
--- 29 unchanged lines hidden ---