From: Michael Brown Date: Tue, 22 Mar 2011 21:35:08 +0000 (+0000) Subject: [settings] Display locally-originated settings in bold X-Git-Tag: v1.20.1~2208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=162892616c110432d5055d2e88d1da3317c54c26;p=thirdparty%2Fipxe.git [settings] Display locally-originated settings in bold Originally-implemented-by: Glenn Brown Signed-off-by: Michael Brown --- diff --git a/src/hci/tui/settings_ui.c b/src/hci/tui/settings_ui.c index 859a1daf5..2dc8ce9dc 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 );