Commit 867c3cda authored by Dan Winship's avatar Dan Winship

tui: fix the error-on-startup cases

parent ed6b8f8c
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment