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

Various changes in the applet to move VPN connection "state" -> "stage",
	which it actually is.  I'd like to change the signal as well when we
	break compat in the near future.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1128 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2005-12-06 23:02:42 +00:00
parent 58d310199c
commit 7e3c364575
6 changed files with 26 additions and 26 deletions

View file

@ -38,18 +38,18 @@ static void nmwa_free_vpn_connections (NMWirelessApplet *applet);
/*
* nmwa_dbus_vpn_update_vpn_connection_state
* nmwa_dbus_vpn_update_vpn_connection_stage
*
* Sets the state for a dbus vpn connection and schedules a copy to the applet gui.
* Sets the activation stage for a dbus vpn connection.
*/
void nmwa_dbus_vpn_update_vpn_connection_state (NMWirelessApplet *applet, const char *vpn_name, NMVPNActStage vpn_state)
void nmwa_dbus_vpn_update_vpn_connection_stage (NMWirelessApplet *applet, const char *vpn_name, NMVPNActStage vpn_stage)
{
VPNConnection *vpn;
g_return_if_fail (applet != NULL);
if ((vpn = nmwa_vpn_connection_find_by_name (applet->vpn_connections, vpn_name)))
nmwa_vpn_connection_set_state (vpn, vpn_state);
nmwa_vpn_connection_set_stage (vpn, vpn_stage);
}
typedef struct VpnPropsCBData
@ -82,8 +82,8 @@ static void nmwa_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data
const char * name;
const char * user_name;
const char * service;
NMVPNActStage state;
dbus_uint32_t state_int;
NMVPNActStage stage;
dbus_uint32_t stage_int;
g_return_if_fail (pcall != NULL);
g_return_if_fail (cb_data != NULL);
@ -102,23 +102,23 @@ static void nmwa_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data
}
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &user_name,
DBUS_TYPE_STRING, &service, DBUS_TYPE_UINT32, &state_int, DBUS_TYPE_INVALID))
DBUS_TYPE_STRING, &service, DBUS_TYPE_UINT32, &stage_int, DBUS_TYPE_INVALID))
{
VPNConnection * vpn;
state = (NMVPNActStage) state_int;
stage = (NMVPNActStage) stage_int;
/* If its already there, update the service, otherwise add it to the list */
if ((vpn = nmwa_vpn_connection_find_by_name (applet->vpn_connections, name)))
{
nmwa_vpn_connection_set_service (vpn, service);
nmwa_vpn_connection_set_state (vpn, state);
nmwa_vpn_connection_set_stage (vpn, stage);
}
else
{
vpn = nmwa_vpn_connection_new (name);
nmwa_vpn_connection_set_service (vpn, service);
nmwa_vpn_connection_set_state (vpn, state);
nmwa_vpn_connection_set_stage (vpn, stage);
applet->vpn_connections = g_slist_append (applet->vpn_connections, vpn);
}
}

View file

@ -33,6 +33,6 @@ void nmwa_dbus_vpn_remove_one_vpn_connection (NMWirelessApplet *applet, const
void nmwa_dbus_vpn_activate_connection (DBusConnection *connection, const char *name, GSList *passwords);
void nmwa_dbus_vpn_deactivate_connection (DBusConnection *connection);
void nmwa_dbus_vpn_update_vpn_connection_state (NMWirelessApplet *applet, const char *vpn_name, NMVPNActStage vpn_state);
void nmwa_dbus_vpn_update_vpn_connection_stage (NMWirelessApplet *applet, const char *vpn_name, NMVPNActStage vpn_state);
#endif

View file

@ -226,13 +226,13 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionStateChange")) /* Active VPN connection changed */
{
char * name = NULL;
NMVPNActStage vpn_state;
dbus_uint32_t vpn_state_int;
NMVPNActStage vpn_stage;
dbus_uint32_t vpn_stage_int;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_UINT32, &vpn_state_int, DBUS_TYPE_INVALID))
if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_UINT32, &vpn_stage_int, DBUS_TYPE_INVALID))
{
vpn_state = (NMVPNActStage) vpn_state_int;
nmwa_dbus_vpn_update_vpn_connection_state (applet, name, vpn_state);
vpn_stage = (NMVPNActStage) vpn_stage_int;
nmwa_dbus_vpn_update_vpn_connection_stage (applet, name, vpn_stage);
}
}
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionRemoved"))

View file

@ -819,7 +819,7 @@ VPNConnection *nmwa_get_first_active_vpn_connection (NMWirelessApplet *applet)
for (elt = applet->vpn_connections; elt; elt = g_slist_next (elt))
{
vpn = (VPNConnection*) elt->data;
vpn_state = nmwa_vpn_connection_get_state (vpn);
vpn_state = nmwa_vpn_connection_get_stage (vpn);
if (vpn_state == NM_VPN_ACT_STAGE_ACTIVATED)
return vpn;
}

View file

@ -28,7 +28,7 @@ struct VPNConnection
int refcount;
char * name;
char * service;
NMVPNActStage state;
NMVPNActStage stage;
};
@ -56,7 +56,7 @@ VPNConnection *nmwa_vpn_connection_copy (VPNConnection *src_vpn)
dst_vpn->refcount = 1;
dst_vpn->name = g_strdup (src_vpn->name);
dst_vpn->service = src_vpn->service ? g_strdup (src_vpn->service) : NULL;
dst_vpn->state = src_vpn->state;
dst_vpn->stage = src_vpn->stage;
return dst_vpn;
}
@ -136,18 +136,18 @@ VPNConnection *nmwa_vpn_connection_find_by_name (GSList *list, const char *name)
return vpn;
}
NMVPNActStage nmwa_vpn_connection_get_state (VPNConnection *vpn)
NMVPNActStage nmwa_vpn_connection_get_stage (VPNConnection *vpn)
{
g_return_val_if_fail (vpn != NULL, NM_VPN_ACT_STAGE_UNKNOWN);
return vpn->state;
return vpn->stage;
}
void nmwa_vpn_connection_set_state (VPNConnection *vpn, NMVPNActStage state)
void nmwa_vpn_connection_set_stage (VPNConnection *vpn, NMVPNActStage stage)
{
g_return_if_fail (vpn != NULL);
vpn->state = state;
vpn->stage = stage;
}
gboolean nmwa_vpn_connection_is_activating (VPNConnection *vpn)
@ -156,7 +156,7 @@ gboolean nmwa_vpn_connection_is_activating (VPNConnection *vpn)
g_return_val_if_fail (vpn != NULL, FALSE);
stage = nmwa_vpn_connection_get_state (vpn);
stage = nmwa_vpn_connection_get_stage (vpn);
if (stage == NM_VPN_ACT_STAGE_PREPARE ||
stage == NM_VPN_ACT_STAGE_CONNECT ||
stage == NM_VPN_ACT_STAGE_IP_CONFIG_GET)

View file

@ -34,8 +34,8 @@ const char * nmwa_vpn_connection_get_name (VPNConnection *vpn);
const char * nmwa_vpn_connection_get_service (VPNConnection *vpn);
void nmwa_vpn_connection_set_service (VPNConnection *vpn, const char *service);
NMVPNActStage nmwa_vpn_connection_get_state (VPNConnection *vpn);
void nmwa_vpn_connection_set_state (VPNConnection *vpn, NMVPNActStage state);
NMVPNActStage nmwa_vpn_connection_get_stage (VPNConnection *vpn);
void nmwa_vpn_connection_set_stage (VPNConnection *vpn, NMVPNActStage stage);
gboolean nmwa_vpn_connection_is_activating (VPNConnection *vpn);