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