diff --git a/clients/cli/agent.c b/clients/cli/agent.c index bc837c722..e876d2622 100644 --- a/clients/cli/agent.c +++ b/clients/cli/agent.c @@ -148,7 +148,10 @@ do_agent_secret (NmCli *nmc, int argc, char **argv) nmc->should_wait++; nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent), NULL); - g_signal_connect (nmc->secret_agent, "request-secrets", G_CALLBACK (secrets_requested), nmc); + g_signal_connect (nmc->secret_agent, + NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS, + G_CALLBACK (secrets_requested), + nmc); g_print (_("nmcli successfully registered as a NetworkManager's secret agent.\n")); } else { g_string_printf (nmc->return_text, _("Error: secret agent initialization failed")); diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 3e85ca5bd..004ef2772 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -2534,7 +2534,10 @@ nmc_activate_connection (NmCli *nmc, /* Create secret agent */ nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-connect"); if (nmc->secret_agent) { - g_signal_connect (nmc->secret_agent, "request-secrets", G_CALLBACK (nmc_secrets_requested), nmc); + g_signal_connect (nmc->secret_agent, + NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS, + G_CALLBACK (nmc_secrets_requested), + nmc); if (connection) { nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent), nm_object_get_path (NM_OBJECT (connection))); diff --git a/clients/cli/devices.c b/clients/cli/devices.c index afa769f63..32c84bb69 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -1860,8 +1860,12 @@ do_device_connect (NmCli *nmc, int argc, char **argv) /* Create secret agent */ nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-connect"); - if (nmc->secret_agent) - g_signal_connect (nmc->secret_agent, "request-secrets", G_CALLBACK (nmc_secrets_requested), nmc); + if (nmc->secret_agent) { + g_signal_connect (nmc->secret_agent, + NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS, + G_CALLBACK (nmc_secrets_requested), + nmc); + } info = g_malloc0 (sizeof (AddAndActivateInfo)); info->nmc = nmc; diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c index 721f980e6..3fe1a0b88 100644 --- a/clients/common/nm-secret-agent-simple.c +++ b/clients/common/nm-secret-agent-simple.c @@ -807,7 +807,7 @@ nm_secret_agent_simple_class_init (NMSecretAgentSimpleClass *klass) * When the dialog is complete, the app must call * nm_secret_agent_simple_response() with the results. */ - signals[REQUEST_SECRETS] = g_signal_new ("request-secrets", + signals[REQUEST_SECRETS] = g_signal_new (NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS, G_TYPE_FROM_CLASS (klass), 0, 0, NULL, NULL, NULL, G_TYPE_NONE, diff --git a/clients/common/nm-secret-agent-simple.h b/clients/common/nm-secret-agent-simple.h index ba819ae36..f85ba65c8 100644 --- a/clients/common/nm-secret-agent-simple.h +++ b/clients/common/nm-secret-agent-simple.h @@ -29,6 +29,9 @@ #define NM_IS_SECRET_AGENT_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SECRET_AGENT_SIMPLE)) #define NM_SECRET_AGENT_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimpleClass)) +/* Signals */ +#define NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS "request-secrets" + typedef struct { NMSecretAgentOld parent; diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c index ae9dd43ed..ddabcd72a 100644 --- a/clients/tui/nmtui-connect.c +++ b/clients/tui/nmtui-connect.c @@ -239,7 +239,10 @@ activate_connection (NMConnection *connection, nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (agent), nm_object_get_path (NM_OBJECT (connection))); } - g_signal_connect (agent, "request-secrets", G_CALLBACK (secrets_requested), connection); + g_signal_connect (agent, + NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS, + G_CALLBACK (secrets_requested), + connection); } specific_object_path = specific_object ? nm_object_get_path (specific_object) : NULL;