summaryrefslogtreecommitdiffstats
path: root/src/hci/tui
diff options
context:
space:
mode:
authorMichael Brown2011-03-22 22:35:08 +0100
committerMichael Brown2011-03-22 22:35:08 +0100
commit162892616c110432d5055d2e88d1da3317c54c26 (patch)
treeabd80b4c2fc41b3bdeb0999e6bc483a5df4a8723 /src/hci/tui
parent[settings] Display canonical setting name in "config" user interface (diff)
downloadipxe-162892616c110432d5055d2e88d1da3317c54c26.tar.gz
ipxe-162892616c110432d5055d2e88d1da3317c54c26.tar.xz
ipxe-162892616c110432d5055d2e88d1da3317c54c26.zip
[settings] Display locally-originated settings in bold
Originally-implemented-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/tui')
-rw-r--r--src/hci/tui/settings_ui.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/hci/tui/settings_ui.c b/src/hci/tui/settings_ui.c
index 859a1daf..2dc8ce9d 100644
--- a/src/hci/tui/settings_ui.c
+++ b/src/hci/tui/settings_ui.c
@@ -80,6 +80,8 @@ struct setting_widget {
struct edit_box editbox;
/** Editing in progress flag */
int editing;
+ /** Setting originates from this block flag */
+ int originates_here;
/** Buffer for setting's value */
char value[256]; /* enough size for a DHCP string */
};
@@ -116,7 +118,12 @@ static void load_setting ( struct setting_widget *widget ) {
if ( fetchf_setting ( widget->settings, widget->setting,
widget->value, sizeof ( widget->value ) ) < 0 ) {
widget->value[0] = '\0';
- }
+ }
+
+ /* Check setting's origin */
+ widget->originates_here =
+ ( widget->settings ==
+ fetch_setting_origin ( widget->settings, widget->setting ) );
/* Initialise edit box */
init_editbox ( &widget->editbox, widget->value,
@@ -189,7 +196,10 @@ static void draw_setting ( struct setting_widget *widget ) {
+ len );
/* Print row */
+ if ( widget->originates_here )
+ attron ( A_BOLD );
mvprintw ( widget->row, widget->col, "%s", row.start );
+ attroff ( A_BOLD );
move ( widget->row, curs_col );
if ( widget->editing )
draw_editbox ( &widget->editbox );