Skip to content

Commit

Permalink
[settings] Add setting deletion (Ctrl-D) interface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Glenn Brown authored and mcb30 committed Jun 24, 2010
1 parent f9bcb92 commit 978c840
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/hci/tui/settings_ui.c
Expand Up @@ -326,6 +326,7 @@ static void draw_instruction_row ( int editing ) {
"Ctrl-C - discard changes" );
} else {
msg ( INSTRUCTION_ROW,
"Ctrl-D - delete setting" INSTRUCTION_PAD
"Ctrl-X - exit configuration utility" );
}
}
Expand Down Expand Up @@ -430,6 +431,12 @@ static int main_loop ( struct settings *settings ) {
if ( next > 0 )
reveal ( &widget, --next ) ;
break;
case CTRL_D:
delete_setting ( widget.settings,
widget.setting );
select_setting ( &widget, next );
draw_setting ( &widget );
break;
case CTRL_X:
return 0;
default:
Expand Down

0 comments on commit 978c840

Please sign in to comment.