diff options
author | Michael Brown | 2011-03-22 22:24:54 +0100 |
---|---|---|
committer | Michael Brown | 2011-03-22 22:26:05 +0100 |
commit | 247ac8055667e3f6080c5ad5fb9942a90d1812af (patch) | |
tree | 7ffca93ec674f80f42af0f24aad8388c9a6beaab /src/hci/tui | |
parent | [settings] Display only applicable settings in "config" user interface (diff) | |
download | ipxe-247ac8055667e3f6080c5ad5fb9942a90d1812af.tar.gz ipxe-247ac8055667e3f6080c5ad5fb9942a90d1812af.tar.xz ipxe-247ac8055667e3f6080c5ad5fb9942a90d1812af.zip |
[settings] Display canonical setting name in "config" user interface
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/tui')
-rw-r--r-- | src/hci/tui/settings_ui.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/hci/tui/settings_ui.c b/src/hci/tui/settings_ui.c index cf92e93b..859a1daf 100644 --- a/src/hci/tui/settings_ui.c +++ b/src/hci/tui/settings_ui.c @@ -97,7 +97,8 @@ static void vmsg ( unsigned int row, const char *fmt, va_list args ) __nonnull; static void msg ( unsigned int row, const char *fmt, ... ) __nonnull; static void valert ( const char *fmt, va_list args ) __nonnull; static void alert ( const char *fmt, ... ) __nonnull; -static void draw_info_row ( struct setting *setting ) __nonnull; +static void draw_info_row ( struct settings *settings, + struct setting *setting ) __nonnull; static int main_loop ( struct settings *settings ) __nonnull; /** @@ -313,12 +314,23 @@ static void draw_title_row ( void ) { /** * Draw information row * + * @v settings Settings block * @v setting Current configuration setting */ -static void draw_info_row ( struct setting *setting ) { +static void draw_info_row ( struct settings *settings, + struct setting *setting ) { + struct settings *origin; + char buf[32]; + + /* Determine a suitable setting name */ + origin = fetch_setting_origin ( settings, setting ); + if ( ! origin ) + origin = settings; + setting_name ( origin, setting, buf, sizeof ( buf ) ); + clearmsg ( INFO_ROW ); attron ( A_BOLD ); - msg ( INFO_ROW, "%s - %s", setting->name, setting->description ); + msg ( INFO_ROW, "%s - %s", buf, setting->description ); attroff ( A_BOLD ); } @@ -400,7 +412,7 @@ static int main_loop ( struct settings *settings ) { while ( 1 ) { /* Redraw information and instruction rows */ - draw_info_row ( widget.setting ); + draw_info_row ( widget.settings, widget.setting ); draw_instruction_row ( widget.editing ); /* Redraw current setting */ |