mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 00:50:12 +01:00
tui: fix the error-on-startup cases
This commit is contained in:
parent
ed6b8f8c1d
commit
867c3cdae0
3 changed files with 10 additions and 6 deletions
|
|
@ -779,14 +779,16 @@ nmt_connect_connection_list_activate_async (NmtConnectConnectionList *list,
|
|||
goto activate;
|
||||
}
|
||||
|
||||
if (!conn && !nmtdev->device && !strcmp (identifier, nm_device_get_ip_iface (nmtdev->device))) {
|
||||
if (!conn && nmtdev->device && !strcmp (identifier, nm_device_get_ip_iface (nmtdev->device))) {
|
||||
nmtconn = nmtdev->conns->data;
|
||||
goto activate;
|
||||
}
|
||||
}
|
||||
|
||||
g_printerr ("%s: no such connection '%s'\n", g_get_prgname (), identifier);
|
||||
exit (1);
|
||||
g_simple_async_report_error_in_idle (G_OBJECT (list), callback, user_data,
|
||||
NM_CLIENT_ERROR, NM_CLIENT_ERROR_UNKNOWN,
|
||||
_("No such connection '%s'"), identifier);
|
||||
return;
|
||||
|
||||
activate:
|
||||
activate_nmt_connection_async (list, nmtconn, callback, user_data);
|
||||
|
|
@ -807,5 +809,5 @@ nmt_connect_connection_list_activate_finish (NmtConnectConnectionList *list,
|
|||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
return g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error);
|
||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ nmt_connect_connection (const char *identifier)
|
|||
if (!nmt_sync_op_wait_boolean (&op, &error)) {
|
||||
nmt_newt_error_dialog (_("Could not activate connection: %s"), error->message);
|
||||
g_error_free (error);
|
||||
nmtui_quit ();
|
||||
}
|
||||
g_object_unref (list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -517,8 +517,9 @@ nmtui_edit (int argc, char **argv)
|
|||
}
|
||||
|
||||
if (!conn) {
|
||||
g_printerr ("%s: no such connection '%s'\n", argv[0], argv[1]);
|
||||
exit (1);
|
||||
nmt_newt_error_dialog ("%s: no such connection '%s'\n", argv[0], argv[1]);
|
||||
nmtui_quit ();
|
||||
return;
|
||||
}
|
||||
|
||||
nmt_edit_connection (conn);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue