Browse Source

[settings] Display locally-originated settings in bold

Originally-implemented-by: Glenn Brown <glenn@myri.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
162892616c
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      src/hci/tui/settings_ui.c

+ 11
- 1
src/hci/tui/settings_ui.c View File

80
 	struct edit_box editbox;
80
 	struct edit_box editbox;
81
 	/** Editing in progress flag */
81
 	/** Editing in progress flag */
82
 	int editing;
82
 	int editing;
83
+	/** Setting originates from this block flag */
84
+	int originates_here;
83
 	/** Buffer for setting's value */
85
 	/** Buffer for setting's value */
84
 	char value[256]; /* enough size for a DHCP string */
86
 	char value[256]; /* enough size for a DHCP string */
85
 };
87
 };
116
 	if ( fetchf_setting ( widget->settings, widget->setting,
118
 	if ( fetchf_setting ( widget->settings, widget->setting,
117
 			      widget->value, sizeof ( widget->value ) ) < 0 ) {
119
 			      widget->value, sizeof ( widget->value ) ) < 0 ) {
118
 		widget->value[0] = '\0';
120
 		widget->value[0] = '\0';
119
-	}	
121
+	}
122
+
123
+	/* Check setting's origin */
124
+	widget->originates_here =
125
+		( widget->settings ==
126
+		  fetch_setting_origin ( widget->settings, widget->setting ) );
120
 
127
 
121
 	/* Initialise edit box */
128
 	/* Initialise edit box */
122
 	init_editbox ( &widget->editbox, widget->value,
129
 	init_editbox ( &widget->editbox, widget->value,
189
 		     + len );
196
 		     + len );
190
 
197
 
191
 	/* Print row */
198
 	/* Print row */
199
+	if ( widget->originates_here )
200
+		attron ( A_BOLD );
192
 	mvprintw ( widget->row, widget->col, "%s", row.start );
201
 	mvprintw ( widget->row, widget->col, "%s", row.start );
202
+	attroff ( A_BOLD );
193
 	move ( widget->row, curs_col );
203
 	move ( widget->row, curs_col );
194
 	if ( widget->editing )
204
 	if ( widget->editing )
195
 		draw_editbox ( &widget->editbox );
205
 		draw_editbox ( &widget->editbox );

Loading…
Cancel
Save