Переглянути джерело

[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 13 роки тому
джерело
коміт
162892616c
1 змінених файлів з 11 додано та 1 видалено
  1. 11
    1
      src/hci/tui/settings_ui.c

+ 11
- 1
src/hci/tui/settings_ui.c Переглянути файл

@@ -80,6 +80,8 @@ struct setting_widget {
80 80
 	struct edit_box editbox;
81 81
 	/** Editing in progress flag */
82 82
 	int editing;
83
+	/** Setting originates from this block flag */
84
+	int originates_here;
83 85
 	/** Buffer for setting's value */
84 86
 	char value[256]; /* enough size for a DHCP string */
85 87
 };
@@ -116,7 +118,12 @@ static void load_setting ( struct setting_widget *widget ) {
116 118
 	if ( fetchf_setting ( widget->settings, widget->setting,
117 119
 			      widget->value, sizeof ( widget->value ) ) < 0 ) {
118 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 128
 	/* Initialise edit box */
122 129
 	init_editbox ( &widget->editbox, widget->value,
@@ -189,7 +196,10 @@ static void draw_setting ( struct setting_widget *widget ) {
189 196
 		     + len );
190 197
 
191 198
 	/* Print row */
199
+	if ( widget->originates_here )
200
+		attron ( A_BOLD );
192 201
 	mvprintw ( widget->row, widget->col, "%s", row.start );
202
+	attroff ( A_BOLD );
193 203
 	move ( widget->row, curs_col );
194 204
 	if ( widget->editing )
195 205
 		draw_editbox ( &widget->editbox );

Завантаження…
Відмінити
Зберегти