mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 00:10:07 +01:00
tui: avoid failed assertion when adding bond slaves
When trying to add new slaves to a bond connection, for the first slave nmt_add_connection_show() is called with !priv->single_type to display a slave-type selection form. For the second slave the type is predefined and thus nmt_add_connection_show() doesn't show the dialog; instead it calls create_connection() directly, which invokes nmt_newt_form_quit() on the not-shown dialog causing: nmtui-CRITICAL **: nmt_newt_form_quit: assertion 'priv->form != NULL' failed Don't call nmt_newt_form_quit() if the form was not shown. https://bugzilla.gnome.org/show_bug.cgi?id=768981
This commit is contained in:
parent
b01219ad1b
commit
2eafd0ea52
1 changed files with 7 additions and 2 deletions
|
|
@ -184,7 +184,12 @@ create_connection (NmtNewtWidget *widget, gpointer list)
|
|||
connection = nm_editor_utils_create_connection (type, priv->master, nm_client);
|
||||
nmt_edit_connection (connection);
|
||||
g_object_unref (connection);
|
||||
}
|
||||
|
||||
static void
|
||||
create_connection_and_quit (NmtNewtWidget *widget, gpointer list)
|
||||
{
|
||||
create_connection (widget, list);
|
||||
nmt_newt_form_quit (list);
|
||||
}
|
||||
|
||||
|
|
@ -203,7 +208,7 @@ nmt_add_connection_init (NmtAddConnection *form)
|
|||
|
||||
listbox = nmt_newt_listbox_new (5, NMT_NEWT_LISTBOX_SCROLL);
|
||||
priv->listbox = NMT_NEWT_LISTBOX (listbox);
|
||||
g_signal_connect (priv->listbox, "activated", G_CALLBACK (create_connection), form);
|
||||
g_signal_connect (priv->listbox, "activated", G_CALLBACK (create_connection_and_quit), form);
|
||||
nmt_newt_grid_add (grid, listbox, 0, 1);
|
||||
nmt_newt_widget_set_padding (listbox, 0, 1, 0, 0);
|
||||
nmt_newt_grid_set_flags (grid, listbox, NMT_NEWT_GRID_EXPAND_X);
|
||||
|
|
@ -223,7 +228,7 @@ nmt_add_connection_init (NmtAddConnection *form)
|
|||
NMT_NEWT_GRID_FILL_Y);
|
||||
|
||||
button = g_object_ref_sink (nmt_newt_button_new (_("Create")));
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (create_connection), form);
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (create_connection_and_quit), form);
|
||||
nmt_newt_grid_add (NMT_NEWT_GRID (buttons), button, 1, 0);
|
||||
|
||||
nmt_newt_form_set_content (NMT_NEWT_FORM (form), NMT_NEWT_WIDGET (grid));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue