mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 20:00:09 +01:00
nmtui: show error on connection deactivation failure
When a failure occurs on deactivation of a connection, no error was shown on the TUI client. It was not obvious if anything was actually happening after pressing the <Deactivate> button. This patch shows the error in a dialog just like we do when a failure occurs on activation of a connection. https://mail.gnome.org/archives/networkmanager-list/2020-May/msg00004.html
This commit is contained in:
parent
779e5c0efb
commit
0b9f0b3080
1 changed files with 12 additions and 1 deletions
|
|
@ -221,6 +221,17 @@ add_and_activate_callback (GObject *client,
|
|||
nmt_sync_op_complete_pointer (op, ac, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
deactivate_connection (NMActiveConnection *ac)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!nm_client_deactivate_connection (nm_client, ac, NULL, &error)) {
|
||||
nmt_newt_message_dialog (_("Could not deactivate connection: %s"), error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
activate_connection (NMConnection *connection,
|
||||
NMDevice *device,
|
||||
|
|
@ -349,7 +360,7 @@ listbox_activated (NmtNewtListbox *listbox,
|
|||
return;
|
||||
|
||||
if (ac)
|
||||
nm_client_deactivate_connection (nm_client, ac, NULL, NULL);
|
||||
deactivate_connection (ac);
|
||||
else
|
||||
activate_connection (connection, device, specific_object);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue