1if [ ! "$_NETWORKING_MEDIA_SUBR" ]; then _NETWORKING_MEDIA_SUBR=1
2#
3# Copyright (c) 2006-2012 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/networking/share/media.subr 240684 2012-09-18 22:28:42Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_include $BSDCFG_SHARE/dialog.subr
34f_include $BSDCFG_SHARE/strings.subr
35f_include $BSDCFG_SHARE/sysrc.subr
--- 82 unchanged lines hidden (view full) ---
118 "$setting" )"
119 f_dialog_msgbox "$message"
120 return $FAILURE
121 fi
122
123 local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )"
124 local hline="$hline_alnum_punc_tab_enter"
125
126 $DIALOG \
127 --title "$DIALOG_TITLE" \
128 --backtitle "$DIALOG_BACKTITLE" \
129 --hline "$hline" \
130 --ok-label "$msg_ok" \
131 --cancel-label "$msg_cancel" \
132 --inputbox "$msg" 9 70 \
133 "$options" \
134 2> "$DIALOG_TMPDIR/dialog.inputbox.$$"
135
136 local retval=$?
137 local _options="$( f_dialog_inputstr )"
138
139 [ $retval -eq $SUCCESS ] && options="$_options"
140
141 return $retval
142}
143
144# f_dialog_menu_media_options $interface
--- 55 unchanged lines hidden (view full) ---
200 "$interface" "$interface" )
201 else
202 msg=$( printf "$msg_supported_media_options" \
203 "$interface" "$interface" )
204 fi
205
206 local hline="$hline_arrows_tab_enter"
207
208 eval $DIALOG \
209 --clear --title \"\$DIALOG_TITLE\" \
210 --backtitle \"\$DIALOG_BACKTITLE\" \
211 --hline \"\$hline\" \
212 --ok-label \"\$msg_ok\" \
213 --cancel-label \"\$msg_cancel\" \
214 --menu \"\$msg\" 21 60 12 \
215 $supported_media \
216 2> "$DIALOG_TMPDIR/dialog.menu.$$"
217
218 local retval=$?
219 if [ $retval -eq $SUCCESS ]; then
220 local tag="$( f_dialog_menutag )"
221 options=$( eval f_dialog_menutag2item \"\$tag\" \
222 $supported_media )
223 [ "$options" = "$opt_none" ] && options=
224
225 if [ "$options" = "$opt_cust" ]; then
226 options="$_options"
227 f_dialog_input_options "$interface"
228 retval=$?
229 fi
230 fi
231
232 return $retval
233}
234
235fi # ! $_NETWORKING_MEDIA_SUBR
2#
3# Copyright (c) 2006-2012 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/networking/share/media.subr 240684 2012-09-18 22:28:42Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_include $BSDCFG_SHARE/dialog.subr
34f_include $BSDCFG_SHARE/strings.subr
35f_include $BSDCFG_SHARE/sysrc.subr
--- 82 unchanged lines hidden (view full) ---
118 "$setting" )"
119 f_dialog_msgbox "$message"
120 return $FAILURE
121 fi
122
123 local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )"
124 local hline="$hline_alnum_punc_tab_enter"
125
126 $DIALOG \
127 --title "$DIALOG_TITLE" \
128 --backtitle "$DIALOG_BACKTITLE" \
129 --hline "$hline" \
130 --ok-label "$msg_ok" \
131 --cancel-label "$msg_cancel" \
132 --inputbox "$msg" 9 70 \
133 "$options" \
134 2> "$DIALOG_TMPDIR/dialog.inputbox.$$"
135
136 local retval=$?
137 local _options="$( f_dialog_inputstr )"
138
139 [ $retval -eq $SUCCESS ] && options="$_options"
140
141 return $retval
142}
143
144# f_dialog_menu_media_options $interface
--- 55 unchanged lines hidden (view full) ---
200 "$interface" "$interface" )
201 else
202 msg=$( printf "$msg_supported_media_options" \
203 "$interface" "$interface" )
204 fi
205
206 local hline="$hline_arrows_tab_enter"
207
208 eval $DIALOG \
209 --clear --title \"\$DIALOG_TITLE\" \
210 --backtitle \"\$DIALOG_BACKTITLE\" \
211 --hline \"\$hline\" \
212 --ok-label \"\$msg_ok\" \
213 --cancel-label \"\$msg_cancel\" \
214 --menu \"\$msg\" 21 60 12 \
215 $supported_media \
216 2> "$DIALOG_TMPDIR/dialog.menu.$$"
217
218 local retval=$?
219 if [ $retval -eq $SUCCESS ]; then
220 local tag="$( f_dialog_menutag )"
221 options=$( eval f_dialog_menutag2item \"\$tag\" \
222 $supported_media )
223 [ "$options" = "$opt_none" ] && options=
224
225 if [ "$options" = "$opt_cust" ]; then
226 options="$_options"
227 f_dialog_input_options "$interface"
228 retval=$?
229 fi
230 fi
231
232 return $retval
233}
234
235fi # ! $_NETWORKING_MEDIA_SUBR