Просмотр исходного кода

[settings] Add setting deletion (Ctrl-D) interface

Make Ctrl-D delete a setting, because the Text User Interface (tui)
previously provided no way to delete a setting.  Also, update the
on-screen instructions to describe the new feature.  Deleting settings
is especially important for settings stored in precious nonvolatile
storage.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Glenn Brown 14 лет назад
Родитель
Сommit
978c840365
1 измененных файлов: 7 добавлений и 0 удалений
  1. 7
    0
      src/hci/tui/settings_ui.c

+ 7
- 0
src/hci/tui/settings_ui.c Просмотреть файл

@@ -326,6 +326,7 @@ static void draw_instruction_row ( int editing ) {
326 326
 		      "Ctrl-C - discard changes" );
327 327
 	} else {
328 328
 		msg ( INSTRUCTION_ROW,
329
+		      "Ctrl-D - delete setting" INSTRUCTION_PAD
329 330
 		      "Ctrl-X - exit configuration utility" );
330 331
 	}
331 332
 }
@@ -430,6 +431,12 @@ static int main_loop ( struct settings *settings ) {
430 431
 				if ( next > 0 )
431 432
 					reveal ( &widget, --next ) ;
432 433
 				break;
434
+			case CTRL_D:
435
+				delete_setting ( widget.settings,
436
+						 widget.setting );
437
+				select_setting ( &widget, next );
438
+				draw_setting ( &widget );
439
+				break;
433 440
 			case CTRL_X:
434 441
 				return 0;
435 442
 			default:

Загрузка…
Отмена
Сохранить