2005-12-06 Dan Williams <dcbw@redhat.com>

* gnome/applet/applet-dbus.c
		- (set_vpn_last_attempt_status): remove, now in applet-dbus-vpn.c

	* gnome/applet/applet-dbus-vpn.c
		- (nmwa_dbus_vpn_set_last_attempt_status): new, from applet-dbus.c
		- (nmwa_dbus_vpn_update_vpn_connection_stage): set last_attempt_success
			to TRUE here if stage was ACTIVATED


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1139 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2005-12-07 04:22:10 +00:00
parent 9677e94d78
commit 98498e55b6
4 changed files with 41 additions and 18 deletions

View file

@ -1,3 +1,13 @@
2005-12-06 Dan Williams <dcbw@redhat.com>
* gnome/applet/applet-dbus.c
- (set_vpn_last_attempt_status): remove, now in applet-dbus-vpn.c
* gnome/applet/applet-dbus-vpn.c
- (nmwa_dbus_vpn_set_last_attempt_status): new, from applet-dbus.c
- (nmwa_dbus_vpn_update_vpn_connection_stage): set last_attempt_success
to TRUE here if stage was ACTIVATED
2005-12-06 Dan Williams <dcbw@redhat.com>
* Change nm_device_is_* functions to better names:

View file

@ -37,6 +37,26 @@
static void nmwa_free_vpn_connections (NMWirelessApplet *applet);
void
nmwa_dbus_vpn_set_last_attempt_status (NMWirelessApplet *applet, const char *vpn_name, gboolean last_attempt_success)
{
char *gconf_key;
char *escaped_name;
VPNConnection *vpn;
if ((vpn = nmwa_vpn_connection_find_by_name (applet->vpn_connections, vpn_name)))
{
escaped_name = gconf_escape_key (vpn_name, strlen (vpn_name));
gconf_key = g_strdup_printf ("%s/%s/last_attempt_success", GCONF_PATH_VPN_CONNECTIONS, escaped_name);
gconf_client_set_bool (applet->gconf_client, gconf_key, last_attempt_success, NULL);
g_free (gconf_key);
g_free (escaped_name);
}
}
/*
* nmwa_dbus_vpn_update_vpn_connection_stage
*
@ -49,7 +69,14 @@ void nmwa_dbus_vpn_update_vpn_connection_stage (NMWirelessApplet *applet, const
g_return_if_fail (applet != NULL);
if ((vpn = nmwa_vpn_connection_find_by_name (applet->vpn_connections, vpn_name)))
{
nmwa_vpn_connection_set_stage (vpn, vpn_stage);
if (vpn_stage == NM_VPN_ACT_STAGE_ACTIVATED)
{
/* set the 'last_attempt_success' key in gconf so we DON'T prompt for password next time */
nmwa_dbus_vpn_set_last_attempt_status (applet, vpn_name, TRUE);
}
}
}
typedef struct VpnPropsCBData

View file

@ -27,6 +27,8 @@
#include <dbus/dbus.h>
#include "vpn-connection.h"
void nmwa_dbus_vpn_set_last_attempt_status (NMWirelessApplet *applet, const char *vpn_name, gboolean last_attempt_success);
void nmwa_dbus_vpn_update_one_vpn_connection (NMWirelessApplet *applet, const char *vpn_name);
void nmwa_dbus_vpn_update_vpn_connections (NMWirelessApplet *applet);
void nmwa_dbus_vpn_remove_one_vpn_connection (NMWirelessApplet *applet, const char *vpn_name);

View file

@ -98,22 +98,6 @@ static int deal_with_dbus_error (const char *function, const char *method, DBusE
}
static void
set_vpn_last_attempt_status (NMWirelessApplet *applet, const char *vpn_name, gboolean last_attempt_success)
{
char *gconf_key;
char *escaped_name;
escaped_name = gconf_escape_key (vpn_name, strlen (vpn_name));
gconf_key = g_strdup_printf ("%s/%s/last_attempt_success", GCONF_PATH_VPN_CONNECTIONS, escaped_name);
gconf_client_set_bool (applet->gconf_client, gconf_key, last_attempt_success, NULL);
g_free (gconf_key);
g_free (escaped_name);
}
/*
* nmwa_dbus_filter
*
@ -286,7 +270,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &vpn_name, DBUS_TYPE_STRING, &error_msg, DBUS_TYPE_INVALID)) {
nmwa_schedule_vpn_failure_dialog (applet, member, vpn_name, error_msg);
/* clear the 'last_attempt_success' key in gconf so we prompt for password next time */
set_vpn_last_attempt_status (applet, vpn_name, FALSE);
nmwa_dbus_vpn_set_last_attempt_status (applet, vpn_name, FALSE);
}
}
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, NM_DBUS_VPN_SIGNAL_LOGIN_BANNER))
@ -302,7 +286,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
g_free (stripped);
/* set the 'last_attempt_success' key in gconf so we DON'T prompt for password next time */
set_vpn_last_attempt_status (applet, vpn_name, TRUE);
nmwa_dbus_vpn_set_last_attempt_status (applet, vpn_name, TRUE);
}
}
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivationFailed"))