Lines Matching +full:display +full:- +full:rows

3 # Copyright (c) 2006-2015 Devin Teske
43 # execution of dialog from within a sub-shell (so-long as its standard output
46 : ${DIALOG_TERMINAL_PASSTHRU_FD:=${TERMINAL_STDOUT_PASSTHRU:-3}}
52 # NOTE: This is changed to "Xdialog" by the optional `-X' argument
68 # Declare that we are fully-compliant with Xdialog(1) by unset'ing all
78 DIALOG_OK=${SUCCESS:-0}
79 DIALOG_CANCEL=${FAILURE:-1}
83 export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1'
119 # height (but does for width) -- a height of 3 will display three lines and a
138 # After execution, the variables will hold their newly-sanitized data.
142 if [ "$#" -eq 0 ]; then
157 if ( $0 ~ /^Gdk-WARNING \*\*:/ ) next
175 # After execution, the variables will hold their newly-sanitized data.
182 if [ "$#" -eq 0 ]; then
197 if ( $0 ~ /^Gdk-WARNING \*\*:/ ) next
217 # allowing a one-time (single-level) restoration of the previous title using
244 # Restoration is non-recursive and only works to restore the most-recent title.
285 # Restoration is non-recursive and only works to restore the most-recent
308 [ "$__var_height" -o "$__var_width" ] || return $FAILURE
312 if __max_size=$( $DIALOG --print-maxsize \
315 f_dprintf "$funcname: %s --print-maxsize = [%s]" \
321 f_eval_catch -dk __max_size $funcname stty \
331 # will render --backtitle behind the widget. In such a case, we
333 # $NO_BACKTITLE is set and non-NULL, allowing a trap-door).
347 [ ${__height:-0} -gt 11 ] &&
348 __height=$(( $__height - $__adjust ))
357 # Modify $var_height to be no-less-than $min_height (if given; zero otherwise)
358 # and no-greater-than terminal height (or screen height if $USE_XDIALOG is
361 # Also modify $var_width to be no-less-than $XDIALOG_MIN_WIDTH (or
362 # $XDIALOG_MIN_WIDTH if $_USE_XDIALOG is set) and no-greater-than terminal
376 [ "$__var_height" -o "$__var_width" ] || return $FAILURE
379 # Print debug warnings if any given (non-NULL) argument are invalid
415 if [ $__height -lt ${__min_height:-0} ]; then
417 elif [ $__height -gt $__max_height_size_constrain ]; then
425 : ${__min_width:=${XDIALOG_MIN_WIDTH:-35}}
427 : ${__min_width:=${DIALOG_MIN_WIDTH:-24}}
429 if [ $__width -lt $__min_width ]; then
431 elif [ $__width -gt $__max_width_size_constrain ]; then
448 # Modify $var_height to be no-less-than $min_height (if given; zero otherwise)
449 # and no-greater-than terminal height (or screen height if $USE_XDIALOG is
452 # Also modify $var_width to be no-less-than $XDIALOG_MIN_WIDTH (or
453 # $XDIALOG_MIN_WIDTH if $_USE_XDIALOG is set) and no-greater-than terminal
457 # Last, modify $var_rows to be no-less-than $min_rows (if specified; zero
458 # otherwise) and no-greater-than (max_height - 8) where max_height is the
460 # or missing, dialog(1) allows $var_rows to be (max_height - 7), maximizing the
461 # number of visible rows.
472 [ "$__var_height" -o "$__var_width" -o "$__var_rows" ] ||
476 # Print debug warnings if any given (non-NULL) argument are invalid
477 # NOTE: Don't change the name of $__{var,min,}{height,width,rows}
482 for __arg in height width rows; do
495 for __arg in height width rows; do
513 if [ $__height_menu_constrain -lt ${__min_height:-0} ]; then
515 elif [ $__height_menu_constrain -gt \
525 : ${__min_width:=${XDIALOG_MIN_WIDTH:-35}}
527 : ${__min_width:=${DIALOG_MIN_WIDTH:-24}}
529 if [ $__width_menu_constrain -lt $__min_width ]; then
531 elif [ $__width_menu_constrain -gt \
538 # Adjust rows if desired
547 $__max_height_menu_constrain - 7
549 # If prompt_len is zero (no prompt), bump the max-rows by 1
551 [ ${__prompt_len:-0} -gt 0 ] || __max_rows_menu_constrain=$((
555 if [ $__rows_menu_constrain -lt $__min_rows ]; then
557 elif [ $__rows_menu_constrain -gt $__max_rows_menu_constrain ]
573 # f_dialog_infobox_size [-n] $var_height $var_width \
576 # Not all versions of dialog(1) perform auto-sizing of the width and height of
577 # `--infobox' boxes sensibly.
586 # If the first argument is `-n', the calculated sizes ($var_height and
589 # Newline character sequences (``\n'') in $prompt are expanded as-is done by
595 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
600 [ "$__var_height" -o "$__var_width" ] || return $FAILURE
602 # Default height/width of zero for auto-sizing
608 # Set height based on number of rows in prompt
610 __n=$( echo -n "$__prompt" | f_number_of_lines )
612 [ $__n -gt $__height ] && __height=$__n
619 if [ "$USE_XDIALOG" -a "$__btitle" ]; then
633 [ $__n -gt $__width ] && __width=$__n
641 [ $__n -gt $__width ] && __width=$__n
649 [ $__n -gt $__width ] && __width=$__n
652 # Bump width for long hlines. Xdialog(1) supports `--hline' but
658 [ $__n -gt $__width ] && __width=$__n
667 # Constrain values to sensible minimums/maximums unless `-n' was passed
668 # Return success if no-constrain, else return status from constrain
673 # f_dialog_buttonbox_size [-n] $var_height $var_width \
676 # Not all versions of dialog(1) perform auto-sizing of the width and height of
677 # `--msgbox' and `--yesno' boxes sensibly.
686 # If the first argument is `-n', the calculated sizes ($var_height and
689 # Newline character sequences (``\n'') in $prompt are expanded as-is done by
695 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
700 [ "$__var_height" -o "$__var_width" ] || return $FAILURE
706 f_dialog_infobox_size -n \
723 # No adjustemnts to width, just pass-thru the infobox width
728 # Constrain values to sensible minimums/maximums unless `-n' was passed
729 # Return success if no-constrain, else return status from constrain
734 # f_dialog_inputbox_size [-n] $var_height $var_width \
737 # Not all versions of dialog(1) perform auto-sizing of the width and height of
738 # `--inputbox' boxes sensibly.
747 # If the first argument is `-n', the calculated sizes ($var_height and
750 # Newline character sequences (``\n'') in $prompt are expanded as-is done by
756 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
761 [ "$__var_height" -o "$__var_width" ] || return $FAILURE
767 f_dialog_buttonbox_size -n \
787 [ $__n -gt $__width_ibox_size ] && __width_ibox_size=$__n
792 # Constrain values to sensible minimums/maximums unless `-n' was passed
793 # Return success if no-constrain, else return status from constrain
798 # f_xdialog_2inputsbox_size [-n] $var_height $var_width \
802 # Xdialog(1) does not perform auto-sizing of the width and height of
803 # `--2inputsbox' boxes sensibly.
814 # If the first argument is `-n', the calculated sizes ($var_height and
817 # Newline character sequences (``\n'') in $prompt are expanded as-is done by
823 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
829 [ "$__var_height" -o "$__var_width" ] || return $FAILURE
835 f_dialog_inputbox_size -n \
854 [ $__n -gt $__width_2ibox_size ] && __width_2ibox_size=$__n
859 [ $__n -gt $__width_2ibox_size ] && __width_2ibox_size=$__n
865 [ $__n -gt $__width_2ibox_size ] && __width_2ibox_size=$__n
870 # Constrain values to sensible minimums/maximums unless `-n' was passed
871 # Return success if no-constrain, else return status from constrain
876 # f_dialog_menu_size [-n] $var_height $var_width $var_rows \
880 # Not all versions of dialog(1) perform auto-sizing of the width and height of
881 # `--menu' boxes sensibly.
885 # storing the calculated height, width, and rows. The second set of arguments
888 # optimal height, width, and rows for the described widget (not exceeding the
892 # If the first argument is `-n', the calculated sizes ($var_height, $var_width,
898 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
904 [ "$__var_height" -o "$__var_width" -o "$__var_rows" ] ||
911 f_dialog_infobox_size -n \
917 # Always process the menu-item arguments to get the longest tag-length,
918 # longest item-length (both used to bump the width), and the number of
919 # rows (used to bump the height).
922 while [ $# -ge 2 ]; do
925 [ ${#__tag} -gt $__longest_tag ] && __longest_tag=${#__tag}
926 [ ${#__item} -gt $__longest_item ] && __longest_item=${#__item}
930 # Adjust rows early (for up-comning height calculation)
931 if [ "$__var_height" -o "$__var_rows" ]; then
938 # Add rows to height
951 # The sum total between the longest tag-length and the
952 # longest item-length should be used to bump menu width
955 [ $__n -gt $__width_menu_size ] && __width_menu_size=$__n
960 # Store adjusted rows if desired
963 # Constrain height, width, and rows to sensible minimum/maximum values
964 # Return success if no-constrain, else return status from constrain
969 # f_dialog_menu_with_help_size [-n] $var_height $var_width $var_rows \
973 # Not all versions of dialog(1) perform auto-sizing of the width and height of
974 # `--menu' boxes sensibly.
978 # storing the calculated height, width, and rows. The second set of arguments
981 # optimal height, width, and rows for the described widget (not exceeding the
985 # If the first argument is `-n', the calculated sizes ($var_height, $var_width,
991 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
997 [ "$__var_height" -o "$__var_width" -o "$__var_rows" ] ||
1004 f_dialog_infobox_size -n \
1010 # Always process the menu-item arguments to get the longest tag-length,
1011 # longest item-length, longest help-length (help-length only considered
1012 # if using Xdialog(1), as it places the help string in the widget) --
1013 # all used to bump the width -- and the number of rows (used to bump
1017 while [ $# -ge 3 ]; do
1020 [ ${#__tag} -gt $__longest_tag ] && __longest_tag=${#__tag}
1021 [ ${#__item} -gt $__longest_item ] && __longest_item=${#__item}
1022 [ ${#__help} -gt $__longest_help ] && __longest_help=${#__help}
1026 # Adjust rows early (for up-coming height calculation)
1027 if [ "$__var_height" -o "$__var_rows" ]; then
1034 # Add rows to height
1047 # The sum total between the longest tag-length and the
1048 # longest item-length should be used to bump menu width
1051 [ $__n -gt $__width_menu_with_help_size ] &&
1058 [ $__n -gt $__width_menu_with_help_size ] &&
1065 # Store adjusted rows if desired
1068 # Constrain height, width, and rows to sensible minimum/maximum values
1069 # Return success if no-constrain, else return status from constrain
1074 # f_dialog_radiolist_size [-n] $var_height $var_width $var_rows \
1078 # Not all versions of dialog(1) perform auto-sizing of the width and height of
1079 # `--radiolist' boxes sensibly.
1083 # storing the calculated height, width, and rows. The second set of arguments
1086 # The optimal height, width, and rows for the described widget (not exceeding
1090 # If the first argument is `-n', the calculated sizes ($var_height, $var_width,
1096 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
1102 [ "$__var_height" -o "$__var_width" -o "$__var_rows" ] ||
1109 f_dialog_infobox_size -n \
1115 # Always process the menu-item arguments to get the longest tag-length,
1116 # longest item-length (both used to bump the width), and the number of
1117 # rows (used to bump the height).
1120 while [ $# -ge 3 ]; do
1123 [ ${#__tag} -gt $__longest_tag ] && __longest_tag=${#__tag}
1124 [ ${#__item} -gt $__longest_item ] && __longest_item=${#__item}
1128 # Adjust rows early (for up-coming height calculation)
1129 if [ "$__var_height" -o "$__var_rows" ]; then
1137 # Add rows to height
1152 # Sum total between longest tag-length, longest item-length,
1153 # and radio-button width should be used to bump menu width
1156 [ $__n -gt $__width_rlist_size ] && __width_rlist_size=$__n
1161 # Store adjusted rows if desired
1164 # Constrain height, width, and rows to sensible minimum/maximum values
1165 # Return success if no-constrain, else return status from constrain
1170 # f_dialog_checklist_size [-n] $var_height $var_width $var_rows \
1174 # Not all versions of dialog(1) perform auto-sizing of the width and height of
1175 # `--checklist' boxes sensibly.
1179 # storing the calculated height, width, and rows. The second set of arguments
1182 # The optimal height, width, and rows for the described widget (not exceeding
1186 # If the first argument is `-n', the calculated sizes ($var_height, $var_width,
1194 # f_dialog_radiolist_with_help_size [-n] $var_height $var_width $var_rows \
1199 # Not all versions of dialog(1) perform auto-sizing of the width and height of
1200 # `--radiolist' boxes sensibly.
1204 # storing the calculated height, width, and rows. The second set of arguments
1207 # quadruplets). The optimal height, width, and rows for the described widget
1211 # If the first argument is `-n', the calculated sizes ($var_height, $var_width,
1217 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
1223 [ "$__var_height" -o "$__var_width" -o "$__var_rows" ] ||
1230 f_dialog_infobox_size -n \
1236 # Always process the menu-item arguments to get the longest tag-length,
1237 # longest item-length, longest help-length (help-length only considered
1238 # if using Xdialog(1), as it places the help string in the widget) --
1239 # all used to bump the width -- and the number of rows (used to bump
1244 while [ $# -ge 4 ]; do
1247 [ ${#__tag} -gt $__longest_tag ] && __longest_tag=${#__tag}
1248 [ ${#__item} -gt $__longest_item ] && __longest_item=${#__item}
1249 [ ${#__help} -gt $__longest_help ] && __longest_help=${#__help}
1255 # Adjust rows early (for up-coming height calculation)
1256 if [ "$__var_height" -o "$__var_rows" ]; then
1266 # Add rows to height
1283 # Sum total between longest tag-length, longest item-length,
1284 # and radio-button width should be used to bump menu width
1287 [ $__n -gt $__width_rlist_with_help_size ] &&
1294 [ $__n -gt $__width_rlist_with_help_size ] &&
1301 # Store adjusted rows if desired
1304 # Constrain height, width, and rows to sensible minimum/maximum values
1305 # Return success if no-constrain, else return status from constrain
1310 # f_dialog_checklist_with_help_size [-n] $var_height $var_width $var_rows \
1315 # Not all versions of dialog(1) perform auto-sizing of the width and height of
1316 # `--checklist' boxes sensibly.
1320 # storing the calculated height, width, and rows. The second set of arguments
1323 # quadruplets). The optimal height, width, and rows for the described widget
1327 # If the first argument is `-n', the calculated sizes ($var_height, $var_width,
1335 # f_dialog_calendar_size [-n] $var_height $var_width \
1338 # Not all versions of dialog(1) perform auto-sizing of the width and height of
1339 # `--calendar' boxes sensibly.
1348 # If the first argument is `-n', the calculated sizes ($var_height and
1351 # Newline character sequences (``\n'') in $prompt are expanded as-is done by
1357 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
1362 [ "$__var_height" -o "$__var_width" ] || return $FAILURE
1371 __max_width_cal_size=$(( $__max_width_cal_size - 2 ))
1372 # the calendar box will refuse to display if too wide
1379 $__max_height_cal_size - $DIALOG_CALENDAR_HEIGHT ))
1383 __max_height_cal_size=$(( $__max_height_cal_size - 1 ))
1393 __height=$(( $__height + $DIALOG_CALENDAR_HEIGHT - 1 ))
1405 # Enforce maximum height, unless `-n' was passed
1406 [ "$__constrain" -a $__height -gt $__max_height_cal_size ] &&
1418 f_dialog_infobox_size -n "" __width_cal_size \
1421 # Enforce minimum/maximum width, unless `-n' was passed
1423 if [ $__width_cal_size -lt $__min_width ]; then
1425 elif [ $__width_cal_size -gt $__max_width_cal_size ]
1437 # f_dialog_timebox_size [-n] $var_height $var_width \
1440 # Not all versions of dialog(1) perform auto-sizing of the width and height of
1441 # `--timebox' boxes sensibly.
1450 # If the first argument is `-n', the calculated sizes ($var_height and
1453 # Newline character sequences (``\n'') in $prompt are expanded as-is done by
1459 [ "$1" = "-n" ] && __constrain= && shift 1 # -n
1464 [ "$__var_height" -o "$__var_width" ] || return $FAILURE
1473 __max_width_tbox_size=$(( $__max_width_tbox_size - 2 ))
1474 # the timebox widget refuses to display if too wide
1481 $__max_height_tbox_size - $DIALOG_TIMEBOX_HEIGHT ))
1485 __max_height_tbox_size=$(( $__max_height_tbox_size - 1 ))
1489 if [ "$__var_height" -a "$USE_XDIALOG" ]; then
1498 # Enforce maximum height, unless `-n' was passed
1499 [ "$__constrain" -a $__height -gt $__max_height_tbox_size ] &&
1511 f_dialog_infobox_size -n "" __width_tbox_size \
1516 if [ $__width_tbox_size -lt $__min_width ]; then
1518 elif [ $__width_tbox_size -ge $__max_width_tbox_size ]
1538 $DIALOG --clear
1546 # displayed or `dialog --clear' (or f_dialog_clear) is called.
1554 --title "$DIALOG_TITLE" \
1555 --backtitle "$DIALOG_BACKTITLE" \
1556 ${USE_XDIALOG:+--ignore-eof} \
1557 ${USE_XDIALOG:+--no-buttons} \
1558 --infobox "$info_text" $height $width
1565 # lvalue to indirection or in a sub-shell that provides data on stdin.
1567 # To open an Xdialog(1) infobox that does not disappear until expeclitly dis-
1583 --title "$DIALOG_TITLE" \
1584 --backtitle "$DIALOG_BACKTITLE" \
1585 --no-close --no-buttons \
1586 --infobox "$info_text" $height $width \
1587 -1 # timeout of -1 means abort when EOF on stdin
1594 # Display a message in a widget with a progress bar that runs backward for
1605 --title "$DIALOG_TITLE" \
1606 --backtitle "$DIALOG_BACKTITLE" \
1607 --ok-label "$msg_skip" \
1608 --cancel-label "$msg_cancel" \
1609 ${noCancel:+--no-cancel} \
1610 --timeout "$duration" \
1611 --yesno "$pause_text" \
1614 [ $duration -gt 0 ] && duration=$(( $duration - 1 ))
1617 --title "$DIALOG_TITLE" \
1618 --backtitle "$DIALOG_BACKTITLE" \
1619 --hline "$hline" \
1620 --ok-label "$msg_skip" \
1621 --cancel-label "$msg_cancel" \
1622 ${noCancel:+--no-cancel} \
1623 --pause "$pause_text" \
1630 # Display a message in a widget with a progress bar that runs backward for
1655 --title "$DIALOG_TITLE" \
1656 --backtitle "$DIALOG_BACKTITLE" \
1657 --hline "$hline" \
1658 --ok-label "$msg_ok" \
1659 --msgbox "$msg_text" $height $width
1666 # Display the contents of $file (or an error if $file does not exist, etc.) in
1684 if [ $retval -eq $SUCCESS ]; then
1686 --title "$DIALOG_TITLE" \
1687 --backtitle "$DIALOG_BACKTITLE" \
1688 --exit-label "$msg_ok" \
1689 --no-cancel \
1690 --textbox "$file" $height $width
1693 --title "$DIALOG_TITLE" \
1694 --backtitle "$DIALOG_BACKTITLE" \
1695 --ok-label "$msg_ok" \
1696 --msgbox "$contents" $height $width
1704 # Display a dialog(1) Yes/No prompt to allow the user to make some decision.
1714 local hline="${2-$hline_arrows_tab_enter}"
1716 f_interactive || return 0 # If non-interactive, return YES all the time
1723 --title "$DIALOG_TITLE" \
1724 --backtitle "$DIALOG_BACKTITLE" \
1725 --hline "$hline" \
1726 --ok-label "$msg_yes" \
1727 --cancel-label "$msg_no" \
1728 --yesno "$msg_text" $height $width
1731 --title "$DIALOG_TITLE" \
1732 --backtitle "$DIALOG_BACKTITLE" \
1733 --hline "$hline" \
1734 --yes-label "$msg_yes" \
1735 --no-label "$msg_no" \
1736 --yesno "$msg_text" $height $width
1742 # Display a dialog(1) No/Yes prompt to allow the user to make some decision.
1754 local hline="${2-$hline_arrows_tab_enter}"
1756 f_interactive || return 1 # If non-interactive, return NO all the time
1763 --title "$DIALOG_TITLE" \
1764 --backtitle "$DIALOG_BACKTITLE" \
1765 --hline "$hline" \
1766 --default-no \
1767 --ok-label "$msg_yes" \
1768 --cancel-label "$msg_no" \
1769 --yesno "$msg_text" $height $width
1772 --title "$DIALOG_TITLE" \
1773 --backtitle "$DIALOG_BACKTITLE" \
1774 --hline "$hline" \
1775 --defaultno \
1776 --yes-label "$msg_yes" \
1777 --no-label "$msg_no" \
1778 --yesno "$msg_text" $height $width
1784 # f_dialog_inputstr_store [-s] $text
1787 # f_dialog_inputstr_fetch(). If the first argument is `-s', the text is
1793 [ "$1" = "-s" ] && sanitize=1 && shift 1 # -s
1813 debug= f_getvar DIALOG_INPUTBOX_$$ "${__var_to_set:-__cp}" # get data
1816 # Return the line on standard-out if desired
1846 local __opterm="--"
1852 --title "$DIALOG_TITLE" \
1853 --backtitle "$DIALOG_BACKTITLE" \
1854 --hline "$__hline" \
1855 --ok-label "$msg_ok" \
1856 --cancel-label "$msg_cancel" \
1857 --inputbox "$__prompt" \
1873 # f_dialog_menutag_store [-s] $text
1876 # f_dialog_menutag_fetch(). If the first argument is `-s', the text is
1882 [ "$1" = "-s" ] && sanitize=1 && shift 1 # -s
1902 debug= f_getvar DIALOG_MENU_$$ "${__var_to_set:-__cp}" # get the data
1905 # Return the data on standard-out if desired
1911 # f_dialog_menuitem_store [-s] $text
1914 # retrieved later by f_dialog_menuitem_fetch(). If the first argument is `-s',
1920 [ "$1" = "-s" ] && sanitize=1 && shift 1 # -s
1940 debug= f_getvar DIALOG_MENUITEM_$$ "${__var_to_set:-__cp}" # get data
1943 # Return the data on standard-out if desired
1949 # f_dialog_default_store [-s] $text
1951 # Store some text to be used later as the --default-item argument to dialog(1)
1952 # (or Xdialog(1)) for --menu, --checklist, and --radiolist widgets. Retrieve
1953 # the text later with f_dialog_menutag_fetch(). If the first argument is `-s',
1959 [ "$1" = "-s" ] && sanitize=1 && shift 1 # -s
1970 # Obtain text to be used with the --default-item argument of dialog(1) (or
1979 debug= f_getvar DEFAULTITEM_$$ "${__var_to_set:-__cp}" # get the data
1982 # Return the data on standard-out if desired
1990 # To use the `--menu' option of dialog(1) you must pass an ordered list of
1991 # tag/item pairs on the command-line. When the user selects a menu option the
2008 while [ $# -gt 0 ]; do
2024 # To use the `--menu' option of dialog(1) with the `--item-help' option, you
2025 # must pass an ordered list of tag/item/help triplets on the command-line. When
2042 while [ $# -gt 0 ]; do
2057 # To use the `--menu' option of dialog(1) you must pass an ordered list of
2058 # tag/item pairs on the command-line. When the user selects a menu option the
2062 # the index associated with said tag. The index is the one-based tag/item pair
2076 while [ $# -gt 0 ]; do
2092 # To use the `--menu' option of dialog(1) with the `--item-help' option, you
2093 # must pass an ordered list of tag/item/help triplets on the command-line. When
2097 # the index associated with said tag. The index is the one-based tag/item/help
2112 while [ $# -gt 0 ]; do
2127 # To use the `--menu' option of dialog(1) with the `--item-help' option, you
2128 # must pass an ordered list of tag/item/help triplets on the command-line. When
2145 while [ $# -gt 0 ]; do
2162 # Initialize (or re-initialize) the dialog module after setting/changing any
2165 # USE_XDIALOG Either NULL or Non-NULL. If given a value will indicate
2168 # SECURE Either NULL or Non-NULL. If given a value will indicate
2174 # NO_SHADOW Either NULL or Non-NULL. If use_shadow is OFF (case-
2186 # Clone terminal stdout so we can redirect to it from within sub-shells
2191 # Add `-S' and `-X' to the list of standard arguments supported by all
2199 # Process stored command-line arguments
2202 # bash(1) balks at the right parentheses encountered in the case-
2207 SECURE=`set -- $ARGV
2216 ` # END-BACKTICK
2217 USE_XDIALOG=`set -- $ARGV
2226 ` # END-BACKTICK
2231 # Process `-X' command-line option
2248 if [ -f ~/.dialogrc -a ! "$USE_XDIALOG" ]; then
2250 awk -v param=use_shadow -v expect=OFF \
2251 -v set="NO_SHADOW=1" '
2267 [ "$( id -u )" = "0" ] &&
2268 [ "$SUDO_USER" -a "$DISPLAY" ]
2277 local displaynum="${DISPLAY#*:}"
2278 eval xauth -if \~$SUDO_USER/.Xauthority extract - \
2280 \"\$HOSTNAME:\$displaynum\" | sudo sh -c 'xauth -ivf \
2281 ~root/.Xauthority merge - > /dev/null 2>&1'
2290 if ! f_eval_catch -dk maxsize $funcname "$DIALOG" \
2291 'LANG= LC_ALL= %s --print-maxsize' "$DIALOG"
2296 # Display the error message produced by Xdialog(1)
2301 --title "$DIALOG_TITLE" \
2302 --backtitle "$DIALOG_BACKTITLE" \
2303 --ok-label "$msg_ok" \
2304 --msgbox "$maxsize" $height $width
2309 set -- ${maxsize##*:}
2321 # --backtitle for the program name (which is better suited as
2322 # --title with Xdialog(1)).
2336 # Self-initialize unless requested otherwise