tui: fix using Escape from main menu

We weren't checking whether the form closed because the menu was
activated or because the user hit Escape
This commit is contained in:
Dan Winship 2014-03-21 08:47:02 -04:00
parent a3de4283ea
commit 96a5ad51c2

View file

@ -83,7 +83,7 @@ nmtui_main (int argc, char **argv)
NmtNewtGrid *grid;
NmtNewtListbox *listbox;
NmtNewtButtonBox *bbox;
NmtuiSubprogram subprogram;
NmtuiSubprogram subprogram = NULL;
int i;
form = g_object_new (NMT_TYPE_NEWT_FORM,
@ -121,8 +121,9 @@ nmtui_main (int argc, char **argv)
ok = nmt_newt_button_box_add_end (bbox, _("OK"));
nmt_newt_widget_set_exit_on_activate (ok, TRUE);
nmt_newt_form_run_sync (form);
subprogram = nmt_newt_listbox_get_active_key (listbox);
widget = nmt_newt_form_run_sync (form);
if (widget)
subprogram = nmt_newt_listbox_get_active_key (listbox);
g_object_unref (form);
if (subprogram)