3387
3387
NMApplet *applet = user_data;
3389
if (applet->agent_start_id) {
3390
g_source_remove (applet->agent_start_id);
3391
applet->agent_start_id = 0;
3389
3397
if (nm_shell_watcher_version_at_least (watcher, 3, 4)) {
3390
if (applet->agent_start_id)
3391
g_source_remove (applet->agent_start_id);
3393
if (applet->agent && nm_secret_agent_get_registered (NM_SECRET_AGENT (applet->agent))) {
3398
/* GNOME Shell handles all secrets requests */
3399
if (nm_secret_agent_get_registered (NM_SECRET_AGENT (applet->agent))) {
3394
3400
g_message ("Stopping applet secret agent because GNOME Shell appeared");
3395
3401
nm_secret_agent_unregister (NM_SECRET_AGENT (applet->agent));
3403
} else if (nm_shell_watcher_version_at_least (watcher, 3, 2)) {
3404
/* GNOME Shell handles everything except VPN secrets requests */
3405
if (nm_secret_agent_get_registered (NM_SECRET_AGENT (applet->agent)))
3406
g_message ("Applet secret agent handling only VPN secrets because GNOME Shell appeared");
3407
applet_agent_handle_vpn_only (applet->agent, TRUE);
3398
3409
/* If the shell quit and our agent wasn't already registered, do it
3399
* now on a delay (just in case the shell is restarting.
3410
* now on a delay (just in case the shell is restarting).
3401
if (applet->agent_start_id)
3402
g_source_remove (applet->agent_start_id);
3404
if (nm_secret_agent_get_registered (NM_SECRET_AGENT (applet->agent)) == FALSE)
3412
if (!nm_secret_agent_get_registered (NM_SECRET_AGENT (applet->agent)))
3405
3413
applet->agent_start_id = g_timeout_add_seconds (4, delayed_start_agent, applet);
3414
applet_agent_handle_vpn_only (applet->agent, FALSE);