From 162892616c110432d5055d2e88d1da3317c54c26 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 22 Mar 2011 21:35:08 +0000 Subject: [settings] Display locally-originated settings in bold Originally-implemented-by: Glenn Brown Signed-off-by: Michael Brown --- src/hci/tui/settings_ui.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/hci/tui') 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 ); -- cgit v1.2.3-55-g7522