]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[settings] Add setting deletion (Ctrl-D) interface
authorGlenn Brown <glenn@myri.com>
Wed, 23 Jun 2010 20:18:35 +0000 (13:18 -0700)
committerMichael Brown <mcb30@ipxe.org>
Thu, 24 Jun 2010 22:34:43 +0000 (23:34 +0100)
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>
src/hci/tui/settings_ui.c

index dce0b5d5a5113c09098a24e9dfddc04c93168f97..b8fe207fb992614006340bcca28b145367a46227 100644 (file)
@@ -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" );
        }
 }
@@ -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: