summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-03-21 08:47:02 -0400
committerDan Winship <danw@gnome.org>2014-03-21 13:32:50 -0400
commit96a5ad51c22ebc8b36231d79b7ce0547decfb663 (patch)
tree23e7df3842c6fbe310284a5dab5187681a3a113e
parenta3de4283eafbd025e7f1a7588eb9afaa465f6c03 (diff)
downloadNetworkManager-96a5ad51c22ebc8b36231d79b7ce0547decfb663.tar.gz
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
-rw-r--r--tui/nmtui.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tui/nmtui.c b/tui/nmtui.c
index 7861dcb968..c1c3ef5def 100644
--- a/tui/nmtui.c
+++ b/tui/nmtui.c
@@ -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)