summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/console
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-06-02 20:02:50 +0000
committerdteske <dteske@FreeBSD.org>2013-06-02 20:02:50 +0000
commite9cea3453922d1975e0825166772ffe465661dab (patch)
tree2c9bf92c5092f58cc207f2fd3418feab48459fea /usr.sbin/bsdconfig/console
parentdb074b4e6ec9f60ba7d39270d7bd41bd4d5f6ba8 (diff)
downloadFreeBSD-src-e9cea3453922d1975e0825166772ffe465661dab.zip
FreeBSD-src-e9cea3453922d1975e0825166772ffe465661dab.tar.gz
Standardize the way functions build their arguments leading up to a dialog
invocation. Specifically, "top-load" your arguments and in the order in- which they will be displayed. For example, many [if not all] widgets display information in the following order, top-to-bottom (visually): + backtitle (displayed behind the widget at top-left) + title (at the top of the `window') + prompt text (just below the title and above whatever widget you choose) + Depending on widget, _one_ of the following: - menu list - radio list - check list - text input box with initial text - [Xdialog(1)] 2x or 3x text input boxes - [dialog(1)] a multi-part form - progress bar - etc. (many more widget choices) + buttons (right below the selected widget) + [dialog(1)] the hline (displayed at bottom of `window') NOTE: Xdialog(1) accepts and silently ignores --hline When building local arguments for your dialog invocation, if the value can't be cleanly loaded into a local, add "# Calculated below" to the end of the local declaration while retaining the block order of argument declarations. Move other local declarations that are not associated with this top-loading the dialog arguments to right-above where they are first-used. Also, standardize on the names of the arguments. For example, always use $prompt (instead of sometimes $msg and sometimes $prompt); use $menu_list or $shell_list or $radio_list for those respective widgets; ad nauseum. While we're doing this, flush-out full arguments for many invocations that were passing NULL strings (making it unapparent if you were staring at this one invocation what argument that NULL string was supposed to represent). Last, while we're in startup/rcconf let's remove the unnecessary use of a GLOBAL (RCCONF_MENU_LIST) for the menu_list.
Diffstat (limited to 'usr.sbin/bsdconfig/console')
-rwxr-xr-xusr.sbin/bsdconfig/console/console8
-rwxr-xr-xusr.sbin/bsdconfig/console/font7
-rwxr-xr-xusr.sbin/bsdconfig/console/keymap4
-rwxr-xr-xusr.sbin/bsdconfig/console/repeat7
-rwxr-xr-xusr.sbin/bsdconfig/console/saver7
-rwxr-xr-xusr.sbin/bsdconfig/console/screenmap7
-rwxr-xr-xusr.sbin/bsdconfig/console/ttys2
7 files changed, 18 insertions, 24 deletions
diff --git a/usr.sbin/bsdconfig/console/console b/usr.sbin/bsdconfig/console/console
index 6fe5bab..5a05080 100755
--- a/usr.sbin/bsdconfig/console/console
+++ b/usr.sbin/bsdconfig/console/console
@@ -48,12 +48,8 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
dialog_menu_main()
{
- local menu_list
- local hline="$hline_configure_system_console_settings"
local prompt="$msg_console_menu_text"
- local defaultitem= # Calculated below
-
- menu_list="
+ local menu_list="
'X $msg_exit' '$msg_exit_this_menu'
'2 $msg_font' '$msg_choose_alternate_screen_font'
'3 $msg_keymap' '$msg_choose_alternate_keyboard_map'
@@ -62,6 +58,8 @@ dialog_menu_main()
'6 $msg_screenmap' '$msg_choose_alternate_screenmap'
'7 $msg_ttys' '$msg_choose_console_terminal_type'
" # END-QUOTE
+ local defaultitem= # Calculated below
+ local hline="$hline_configure_system_console_settings"
local height width rows
eval f_dialog_menu_size height width rows \
diff --git a/usr.sbin/bsdconfig/console/font b/usr.sbin/bsdconfig/console/font
index 340bc6d..abe82ed 100755
--- a/usr.sbin/bsdconfig/console/font
+++ b/usr.sbin/bsdconfig/console/font
@@ -49,11 +49,8 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
dialog_menu_main()
{
- local menu_list defaultitem=
- local hline="$hline_choose_a_font"
local prompt="$msg_font_menu_text"
-
- menu_list="
+ local menu_list="
'1 $msg_none' '$msg_use_hardware_default_font'
'2 $msg_ibm_437' '$msg_ibm_437_desc'
'3 $msg_ibm_850' '$msg_ibm_850_desc'
@@ -69,6 +66,8 @@ dialog_menu_main()
'd $msg_iso_8859_15' '$msg_iso_8859_15_desc'
'e $msg_swiss' '$msg_swiss_desc'
" # END-QUOTE
+ local defaultitem= # Calculated below
+ local hline="$hline_choose_a_font"
local height width rows
eval f_dialog_menu_size height width rows \
diff --git a/usr.sbin/bsdconfig/console/keymap b/usr.sbin/bsdconfig/console/keymap
index fdbf511..66c1203 100755
--- a/usr.sbin/bsdconfig/console/keymap
+++ b/usr.sbin/bsdconfig/console/keymap
@@ -77,9 +77,9 @@ KEYMAP_NAMES="
#
dialog_menu_main()
{
- local menu_list defaultitem=
- local hline="$hline_choose_a_keyboard_map"
local prompt="$msg_keymap_menu_text"
+ local menu_list defaultitem= # Calculated below
+ local hline="$hline_choose_a_keyboard_map"
#
# Export variables for awk(1) ENVIRON visibility
diff --git a/usr.sbin/bsdconfig/console/repeat b/usr.sbin/bsdconfig/console/repeat
index a98e39f..ab4ba78 100755
--- a/usr.sbin/bsdconfig/console/repeat
+++ b/usr.sbin/bsdconfig/console/repeat
@@ -49,16 +49,15 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
dialog_menu_main()
{
- local menu_list defaultitem=
- local hline="$hline_choose_a_keyboard_repeat_rate"
local prompt="$msg_repeat_menu_text"
-
- menu_list="
+ local menu_list="
'$msg_default' '$msg_default_desc'
'$msg_slow' '$msg_slow_desc'
'$msg_normal' '$msg_normal_desc'
'$msg_fast' '$msg_fast_desc'
" # END-QUOTE
+ local defaultitem= # Calculated below
+ local hline="$hline_choose_a_keyboard_repeat_rate"
local height width rows
eval f_dialog_menu_size height width rows \
diff --git a/usr.sbin/bsdconfig/console/saver b/usr.sbin/bsdconfig/console/saver
index d0150a7..8794e5f 100755
--- a/usr.sbin/bsdconfig/console/saver
+++ b/usr.sbin/bsdconfig/console/saver
@@ -49,11 +49,8 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
dialog_menu_main()
{
- local menu_list defaultitem=
- local hline="$hline_choose_a_screen_saver"
local prompt="$msg_saver_menu_text"
-
- menu_list="
+ local menu_list="
'1 $msg_blank' '$msg_blank_desc'
'2 $msg_beastie' '$msg_beastie_desc'
'3 $msg_daemon' '$msg_daemon_desc'
@@ -69,6 +66,8 @@ dialog_menu_main()
'd $msg_none' '$msg_none_saver_desc'
'$msg_timeout' '$msg_timeout_desc'
" # END-QUOTE
+ local defaultitem= # Calculated below
+ local hline="$hline_choose_a_screen_saver"
local height width rows
eval f_dialog_menu_size height width rows \
diff --git a/usr.sbin/bsdconfig/console/screenmap b/usr.sbin/bsdconfig/console/screenmap
index 6fc3ddd..27f4cb9 100755
--- a/usr.sbin/bsdconfig/console/screenmap
+++ b/usr.sbin/bsdconfig/console/screenmap
@@ -49,11 +49,8 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
dialog_menu_main()
{
- local menu_list defaultitem=
- local hline="$hline_choose_a_screen_map"
local prompt="$msg_screenmap_menu_text"
-
- menu_list="
+ local menu_list="
'1 $msg_none' '$msg_none_screenmap_desc'
'2 $msg_iso_8859_1_to_ibm437' '$msg_iso_8859_1_to_ibm437_desc'
'3 $msg_iso_8859_7_to_ibm437' '$msg_iso_8859_7_to_ibm437_desc'
@@ -61,6 +58,8 @@ dialog_menu_main()
'5 $msg_koi8_r_to_ibm866' '$msg_koi8_r_to_ibm866_desc'
'6 $msg_koi8_u_to_ibm866u' '$msg_koi8_u_to_ibm866u_desc'
" # END-QUOTE
+ local defaultitem= # Calculated below
+ local hline="$hline_choose_a_screen_map"
local height width rows
eval f_dialog_menu_size height width rows \
diff --git a/usr.sbin/bsdconfig/console/ttys b/usr.sbin/bsdconfig/console/ttys
index 96126ad..f488efd 100755
--- a/usr.sbin/bsdconfig/console/ttys
+++ b/usr.sbin/bsdconfig/console/ttys
@@ -72,8 +72,8 @@ TTY_MENU_LIST="
#
dialog_menu_main()
{
- local hline="$hline_choose_a_terminal_type"
local prompt="$msg_ttys_menu_text"
+ local hline="$hline_choose_a_terminal_type"
local height width rows
eval f_dialog_menu_size height width rows \
OpenPOWER on IntegriCloud