2006-02-27 Dan Williams <dcbw@redhat.com>

* gnome/applet/*
		- Mass search/replace of:
			nmwa -> nma
			NMWirelessApplet -> NMApplet
			NM_*_WIRELESS_APPLET -> NM_*_APPLET
		   (it ain't just for wireless anymore, ma!)
		- Fix duplicate function name printing when using nm_warning
		- wireless-applet.glade -> applet.glade


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1501 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2006-02-27 06:26:31 +00:00
parent e64e90cd3b
commit 4fe5a5e2c9
23 changed files with 631 additions and 627 deletions

View file

@ -1,3 +1,14 @@
2006-02-27 Dan Williams <dcbw@redhat.com>
* gnome/applet/*
- Mass search/replace of:
nmwa -> nma
NMWirelessApplet -> NMApplet
NM_*_WIRELESS_APPLET -> NM_*_APPLET
(it ain't just for wireless anymore, ma!)
- Fix duplicate function name printing when using nm_warning
- wireless-applet.glade -> applet.glade
2006-02-27 Dan Williams <dcbw@redhat.com> 2006-02-27 Dan Williams <dcbw@redhat.com>
* dispatcher-daemon/NetworkManagerDispatcher.c * dispatcher-daemon/NetworkManagerDispatcher.c

View file

@ -119,7 +119,7 @@ endif
gladedir = $(datadir)/nm-applet gladedir = $(datadir)/nm-applet
glade_DATA = wireless-applet.glade keyring.png glade_DATA = applet.glade keyring.png
dbusservicedir = $(DBUS_SYS_DIR) dbusservicedir = $(DBUS_SYS_DIR)
dbusservice_DATA = nm-applet.conf dbusservice_DATA = nm-applet.conf

View file

@ -42,15 +42,15 @@
/* /*
* nmwa_dbus_nm_state_cb * nma_dbus_nm_state_cb
* *
* Callback from nmwa_dbus_update_nm_state * Callback from nma_dbus_update_nm_state
* *
*/ */
static void nmwa_dbus_nm_state_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_nm_state_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage * reply; DBusMessage * reply;
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
NMState nm_state; NMState nm_state;
g_return_if_fail (pcall != NULL); g_return_if_fail (pcall != NULL);
@ -65,14 +65,14 @@ static void nmwa_dbus_nm_state_cb (DBusPendingCall *pcall, void *user_data)
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("nmwa_dbus_nm_state_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
} }
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_UINT32, &nm_state, DBUS_TYPE_INVALID)) if (dbus_message_get_args (reply, NULL, DBUS_TYPE_UINT32, &nm_state, DBUS_TYPE_INVALID))
nmwa_set_state (applet, nm_state); nma_set_state (applet, nm_state);
dbus_message_unref (reply); dbus_message_unref (reply);
@ -82,12 +82,12 @@ out:
/* /*
* nmwa_dbus_update_nm_state * nma_dbus_update_nm_state
* *
* Update internal applet state from NetworkManager state * Update internal applet state from NetworkManager state
* *
*/ */
void nmwa_dbus_update_nm_state (NMWirelessApplet *applet) void nma_dbus_update_nm_state (NMApplet *applet)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -98,7 +98,7 @@ void nmwa_dbus_update_nm_state (NMWirelessApplet *applet)
{ {
dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_connection_send_with_reply (applet->connection, message, &pcall, -1);
if (pcall) if (pcall)
dbus_pending_call_set_notify (pcall, nmwa_dbus_nm_state_cb, applet, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_nm_state_cb, applet, NULL);
dbus_message_unref (message); dbus_message_unref (message);
} }
} }
@ -106,21 +106,21 @@ void nmwa_dbus_update_nm_state (NMWirelessApplet *applet)
typedef struct DriverCBData typedef struct DriverCBData
{ {
NMWirelessApplet * applet; NMApplet * applet;
NetworkDevice * dev; NetworkDevice * dev;
} DriverCBData; } DriverCBData;
/* /*
* nmwa_dbus_device_get_driver_cb * nma_dbus_device_get_driver_cb
* *
* Callback from nmwa_dbus_update_wireless_enabled * Callback from nma_dbus_update_wireless_enabled
* *
*/ */
static void nmwa_dbus_device_get_driver_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_device_get_driver_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage * reply; DBusMessage * reply;
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
DriverCBData * data = (DriverCBData *) user_data; DriverCBData * data = (DriverCBData *) user_data;
const char * driver; const char * driver;
@ -136,7 +136,7 @@ static void nmwa_dbus_device_get_driver_cb (DBusPendingCall *pcall, void *user_d
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("%s(): dbus returned an error.\n (%s) %s\n", __func__, err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -162,12 +162,12 @@ out:
/* /*
* nmwa_dbus_device_get_driver * nma_dbus_device_get_driver
* *
* Get the a device's driver name * Get the a device's driver name
* *
*/ */
static void nmwa_dbus_device_get_driver (NetworkDevice *dev, NMWirelessApplet *applet) static void nma_dbus_device_get_driver (NetworkDevice *dev, NMApplet *applet)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -187,7 +187,7 @@ static void nmwa_dbus_device_get_driver (NetworkDevice *dev, NMWirelessApplet *a
network_device_ref (dev); network_device_ref (dev);
data->dev = dev; data->dev = dev;
data->applet = applet; data->applet = applet;
dbus_pending_call_set_notify (pcall, nmwa_dbus_device_get_driver_cb, data, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_device_get_driver_cb, data, NULL);
} }
dbus_message_unref (message); dbus_message_unref (message);
} }
@ -195,15 +195,15 @@ static void nmwa_dbus_device_get_driver (NetworkDevice *dev, NMWirelessApplet *a
/* /*
* nmwa_dbus_update_wireless_enabled_cb * nma_dbus_update_wireless_enabled_cb
* *
* Callback from nmwa_dbus_update_wireless_enabled * Callback from nma_dbus_update_wireless_enabled
* *
*/ */
static void nmwa_dbus_update_wireless_enabled_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_update_wireless_enabled_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage * reply; DBusMessage * reply;
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
gboolean wireless_enabled; gboolean wireless_enabled;
g_return_if_fail (pcall != NULL); g_return_if_fail (pcall != NULL);
@ -218,7 +218,7 @@ static void nmwa_dbus_update_wireless_enabled_cb (DBusPendingCall *pcall, void *
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("nmwa_dbus_update_wireless_enabled_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -227,7 +227,7 @@ static void nmwa_dbus_update_wireless_enabled_cb (DBusPendingCall *pcall, void *
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_BOOLEAN, &wireless_enabled, DBUS_TYPE_INVALID)) if (dbus_message_get_args (reply, NULL, DBUS_TYPE_BOOLEAN, &wireless_enabled, DBUS_TYPE_INVALID))
{ {
applet->wireless_enabled = wireless_enabled; applet->wireless_enabled = wireless_enabled;
nmwa_enable_wireless_set_active (applet); nma_enable_wireless_set_active (applet);
} }
dbus_message_unref (reply); dbus_message_unref (reply);
@ -238,12 +238,12 @@ out:
/* /*
* nmwa_dbus_update_wireless_enabled * nma_dbus_update_wireless_enabled
* *
* Get the wireless_enabled value from NetworkManager * Get the wireless_enabled value from NetworkManager
* *
*/ */
static void nmwa_dbus_update_wireless_enabled (NMWirelessApplet *applet) static void nma_dbus_update_wireless_enabled (NMApplet *applet)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -254,7 +254,7 @@ static void nmwa_dbus_update_wireless_enabled (NMWirelessApplet *applet)
{ {
dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_connection_send_with_reply (applet->connection, message, &pcall, -1);
if (pcall) if (pcall)
dbus_pending_call_set_notify (pcall, nmwa_dbus_update_wireless_enabled_cb, applet, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_update_wireless_enabled_cb, applet, NULL);
dbus_message_unref (message); dbus_message_unref (message);
} }
} }
@ -262,7 +262,7 @@ static void nmwa_dbus_update_wireless_enabled (NMWirelessApplet *applet)
typedef struct HalInfoCBData typedef struct HalInfoCBData
{ {
NMWirelessApplet * applet; NMApplet * applet;
NetworkDevice * dev; NetworkDevice * dev;
char * parent_op; char * parent_op;
char * vendor; char * vendor;
@ -309,7 +309,7 @@ static void hal_info_product_cb (DBusPendingCall *pcall, void *user_data)
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("hal_info_product_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -355,7 +355,7 @@ static void hal_info_vendor_cb (DBusPendingCall *pcall, void *user_data)
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("hal_info_vendor_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -397,7 +397,7 @@ out:
/* /*
* hal_net_physdev_cb * hal_net_physdev_cb
* *
* nmwa_dbus_update_device_info_from_hal callback * nma_dbus_update_device_info_from_hal callback
* *
*/ */
static void hal_net_physdev_cb (DBusPendingCall *pcall, void *user_data) static void hal_net_physdev_cb (DBusPendingCall *pcall, void *user_data)
@ -420,7 +420,7 @@ static void hal_net_physdev_cb (DBusPendingCall *pcall, void *user_data)
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("hal_net_physdev_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -460,12 +460,12 @@ out:
/* /*
* nmwa_dbus_update_device_info_from_hal * nma_dbus_update_device_info_from_hal
* *
* Grab the info.product tag from hal for a specific UDI * Grab the info.product tag from hal for a specific UDI
* *
*/ */
static void nmwa_dbus_update_device_info_from_hal (NetworkDevice *dev, NMWirelessApplet *applet) static void nma_dbus_update_device_info_from_hal (NetworkDevice *dev, NMApplet *applet)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -495,7 +495,7 @@ static void nmwa_dbus_update_device_info_from_hal (NetworkDevice *dev, NMWireles
} }
void nmwa_free_data_model (NMWirelessApplet *applet) void nma_free_data_model (NMApplet *applet)
{ {
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
@ -512,7 +512,7 @@ typedef struct NetPropCBData
{ {
char * dev_op; char * dev_op;
char * act_net; char * act_net;
NMWirelessApplet * applet; NMApplet * applet;
} NetPropCBData; } NetPropCBData;
static void free_net_prop_cb_data (NetPropCBData *data) static void free_net_prop_cb_data (NetPropCBData *data)
@ -527,16 +527,16 @@ static void free_net_prop_cb_data (NetPropCBData *data)
/* /*
* nmwa_dbus_net_properties_cb * nma_dbus_net_properties_cb
* *
* Callback for each network we called "getProperties" on in nmwa_dbus_device_properties_cb(). * Callback for each network we called "getProperties" on in nma_dbus_device_properties_cb().
* *
*/ */
static void nmwa_dbus_net_properties_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_net_properties_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage * reply; DBusMessage * reply;
NetPropCBData * cb_data = (NetPropCBData *) user_data; NetPropCBData * cb_data = (NetPropCBData *) user_data;
NMWirelessApplet * applet; NMApplet * applet;
const char * op = NULL; const char * op = NULL;
const char * essid = NULL; const char * essid = NULL;
const char * hw_addr = NULL; const char * hw_addr = NULL;
@ -569,7 +569,7 @@ static void nmwa_dbus_net_properties_cb (DBusPendingCall *pcall, void *user_data
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("nmwa_dbus_net_properties_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -588,7 +588,7 @@ static void nmwa_dbus_net_properties_cb (DBusPendingCall *pcall, void *user_data
{ {
NetworkDevice * dev; NetworkDevice * dev;
if ((dev = nmwa_get_device_for_nm_path (applet->device_list, cb_data->dev_op))) if ((dev = nma_get_device_for_nm_path (applet->device_list, cb_data->dev_op)))
{ {
WirelessNetwork * net = wireless_network_new (essid, op); WirelessNetwork * net = wireless_network_new (essid, op);
WirelessNetwork * tmp_net; WirelessNetwork * tmp_net;
@ -620,12 +620,12 @@ out:
/* /*
* nmwa_dbus_device_update_one_network * nma_dbus_device_update_one_network
* *
* Get properties on just one wireless network. * Get properties on just one wireless network.
* *
*/ */
void nmwa_dbus_device_update_one_network (NMWirelessApplet *applet, const char *dev_path, const char *net_path, const char *active_net_path) void nma_dbus_device_update_one_network (NMApplet *applet, const char *dev_path, const char *net_path, const char *active_net_path)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -644,7 +644,7 @@ void nmwa_dbus_device_update_one_network (NMWirelessApplet *applet, const char *
cb_data->dev_op = g_strdup (dev_path); cb_data->dev_op = g_strdup (dev_path);
cb_data->act_net = (active_net_path && strlen (active_net_path)) ? g_strdup (active_net_path) : NULL; cb_data->act_net = (active_net_path && strlen (active_net_path)) ? g_strdup (active_net_path) : NULL;
cb_data->applet = applet; cb_data->applet = applet;
dbus_pending_call_set_notify (pcall, nmwa_dbus_net_properties_cb, cb_data, (DBusFreeFunction) free_net_prop_cb_data); dbus_pending_call_set_notify (pcall, nma_dbus_net_properties_cb, cb_data, (DBusFreeFunction) free_net_prop_cb_data);
} }
dbus_message_unref (message); dbus_message_unref (message);
} }
@ -652,12 +652,12 @@ void nmwa_dbus_device_update_one_network (NMWirelessApplet *applet, const char *
/* /*
* nmwa_dbus_device_remove_one_network * nma_dbus_device_remove_one_network
* *
* Remove a wireless network from a device. * Remove a wireless network from a device.
* *
*/ */
void nmwa_dbus_device_remove_one_network (NMWirelessApplet *applet, const char *dev_path, const char *net_path) void nma_dbus_device_remove_one_network (NMApplet *applet, const char *dev_path, const char *net_path)
{ {
NetworkDevice * dev; NetworkDevice * dev;
@ -665,7 +665,7 @@ void nmwa_dbus_device_remove_one_network (NMWirelessApplet *applet, const char *
g_return_if_fail (dev_path != NULL); g_return_if_fail (dev_path != NULL);
g_return_if_fail (net_path != NULL); g_return_if_fail (net_path != NULL);
if ((dev = nmwa_get_device_for_nm_path (applet->device_list, dev_path))) if ((dev = nma_get_device_for_nm_path (applet->device_list, dev_path)))
{ {
WirelessNetwork * net; WirelessNetwork * net;
@ -722,15 +722,15 @@ sort_devices_function (gconstpointer a, gconstpointer b)
/* /*
* nmwa_dbus_device_properties_cb * nma_dbus_device_properties_cb
* *
* Callback for each device we called "getProperties" on in nmwa_dbus_update_devices_cb(). * Callback for each device we called "getProperties" on in nma_dbus_update_devices_cb().
* *
*/ */
static void nmwa_dbus_device_properties_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_device_properties_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage * reply; DBusMessage * reply;
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
char * op = NULL; char * op = NULL;
const char * iface = NULL; const char * iface = NULL;
dbus_uint32_t type = 0; dbus_uint32_t type = 0;
@ -765,7 +765,7 @@ static void nmwa_dbus_device_properties_cb (DBusPendingCall *pcall, void *user_d
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("nmwa_dbus_device_properties_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -794,7 +794,7 @@ static void nmwa_dbus_device_properties_cb (DBusPendingCall *pcall, void *user_d
DBUS_TYPE_INVALID)) DBUS_TYPE_INVALID))
{ {
NetworkDevice *dev = network_device_new (iface, type, op); NetworkDevice *dev = network_device_new (iface, type, op);
NetworkDevice *tmp_dev = nmwa_get_device_for_nm_path (applet->device_list, op); NetworkDevice *tmp_dev = nma_get_device_for_nm_path (applet->device_list, op);
network_device_set_hal_udi (dev, udi); network_device_set_hal_udi (dev, udi);
network_device_set_address (dev, hw_addr); network_device_set_address (dev, hw_addr);
@ -819,8 +819,8 @@ static void nmwa_dbus_device_properties_cb (DBusPendingCall *pcall, void *user_d
network_device_unref (tmp_dev); network_device_unref (tmp_dev);
} }
nmwa_dbus_update_device_info_from_hal (dev, applet); nma_dbus_update_device_info_from_hal (dev, applet);
nmwa_dbus_device_get_driver (dev, applet); nma_dbus_device_get_driver (dev, applet);
if (type == DEVICE_TYPE_802_11_WIRELESS) if (type == DEVICE_TYPE_802_11_WIRELESS)
{ {
@ -832,7 +832,7 @@ static void nmwa_dbus_device_properties_cb (DBusPendingCall *pcall, void *user_d
char ** item; char ** item;
for (item = networks; *item; item++) for (item = networks; *item; item++)
nmwa_dbus_device_update_one_network (applet, op, *item, active_network_path); nma_dbus_device_update_one_network (applet, op, *item, active_network_path);
} }
} }
dbus_free_string_array (networks); dbus_free_string_array (networks);
@ -848,12 +848,12 @@ out:
/* /*
* nmwa_dbus_device_update_one_device * nma_dbus_device_update_one_device
* *
* Get properties on just one device. * Get properties on just one device.
* *
*/ */
void nmwa_dbus_device_update_one_device (NMWirelessApplet *applet, const char *dev_path) void nma_dbus_device_update_one_device (NMApplet *applet, const char *dev_path)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -865,14 +865,14 @@ void nmwa_dbus_device_update_one_device (NMWirelessApplet *applet, const char *d
{ {
dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_connection_send_with_reply (applet->connection, message, &pcall, -1);
if (pcall) if (pcall)
dbus_pending_call_set_notify (pcall, nmwa_dbus_device_properties_cb, applet, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_device_properties_cb, applet, NULL);
dbus_message_unref (message); dbus_message_unref (message);
} }
} }
typedef struct _DeviceActivatedCBData typedef struct _DeviceActivatedCBData
{ {
NMWirelessApplet *applet; NMApplet *applet;
char *essid; char *essid;
} DeviceActivatedCBData; } DeviceActivatedCBData;
@ -889,23 +889,23 @@ static void free_device_activated_cb_data (DeviceActivatedCBData *obj)
g_free (obj); g_free (obj);
} }
static void nmwa_dbus_device_activated_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_device_activated_cb (DBusPendingCall *pcall, void *user_data)
{ {
DeviceActivatedCBData * cb_data = (DeviceActivatedCBData*) user_data; DeviceActivatedCBData * cb_data = (DeviceActivatedCBData*) user_data;
NMWirelessApplet * applet = cb_data->applet; NMApplet * applet = cb_data->applet;
char * essid = cb_data->essid; char * essid = cb_data->essid;
NetworkDevice * active_device; NetworkDevice * active_device;
char * message = NULL; char * message = NULL;
char * icon = NULL; char * icon = NULL;
nmwa_dbus_device_properties_cb (pcall, applet); nma_dbus_device_properties_cb (pcall, applet);
/* Don't show anything if the applet isn't shown */ /* Don't show anything if the applet isn't shown */
if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (applet))) if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (applet)))
goto out; goto out;
#ifdef ENABLE_NOTIFY #ifdef ENABLE_NOTIFY
active_device = nmwa_get_first_active_device (applet->device_list); active_device = nma_get_first_active_device (applet->device_list);
if (active_device && network_device_is_wireless (active_device)) if (active_device && network_device_is_wireless (active_device))
{ {
if (applet->is_adhoc) if (applet->is_adhoc)
@ -928,7 +928,7 @@ static void nmwa_dbus_device_activated_cb (DBusPendingCall *pcall, void *user_da
nm_info ("%s", message); nm_info ("%s", message);
nmwa_send_event_notification (applet, NOTIFY_URGENCY_LOW, _("Connection Established"), message, icon); nma_send_event_notification (applet, NOTIFY_URGENCY_LOW, _("Connection Established"), message, icon);
g_free (message); g_free (message);
#endif #endif
@ -937,7 +937,7 @@ out:
} }
void nmwa_dbus_device_activated (NMWirelessApplet *applet, const char *dev_path, const char *essid) void nma_dbus_device_activated (NMApplet *applet, const char *dev_path, const char *essid)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -955,29 +955,29 @@ void nmwa_dbus_device_activated (NMWirelessApplet *applet, const char *dev_path,
{ {
dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_connection_send_with_reply (applet->connection, message, &pcall, -1);
if (pcall) if (pcall)
dbus_pending_call_set_notify (pcall, nmwa_dbus_device_activated_cb, cb_data, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_device_activated_cb, cb_data, NULL);
dbus_message_unref (message); dbus_message_unref (message);
} }
} }
static void nmwa_dbus_device_deactivated_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_device_deactivated_cb (DBusPendingCall *pcall, void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
nmwa_dbus_device_properties_cb (pcall, applet); nma_dbus_device_properties_cb (pcall, applet);
#ifdef ENABLE_NOTIFY #ifdef ENABLE_NOTIFY
/* Don't show anything if the applet isn't shown */ /* Don't show anything if the applet isn't shown */
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (applet))) if (GTK_WIDGET_VISIBLE (GTK_WIDGET (applet)))
{ {
nmwa_send_event_notification (applet, NOTIFY_URGENCY_NORMAL, _("Disconnected"), nma_send_event_notification (applet, NOTIFY_URGENCY_NORMAL, _("Disconnected"),
_("The network connection has been disconnected."), "nm-no-connection"); _("The network connection has been disconnected."), "nm-no-connection");
} }
#endif #endif
} }
void nmwa_dbus_device_deactivated (NMWirelessApplet *applet, const char *dev_path) void nma_dbus_device_deactivated (NMApplet *applet, const char *dev_path)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -989,22 +989,22 @@ void nmwa_dbus_device_deactivated (NMWirelessApplet *applet, const char *dev_pat
{ {
dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_connection_send_with_reply (applet->connection, message, &pcall, -1);
if (pcall) if (pcall)
dbus_pending_call_set_notify (pcall, nmwa_dbus_device_deactivated_cb, applet, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_device_deactivated_cb, applet, NULL);
dbus_message_unref (message); dbus_message_unref (message);
} }
} }
/* /*
* nmwa_dbus_update_devices_cb * nma_dbus_update_devices_cb
* *
* nmwa_dbus_update_devices callback. * nma_dbus_update_devices callback.
* *
*/ */
static void nmwa_dbus_update_devices_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_update_devices_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage * reply; DBusMessage * reply;
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
char ** devices; char ** devices;
int num_devices; int num_devices;
@ -1026,7 +1026,7 @@ static void nmwa_dbus_update_devices_cb (DBusPendingCall *pcall, void *user_data
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("nmwa_dbus_update_devices_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -1038,7 +1038,7 @@ static void nmwa_dbus_update_devices_cb (DBusPendingCall *pcall, void *user_data
/* For each device, fire off a "getProperties" call */ /* For each device, fire off a "getProperties" call */
for (item = devices; *item; item++) for (item = devices; *item; item++)
nmwa_dbus_device_update_one_device (applet, *item); nma_dbus_device_update_one_device (applet, *item);
dbus_free_string_array (devices); dbus_free_string_array (devices);
} }
@ -1050,39 +1050,39 @@ out:
/* /*
* nmwa_dbus_update_devices * nma_dbus_update_devices
* *
* Do a full update of network devices, wireless networks, and dial up devices. * Do a full update of network devices, wireless networks, and dial up devices.
* *
*/ */
void nmwa_dbus_update_devices (NMWirelessApplet *applet) void nma_dbus_update_devices (NMApplet *applet)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall; DBusPendingCall * pcall;
nmwa_free_data_model (applet); nma_free_data_model (applet);
if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE, "getDevices"))) if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE, "getDevices")))
{ {
dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_connection_send_with_reply (applet->connection, message, &pcall, -1);
if (pcall) if (pcall)
dbus_pending_call_set_notify (pcall, nmwa_dbus_update_devices_cb, applet, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_update_devices_cb, applet, NULL);
dbus_message_unref (message); dbus_message_unref (message);
} }
nmwa_dbus_update_wireless_enabled (applet); nma_dbus_update_wireless_enabled (applet);
} }
/* /*
* nmwa_dbus_update_dialup_cb * nma_dbus_update_dialup_cb
* *
* nmwa_dbus_update_dialup DBUS callback. * nma_dbus_update_dialup DBUS callback.
* *
*/ */
static void nmwa_dbus_update_dialup_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_update_dialup_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage *reply; DBusMessage *reply;
NMWirelessApplet *applet = (NMWirelessApplet *) user_data; NMApplet *applet = (NMApplet *) user_data;
char **dialup_devices; char **dialup_devices;
int num_devices; int num_devices;
@ -1104,7 +1104,7 @@ static void nmwa_dbus_update_dialup_cb (DBusPendingCall *pcall, void *user_data)
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("nmwa_dbus_update_wireless_enabled_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -1136,12 +1136,12 @@ out:
/* /*
* nmwa_dbus_dialup_activate_connection * nma_dbus_dialup_activate_connection
* *
* Tell NetworkManager to activate a particular dialup connection. * Tell NetworkManager to activate a particular dialup connection.
* *
*/ */
void nmwa_dbus_dialup_activate_connection (NMWirelessApplet *applet, const char *name) void nma_dbus_dialup_activate_connection (NMApplet *applet, const char *name)
{ {
DBusMessage *message; DBusMessage *message;
@ -1168,21 +1168,21 @@ void nmwa_dbus_dialup_activate_connection (NMWirelessApplet *applet, const char
dbus_message_append_args (message, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID); dbus_message_append_args (message, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID);
if (!dbus_connection_send (applet->connection, message, NULL)) if (!dbus_connection_send (applet->connection, message, NULL))
nm_warning ("nmwa_dbus_dialup_activate_connection(): Could not send activateDialup message!"); nm_warning ("Could not send activateDialup message!");
dbus_message_unref (message); dbus_message_unref (message);
} }
else else
nm_warning ("nmwa_dbus_dialup_activate_connection(): Couldn't allocate the dbus message!"); nm_warning ("Couldn't allocate the dbus message!");
} }
/* /*
* nmwa_dbus_dialup_activate_connection * nma_dbus_dialup_activate_connection
* *
* Tell NetworkManager to activate a particular dialup connection. * Tell NetworkManager to activate a particular dialup connection.
* *
*/ */
void nmwa_dbus_dialup_deactivate_connection (NMWirelessApplet *applet, const char *name) void nma_dbus_dialup_deactivate_connection (NMApplet *applet, const char *name)
{ {
DBusMessage *message; DBusMessage *message;
@ -1209,50 +1209,50 @@ void nmwa_dbus_dialup_deactivate_connection (NMWirelessApplet *applet, const cha
dbus_message_append_args (message, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID); dbus_message_append_args (message, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID);
if (!dbus_connection_send (applet->connection, message, NULL)) if (!dbus_connection_send (applet->connection, message, NULL))
nm_warning ("nmwa_dbus_dialup_deactivate_connection(): Could not send deactivateDialup message!"); nm_warning ("Could not send deactivateDialup message!");
dbus_message_unref (message); dbus_message_unref (message);
} }
else else
nm_warning ("nmwa_dbus_dialup_deactivate_connection(): Couldn't allocate the dbus message!"); nm_warning ("Couldn't allocate the dbus message!");
} }
/* /*
* nmwa_dbus_update_dialup * nma_dbus_update_dialup
* *
* Do an update of dial up devices. * Do an update of dial up devices.
* *
*/ */
void nmwa_dbus_update_dialup (NMWirelessApplet *applet) void nma_dbus_update_dialup (NMApplet *applet)
{ {
DBusMessage *message; DBusMessage *message;
DBusPendingCall *pcall; DBusPendingCall *pcall;
nmwa_free_data_model (applet); nma_free_data_model (applet);
if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE, "getDialup"))) if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE, "getDialup")))
{ {
dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_connection_send_with_reply (applet->connection, message, &pcall, -1);
if (pcall) if (pcall)
dbus_pending_call_set_notify (pcall, nmwa_dbus_update_dialup_cb, applet, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_update_dialup_cb, applet, NULL);
dbus_message_unref (message); dbus_message_unref (message);
} }
} }
/* /*
* nmwa_dbus_device_remove_one_device * nma_dbus_device_remove_one_device
* *
* Remove a device from our list. * Remove a device from our list.
* *
*/ */
void nmwa_dbus_device_remove_one_device (NMWirelessApplet *applet, const char *dev_path) void nma_dbus_device_remove_one_device (NMApplet *applet, const char *dev_path)
{ {
NetworkDevice * dev; NetworkDevice * dev;
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
if ((dev = nmwa_get_device_for_nm_path (applet->device_list, dev_path))) if ((dev = nma_get_device_for_nm_path (applet->device_list, dev_path)))
{ {
applet->device_list = g_slist_remove (applet->device_list, dev); applet->device_list = g_slist_remove (applet->device_list, dev);
network_device_unref (dev); network_device_unref (dev);
@ -1261,13 +1261,13 @@ void nmwa_dbus_device_remove_one_device (NMWirelessApplet *applet, const char *d
/* /*
* nmwa_dbus_set_device * nma_dbus_set_device
* *
* Tell NetworkManager to use a specific network device that the user picked, and * Tell NetworkManager to use a specific network device that the user picked, and
* possibly a specific wireless network too. * possibly a specific wireless network too.
* *
*/ */
void nmwa_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid,
WirelessSecurityOption * opt) WirelessSecurityOption * opt)
{ {
DBusMessage * message; DBusMessage * message;
@ -1303,17 +1303,17 @@ void nmwa_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const
dbus_message_unref (message); dbus_message_unref (message);
} }
else else
nm_warning ("nmwa_dbus_set_device(): Couldn't allocate the dbus message\n"); nm_warning ("Couldn't allocate the dbus message\n");
} }
/* /*
* nmwa_dbus_create_network * nma_dbus_create_network
* *
* Tell NetworkManager to create an Ad-Hoc wireless network * Tell NetworkManager to create an Ad-Hoc wireless network
* *
*/ */
void nmwa_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, const char *essid, void nma_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, const char *essid,
WirelessSecurityOption * opt) WirelessSecurityOption * opt)
{ {
DBusMessage *message; DBusMessage *message;
@ -1337,21 +1337,21 @@ void nmwa_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, c
wso_append_dbus_params (opt, essid, message); wso_append_dbus_params (opt, essid, message);
dbus_connection_send (connection, message, NULL); dbus_connection_send (connection, message, NULL);
} else } else
nm_warning ("nmwa_dbus_create_network(): Could not get the device path!\n"); nm_warning ("Could not get the device path!\n");
dbus_message_unref (message); dbus_message_unref (message);
} }
else else
nm_warning ("nmwa_dbus_create_network(): Couldn't allocate the dbus message\n"); nm_warning ("Couldn't allocate the dbus message\n");
} }
/* /*
* nmwa_dbus_enable_wireless * nma_dbus_enable_wireless
* *
* Tell NetworkManager to enabled or disable all wireless devices. * Tell NetworkManager to enabled or disable all wireless devices.
* *
*/ */
void nmwa_dbus_enable_wireless (NMWirelessApplet *applet, gboolean enabled) void nma_dbus_enable_wireless (NMApplet *applet, gboolean enabled)
{ {
DBusMessage *message; DBusMessage *message;
@ -1362,18 +1362,18 @@ void nmwa_dbus_enable_wireless (NMWirelessApplet *applet, gboolean enabled)
{ {
dbus_message_append_args (message, DBUS_TYPE_BOOLEAN, &enabled, DBUS_TYPE_INVALID); dbus_message_append_args (message, DBUS_TYPE_BOOLEAN, &enabled, DBUS_TYPE_INVALID);
dbus_connection_send (applet->connection, message, NULL); dbus_connection_send (applet->connection, message, NULL);
nmwa_dbus_update_wireless_enabled (applet); nma_dbus_update_wireless_enabled (applet);
dbus_message_unref (message); dbus_message_unref (message);
} }
} }
/* /*
* nmwa_dbus_enable_networking * nma_dbus_enable_networking
* *
* Tell NetworkManager to enabled or disable all wireless devices. * Tell NetworkManager to enabled or disable all wireless devices.
* *
*/ */
void nmwa_dbus_enable_networking (NMWirelessApplet *applet, gboolean enabled) void nma_dbus_enable_networking (NMApplet *applet, gboolean enabled)
{ {
DBusMessage *message; DBusMessage *message;
const char *method; const char *method;
@ -1394,13 +1394,13 @@ void nmwa_dbus_enable_networking (NMWirelessApplet *applet, gboolean enabled)
} }
void nmwa_dbus_update_strength (NMWirelessApplet *applet, const char *dev_path, const char *net_path, int strength) void nma_dbus_update_strength (NMApplet *applet, const char *dev_path, const char *net_path, int strength)
{ {
NetworkDevice *dev; NetworkDevice *dev;
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
if ((dev = nmwa_get_device_for_nm_path (applet->device_list, dev_path))) if ((dev = nma_get_device_for_nm_path (applet->device_list, dev_path)))
{ {
if (net_path != NULL) if (net_path != NULL)
{ {

View file

@ -31,27 +31,27 @@
#include "wireless-network.h" #include "wireless-network.h"
#include "wireless-security-option.h" #include "wireless-security-option.h"
void nmwa_dbus_update_one_vpn_connection (DBusConnection *connection, const char *name, NMWirelessApplet *applet, gboolean is_active); void nma_dbus_update_one_vpn_connection (DBusConnection *connection, const char *name, NMApplet *applet, gboolean is_active);
void nmwa_dbus_update_vpn_connections (NMWirelessApplet *applet); void nma_dbus_update_vpn_connections (NMApplet *applet);
gboolean nmwa_dbus_update_device_strength (NMWirelessApplet *applet); gboolean nma_dbus_update_device_strength (NMApplet *applet);
void nmwa_dbus_update_nm_state (NMWirelessApplet *applet); void nma_dbus_update_nm_state (NMApplet *applet);
void nmwa_dbus_update_devices (NMWirelessApplet *applet); void nma_dbus_update_devices (NMApplet *applet);
void nmwa_dbus_update_dialup (NMWirelessApplet *applet); void nma_dbus_update_dialup (NMApplet *applet);
void nmwa_dbus_dialup_activate_connection (NMWirelessApplet *applet, const char *name); void nma_dbus_dialup_activate_connection (NMApplet *applet, const char *name);
void nmwa_dbus_dialup_deactivate_connection (NMWirelessApplet *applet, const char *name); void nma_dbus_dialup_deactivate_connection (NMApplet *applet, const char *name);
void nmwa_dbus_device_update_one_device (NMWirelessApplet *applet, const char *dev_path); void nma_dbus_device_update_one_device (NMApplet *applet, const char *dev_path);
void nmwa_dbus_device_activated (NMWirelessApplet *applet, const char *dev_path, const char *essid); void nma_dbus_device_activated (NMApplet *applet, const char *dev_path, const char *essid);
void nmwa_dbus_device_deactivated (NMWirelessApplet *applet, const char *dev_path); void nma_dbus_device_deactivated (NMApplet *applet, const char *dev_path);
void nmwa_dbus_device_remove_one_device (NMWirelessApplet *applet, const char *dev_path); void nma_dbus_device_remove_one_device (NMApplet *applet, const char *dev_path);
void nmwa_dbus_device_update_one_network (NMWirelessApplet *applet, const char *dev_path, const char *net_path, const char *active_net_path); void nma_dbus_device_update_one_network (NMApplet *applet, const char *dev_path, const char *net_path, const char *active_net_path);
void nmwa_dbus_device_remove_one_network (NMWirelessApplet *applet, const char *dev_path, const char *net_path); void nma_dbus_device_remove_one_network (NMApplet *applet, const char *dev_path, const char *net_path);
void nmwa_dbus_update_strength (NMWirelessApplet *applet, const char *dev_path, const char *net_path, int strength); void nma_dbus_update_strength (NMApplet *applet, const char *dev_path, const char *net_path, int strength);
void nmwa_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt); void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt);
void nmwa_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt); void nma_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt);
void nmwa_free_data_model (NMWirelessApplet *applet); void nma_free_data_model (NMApplet *applet);
#endif #endif

View file

@ -71,7 +71,7 @@ static inline gboolean nmi_network_type_valid (NMNetworkType type)
typedef struct NMGetNetworkKeyCBData typedef struct NMGetNetworkKeyCBData
{ {
NMWirelessApplet *applet; NMApplet *applet;
DBusMessage *message; DBusMessage *message;
NetworkDevice *dev; NetworkDevice *dev;
char *net_path; char *net_path;
@ -97,7 +97,7 @@ static void nmi_dbus_get_network_key_callback (GnomeKeyringResult result,
gpointer data) gpointer data)
{ {
NMGetNetworkKeyCBData * cb_data = (NMGetNetworkKeyCBData*) data; NMGetNetworkKeyCBData * cb_data = (NMGetNetworkKeyCBData*) data;
NMWirelessApplet * applet = cb_data->applet; NMApplet * applet = cb_data->applet;
DBusMessage * message = cb_data->message; DBusMessage * message = cb_data->message;
NetworkDevice * dev = cb_data->dev; NetworkDevice * dev = cb_data->dev;
char * net_path = cb_data->net_path; char * net_path = cb_data->net_path;
@ -141,7 +141,7 @@ nmi_dbus_get_key_for_network (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
void *user_data) void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
char * dev_path = NULL; char * dev_path = NULL;
char * net_path = NULL; char * net_path = NULL;
char * essid = NULL; char * essid = NULL;
@ -164,7 +164,7 @@ nmi_dbus_get_key_for_network (DBusConnection *connection,
DBUS_TYPE_INVALID)) DBUS_TYPE_INVALID))
return NULL; return NULL;
if (!(dev = nmwa_get_device_for_nm_path (applet->device_list, dev_path))) if (!(dev = nma_get_device_for_nm_path (applet->device_list, dev_path)))
return NULL; return NULL;
/* If we don't have a record of the network yet in GConf, ask for /* If we don't have a record of the network yet in GConf, ask for
@ -259,7 +259,7 @@ nmi_dbus_cancel_get_key_for_network (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
void *user_data) void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
g_return_val_if_fail (applet != NULL, NULL); g_return_val_if_fail (applet != NULL, NULL);
@ -309,7 +309,7 @@ nmi_dbus_get_networks (DBusConnection *connection,
{ {
const char * NO_NET_ERROR = "NoNetworks"; const char * NO_NET_ERROR = "NoNetworks";
const char * NO_NET_ERROR_MSG = "There are no wireless networks stored."; const char * NO_NET_ERROR_MSG = "There are no wireless networks stored.";
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
GSList * dir_list = NULL; GSList * dir_list = NULL;
GSList * elt; GSList * elt;
DBusMessage * reply = NULL; DBusMessage * reply = NULL;
@ -386,7 +386,7 @@ nmi_dbus_get_network_properties (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
void *user_data) void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
DBusMessage * reply = NULL; DBusMessage * reply = NULL;
gchar * gconf_key = NULL; gchar * gconf_key = NULL;
char * network = NULL; char * network = NULL;
@ -543,7 +543,7 @@ nmi_dbus_get_vpn_connections (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
void *user_data) void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
GSList * dir_list = NULL; GSList * dir_list = NULL;
GSList * elt = NULL; GSList * elt = NULL;
DBusMessage * reply = NULL; DBusMessage * reply = NULL;
@ -614,7 +614,7 @@ nmi_dbus_get_vpn_connection_properties (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
void *user_data) void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
DBusMessage * reply = NULL; DBusMessage * reply = NULL;
char * vpn_connection = NULL; char * vpn_connection = NULL;
char * escaped_name = NULL; char * escaped_name = NULL;
@ -680,7 +680,7 @@ nmi_dbus_get_vpn_connection_vpn_data (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
void *user_data) void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
DBusMessage * reply = NULL; DBusMessage * reply = NULL;
gchar * gconf_key = NULL; gchar * gconf_key = NULL;
char * name = NULL; char * name = NULL;
@ -753,7 +753,7 @@ nmi_dbus_get_vpn_connection_routes (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
void *user_data) void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
DBusMessage * reply = NULL; DBusMessage * reply = NULL;
gchar * gconf_key = NULL; gchar * gconf_key = NULL;
char * name = NULL; char * name = NULL;
@ -823,7 +823,7 @@ nmi_dbus_get_vpn_connection_routes (DBusConnection *connection,
* *
*/ */
static void static void
nmi_save_network_info (NMWirelessApplet *applet, nmi_save_network_info (NMApplet *applet,
const char *essid, const char *essid,
gboolean automatic, gboolean automatic,
const char *bssid, const char *bssid,
@ -959,7 +959,7 @@ nmi_dbus_update_network_info (DBusConnection *connection,
DBusMessage *message, DBusMessage *message,
void *user_data) void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
char * essid = NULL; char * essid = NULL;
gboolean automatic; gboolean automatic;
NMGConfWSO * gconf_wso = NULL; NMGConfWSO * gconf_wso = NULL;
@ -1026,7 +1026,7 @@ out:
*/ */
DBusHandlerResult nmi_dbus_info_message_handler (DBusConnection *connection, DBusMessage *message, void *user_data) DBusHandlerResult nmi_dbus_info_message_handler (DBusConnection *connection, DBusMessage *message, void *user_data)
{ {
NMWirelessApplet * applet = (NMWirelessApplet *)user_data; NMApplet * applet = (NMApplet *)user_data;
DBusMessage * reply = NULL; DBusMessage * reply = NULL;
gboolean handled; gboolean handled;

View file

@ -34,17 +34,17 @@
#include "vpn-connection.h" #include "vpn-connection.h"
#include "nm-utils.h" #include "nm-utils.h"
static void nmwa_free_vpn_connections (NMWirelessApplet *applet); static void nma_free_vpn_connections (NMApplet *applet);
void void
nmwa_dbus_vpn_set_last_attempt_status (NMWirelessApplet *applet, const char *vpn_name, gboolean last_attempt_success) nma_dbus_vpn_set_last_attempt_status (NMApplet *applet, const char *vpn_name, gboolean last_attempt_success)
{ {
char *gconf_key; char *gconf_key;
char *escaped_name; char *escaped_name;
VPNConnection *vpn; VPNConnection *vpn;
if ((vpn = nmwa_vpn_connection_find_by_name (applet->vpn_connections, vpn_name))) if ((vpn = nma_vpn_connection_find_by_name (applet->vpn_connections, vpn_name)))
{ {
escaped_name = gconf_escape_key (vpn_name, strlen (vpn_name)); escaped_name = gconf_escape_key (vpn_name, strlen (vpn_name));
@ -58,30 +58,30 @@ nmwa_dbus_vpn_set_last_attempt_status (NMWirelessApplet *applet, const char *vpn
/* /*
* nmwa_dbus_vpn_update_vpn_connection_stage * nma_dbus_vpn_update_vpn_connection_stage
* *
* Sets the activation stage for a dbus vpn connection. * Sets the activation stage for a dbus vpn connection.
*/ */
void nmwa_dbus_vpn_update_vpn_connection_stage (NMWirelessApplet *applet, const char *vpn_name, NMVPNActStage vpn_stage) void nma_dbus_vpn_update_vpn_connection_stage (NMApplet *applet, const char *vpn_name, NMVPNActStage vpn_stage)
{ {
VPNConnection *vpn; VPNConnection *vpn;
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
if ((vpn = nmwa_vpn_connection_find_by_name (applet->vpn_connections, vpn_name))) if ((vpn = nma_vpn_connection_find_by_name (applet->vpn_connections, vpn_name)))
{ {
nmwa_vpn_connection_set_stage (vpn, vpn_stage); nma_vpn_connection_set_stage (vpn, vpn_stage);
if (vpn_stage == NM_VPN_ACT_STAGE_ACTIVATED) 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 */ /* 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); nma_dbus_vpn_set_last_attempt_status (applet, vpn_name, TRUE);
} }
} }
} }
typedef struct VpnPropsCBData typedef struct VpnPropsCBData
{ {
NMWirelessApplet * applet; NMApplet * applet;
char * name; char * name;
} VpnPropsCBData; } VpnPropsCBData;
@ -96,16 +96,16 @@ static void free_vpn_props_cb_data (VpnPropsCBData *data)
} }
/* /*
* nmwa_dbus_vpn_properties_cb * nma_dbus_vpn_properties_cb
* *
* Callback for each VPN connection we called "getVPNConnectionProperties" on. * Callback for each VPN connection we called "getVPNConnectionProperties" on.
* *
*/ */
static void nmwa_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage * reply; DBusMessage * reply;
VpnPropsCBData * cb_data = user_data; VpnPropsCBData * cb_data = user_data;
NMWirelessApplet * applet; NMApplet * applet;
const char * name; const char * name;
const char * user_name; const char * user_name;
const char * service; const char * service;
@ -128,7 +128,7 @@ static void nmwa_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("nmwa_dbus_vpn_properties_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -142,16 +142,16 @@ static void nmwa_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data
stage = (NMVPNActStage) stage_int; stage = (NMVPNActStage) stage_int;
/* If its already there, update the service, otherwise add it to the list */ /* 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))) if ((vpn = nma_vpn_connection_find_by_name (applet->vpn_connections, name)))
{ {
nmwa_vpn_connection_set_service (vpn, service); nma_vpn_connection_set_service (vpn, service);
nmwa_vpn_connection_set_stage (vpn, stage); nma_vpn_connection_set_stage (vpn, stage);
} }
else else
{ {
vpn = nmwa_vpn_connection_new (name); vpn = nma_vpn_connection_new (name);
nmwa_vpn_connection_set_service (vpn, service); nma_vpn_connection_set_service (vpn, service);
nmwa_vpn_connection_set_stage (vpn, stage); nma_vpn_connection_set_stage (vpn, stage);
applet->vpn_connections = g_slist_append (applet->vpn_connections, vpn); applet->vpn_connections = g_slist_append (applet->vpn_connections, vpn);
} }
} }
@ -163,12 +163,12 @@ out:
/* /*
* nmwa_dbus_vpn_update_one_vpn_connection * nma_dbus_vpn_update_one_vpn_connection
* *
* Get properties on one VPN connection * Get properties on one VPN connection
* *
*/ */
void nmwa_dbus_vpn_update_one_vpn_connection (NMWirelessApplet *applet, const char *vpn_name) void nma_dbus_vpn_update_one_vpn_connection (NMApplet *applet, const char *vpn_name)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall = NULL; DBusPendingCall * pcall = NULL;
@ -176,7 +176,7 @@ void nmwa_dbus_vpn_update_one_vpn_connection (NMWirelessApplet *applet, const ch
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
g_return_if_fail (vpn_name != NULL); g_return_if_fail (vpn_name != NULL);
nmwa_get_first_active_vpn_connection (applet); nma_get_first_active_vpn_connection (applet);
if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH_VPN, NM_DBUS_INTERFACE_VPN, "getVPNConnectionProperties"))) if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH_VPN, NM_DBUS_INTERFACE_VPN, "getVPNConnectionProperties")))
{ {
@ -189,22 +189,22 @@ void nmwa_dbus_vpn_update_one_vpn_connection (NMWirelessApplet *applet, const ch
cb_data->applet = applet; cb_data->applet = applet;
cb_data->name = g_strdup (vpn_name); cb_data->name = g_strdup (vpn_name);
dbus_pending_call_set_notify (pcall, nmwa_dbus_vpn_properties_cb, cb_data, (DBusFreeFunction) free_vpn_props_cb_data); dbus_pending_call_set_notify (pcall, nma_dbus_vpn_properties_cb, cb_data, (DBusFreeFunction) free_vpn_props_cb_data);
} }
} }
} }
/* /*
* nmwa_dbus_vpn_update_vpn_connections_cb * nma_dbus_vpn_update_vpn_connections_cb
* *
* nmwa_dbus_vpn_update_vpn_connections callback. * nma_dbus_vpn_update_vpn_connections callback.
* *
*/ */
static void nmwa_dbus_vpn_update_vpn_connections_cb (DBusPendingCall *pcall, void *user_data) static void nma_dbus_vpn_update_vpn_connections_cb (DBusPendingCall *pcall, void *user_data)
{ {
DBusMessage * reply; DBusMessage * reply;
NMWirelessApplet * applet = (NMWirelessApplet *) user_data; NMApplet * applet = (NMApplet *) user_data;
char ** vpn_names; char ** vpn_names;
int num_vpn_names; int num_vpn_names;
@ -226,7 +226,7 @@ static void nmwa_dbus_vpn_update_vpn_connections_cb (DBusPendingCall *pcall, voi
dbus_error_init (&err); dbus_error_init (&err);
dbus_set_error_from_message (&err, reply); dbus_set_error_from_message (&err, reply);
nm_warning ("nmwa_dbus_vpn_update_vpn_connections_cb(): dbus returned an error.\n (%s) %s\n", err.name, err.message); nm_warning ("dbus returned an error.\n (%s) %s\n", err.name, err.message);
dbus_error_free (&err); dbus_error_free (&err);
dbus_message_unref (reply); dbus_message_unref (reply);
goto out; goto out;
@ -238,7 +238,7 @@ static void nmwa_dbus_vpn_update_vpn_connections_cb (DBusPendingCall *pcall, voi
/* For each connection, fire off a "getVPNConnectionProperties" call */ /* For each connection, fire off a "getVPNConnectionProperties" call */
for (item = vpn_names; *item; item++) for (item = vpn_names; *item; item++)
nmwa_dbus_vpn_update_one_vpn_connection (applet, *item); nma_dbus_vpn_update_one_vpn_connection (applet, *item);
dbus_free_string_array (vpn_names); dbus_free_string_array (vpn_names);
} }
@ -250,57 +250,57 @@ out:
/* /*
* nmwa_dbus_vpn_update_vpn_connections * nma_dbus_vpn_update_vpn_connections
* *
* Do a full update of vpn connections from NetworkManager * Do a full update of vpn connections from NetworkManager
* *
*/ */
void nmwa_dbus_vpn_update_vpn_connections (NMWirelessApplet *applet) void nma_dbus_vpn_update_vpn_connections (NMApplet *applet)
{ {
DBusMessage * message; DBusMessage * message;
DBusPendingCall * pcall; DBusPendingCall * pcall;
nmwa_free_vpn_connections (applet); nma_free_vpn_connections (applet);
nmwa_get_first_active_vpn_connection (applet); nma_get_first_active_vpn_connection (applet);
if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH_VPN, NM_DBUS_INTERFACE_VPN, "getVPNConnections"))) if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH_VPN, NM_DBUS_INTERFACE_VPN, "getVPNConnections")))
{ {
dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_connection_send_with_reply (applet->connection, message, &pcall, -1);
dbus_message_unref (message); dbus_message_unref (message);
if (pcall) if (pcall)
dbus_pending_call_set_notify (pcall, nmwa_dbus_vpn_update_vpn_connections_cb, applet, NULL); dbus_pending_call_set_notify (pcall, nma_dbus_vpn_update_vpn_connections_cb, applet, NULL);
} }
} }
/* /*
* nmwa_dbus_vpn_remove_one_vpn_connection * nma_dbus_vpn_remove_one_vpn_connection
* *
* Remove one vpn connection from the list * Remove one vpn connection from the list
* *
*/ */
void nmwa_dbus_vpn_remove_one_vpn_connection (NMWirelessApplet *applet, const char *vpn_name) void nma_dbus_vpn_remove_one_vpn_connection (NMApplet *applet, const char *vpn_name)
{ {
VPNConnection * vpn; VPNConnection * vpn;
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
g_return_if_fail (vpn_name != NULL); g_return_if_fail (vpn_name != NULL);
if ((vpn = nmwa_vpn_connection_find_by_name (applet->vpn_connections, vpn_name))) if ((vpn = nma_vpn_connection_find_by_name (applet->vpn_connections, vpn_name)))
{ {
applet->vpn_connections = g_slist_remove (applet->vpn_connections, vpn); applet->vpn_connections = g_slist_remove (applet->vpn_connections, vpn);
nmwa_vpn_connection_unref (vpn); nma_vpn_connection_unref (vpn);
} }
} }
static void nmwa_free_vpn_connections (NMWirelessApplet *applet) static void nma_free_vpn_connections (NMApplet *applet)
{ {
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
if (applet->vpn_connections) if (applet->vpn_connections)
{ {
g_slist_foreach (applet->vpn_connections, (GFunc) nmwa_vpn_connection_unref, NULL); g_slist_foreach (applet->vpn_connections, (GFunc) nma_vpn_connection_unref, NULL);
g_slist_free (applet->vpn_connections); g_slist_free (applet->vpn_connections);
applet->vpn_connections = NULL; applet->vpn_connections = NULL;
} }
@ -308,12 +308,12 @@ static void nmwa_free_vpn_connections (NMWirelessApplet *applet)
/* /*
* nmwa_dbus_vpn_activate_connection * nma_dbus_vpn_activate_connection
* *
* Tell NetworkManager to activate a particular VPN connection. * Tell NetworkManager to activate a particular VPN connection.
* *
*/ */
void nmwa_dbus_vpn_activate_connection (DBusConnection *connection, const char *name, GSList *passwords) void nma_dbus_vpn_activate_connection (DBusConnection *connection, const char *name, GSList *passwords)
{ {
DBusMessage *message; DBusMessage *message;
DBusMessageIter iter; DBusMessageIter iter;
@ -339,17 +339,17 @@ void nmwa_dbus_vpn_activate_connection (DBusConnection *connection, const char *
dbus_connection_send (connection, message, NULL); dbus_connection_send (connection, message, NULL);
} }
else else
nm_warning ("nmwa_dbus_activate_vpn_connection(): Couldn't allocate the dbus message"); nm_warning ("Couldn't allocate the dbus message");
} }
/* /*
* nmwa_dbus_deactivate_vpn_connection * nma_dbus_deactivate_vpn_connection
* *
* Tell NetworkManager to deactivate the currently active VPN connection. * Tell NetworkManager to deactivate the currently active VPN connection.
* *
*/ */
void nmwa_dbus_vpn_deactivate_connection (DBusConnection *connection) void nma_dbus_vpn_deactivate_connection (DBusConnection *connection)
{ {
DBusMessage *message; DBusMessage *message;
@ -361,7 +361,7 @@ void nmwa_dbus_vpn_deactivate_connection (DBusConnection *connection)
dbus_connection_send (connection, message, NULL); dbus_connection_send (connection, message, NULL);
} }
else else
nm_warning ("nmwa_dbus_activate_vpn_connection(): Couldn't allocate the dbus message"); nm_warning ("Couldn't allocate the dbus message");
} }

View file

@ -27,14 +27,14 @@
#include <dbus/dbus.h> #include <dbus/dbus.h>
#include "vpn-connection.h" #include "vpn-connection.h"
void nmwa_dbus_vpn_set_last_attempt_status (NMWirelessApplet *applet, const char *vpn_name, gboolean last_attempt_success); void nma_dbus_vpn_set_last_attempt_status (NMApplet *applet, const char *vpn_name, gboolean last_attempt_success);
void nmwa_dbus_vpn_update_one_vpn_connection (NMWirelessApplet *applet, const char *vpn_name); void nma_dbus_vpn_update_one_vpn_connection (NMApplet *applet, const char *vpn_name);
void nmwa_dbus_vpn_update_vpn_connections (NMWirelessApplet *applet); void nma_dbus_vpn_update_vpn_connections (NMApplet *applet);
void nmwa_dbus_vpn_remove_one_vpn_connection (NMWirelessApplet *applet, const char *vpn_name); void nma_dbus_vpn_remove_one_vpn_connection (NMApplet *applet, const char *vpn_name);
void nmwa_dbus_vpn_activate_connection (DBusConnection *connection, const char *name, GSList *passwords); void nma_dbus_vpn_activate_connection (DBusConnection *connection, const char *name, GSList *passwords);
void nmwa_dbus_vpn_deactivate_connection (DBusConnection *connection); void nma_dbus_vpn_deactivate_connection (DBusConnection *connection);
void nmwa_dbus_vpn_update_vpn_connection_stage (NMWirelessApplet *applet, const char *vpn_name, NMVPNActStage vpn_state); void nma_dbus_vpn_update_vpn_connection_stage (NMApplet *applet, const char *vpn_name, NMVPNActStage vpn_state);
#endif #endif

View file

@ -43,12 +43,12 @@
/* /*
* nmwa_dbus_filter * nma_dbus_filter
* *
*/ */
static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessage *message, void *user_data) static DBusHandlerResult nma_dbus_filter (DBusConnection *connection, DBusMessage *message, void *user_data)
{ {
NMWirelessApplet *applet = (NMWirelessApplet *)user_data; NMApplet *applet = (NMApplet *)user_data;
gboolean handled = TRUE; gboolean handled = TRUE;
const char * object_path; const char * object_path;
@ -89,16 +89,16 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
{ {
/* NetworkManager started up */ /* NetworkManager started up */
applet->nm_running = TRUE; applet->nm_running = TRUE;
nmwa_set_state (applet, NM_STATE_DISCONNECTED); nma_set_state (applet, NM_STATE_DISCONNECTED);
nmwa_dbus_update_nm_state (applet); nma_dbus_update_nm_state (applet);
nmwa_dbus_update_devices (applet); nma_dbus_update_devices (applet);
nmwa_dbus_update_dialup (applet); nma_dbus_update_dialup (applet);
nmwa_dbus_vpn_update_vpn_connections (applet); nma_dbus_vpn_update_vpn_connections (applet);
} }
else if (old_owner_good && !new_owner_good) else if (old_owner_good && !new_owner_good)
{ {
applet->nm_running = FALSE; applet->nm_running = FALSE;
nmwa_set_state (applet, NM_STATE_DISCONNECTED); nma_set_state (applet, NM_STATE_DISCONNECTED);
nmi_passphrase_dialog_destroy (applet); nmi_passphrase_dialog_destroy (applet);
} }
} }
@ -110,16 +110,16 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
if (dbus_message_get_args (message, NULL, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID))
{ {
NetworkDevice *act_dev = nmwa_get_first_active_device (applet->device_list); NetworkDevice *act_dev = nma_get_first_active_device (applet->device_list);
/* If we've switched to connecting, update the active device to ensure that we have /* If we've switched to connecting, update the active device to ensure that we have
* valid wireless network information for it. * valid wireless network information for it.
*/ */
if (state == NM_STATE_CONNECTING && act_dev && network_device_is_wireless (act_dev)) if (state == NM_STATE_CONNECTING && act_dev && network_device_is_wireless (act_dev))
{ {
nmwa_dbus_device_update_one_device (applet, network_device_get_nm_path (act_dev)); nma_dbus_device_update_one_device (applet, network_device_get_nm_path (act_dev));
} }
nmwa_set_state (applet, state); nma_set_state (applet, state);
} }
} }
else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceAdded") else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceAdded")
@ -130,7 +130,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
char *path = NULL; char *path = NULL;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID))
nmwa_dbus_device_update_one_device (applet, path); nma_dbus_device_update_one_device (applet, path);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive"))
{ {
@ -138,23 +138,23 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
char *essid = NULL; char *essid = NULL;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_STRING, &essid, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_STRING, &essid, DBUS_TYPE_INVALID))
nmwa_dbus_device_activated (applet, path, essid); nma_dbus_device_activated (applet, path, essid);
else if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) else if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID))
nmwa_dbus_device_activated (applet, path, NULL); nma_dbus_device_activated (applet, path, NULL);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive"))
{ {
char *path = NULL; char *path = NULL;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID))
nmwa_dbus_device_deactivated (applet, path); nma_dbus_device_deactivated (applet, path);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceRemoved")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceRemoved"))
{ {
char *path = NULL; char *path = NULL;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID))
nmwa_dbus_device_remove_one_device (applet, path); nma_dbus_device_remove_one_device (applet, path);
} }
else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionAdded") else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionAdded")
|| dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionUpdate")) /* VPN connection properties changed */ || dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionUpdate")) /* VPN connection properties changed */
@ -162,7 +162,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
char *name = NULL; char *name = NULL;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID))
nmwa_dbus_vpn_update_one_vpn_connection (applet, name); nma_dbus_vpn_update_one_vpn_connection (applet, name);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionStateChange")) /* Active VPN connection changed */ else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionStateChange")) /* Active VPN connection changed */
{ {
@ -173,7 +173,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_UINT32, &vpn_stage_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_stage = (NMVPNActStage) vpn_stage_int; vpn_stage = (NMVPNActStage) vpn_stage_int;
nmwa_dbus_vpn_update_vpn_connection_stage (applet, name, vpn_stage); nma_dbus_vpn_update_vpn_connection_stage (applet, name, vpn_stage);
} }
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionRemoved")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, "VPNConnectionRemoved"))
@ -181,7 +181,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
char *name = NULL; char *name = NULL;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID))
nmwa_dbus_vpn_remove_one_vpn_connection (applet, name); nma_dbus_vpn_remove_one_vpn_connection (applet, name);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "WirelessNetworkAppeared")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "WirelessNetworkAppeared"))
{ {
@ -189,7 +189,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
char *net_path = NULL; char *net_path = NULL;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &dev_path, DBUS_TYPE_OBJECT_PATH, &net_path, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &dev_path, DBUS_TYPE_OBJECT_PATH, &net_path, DBUS_TYPE_INVALID))
nmwa_dbus_device_update_one_network (applet, dev_path, net_path, NULL); nma_dbus_device_update_one_network (applet, dev_path, net_path, NULL);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "WirelessNetworkDisappeared")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "WirelessNetworkDisappeared"))
{ {
@ -197,7 +197,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
char *net_path = NULL; char *net_path = NULL;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &dev_path, DBUS_TYPE_OBJECT_PATH, &net_path, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &dev_path, DBUS_TYPE_OBJECT_PATH, &net_path, DBUS_TYPE_INVALID))
nmwa_dbus_device_remove_one_network (applet, dev_path, net_path); nma_dbus_device_remove_one_network (applet, dev_path, net_path);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "WirelessNetworkStrengthChanged")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "WirelessNetworkStrengthChanged"))
{ {
@ -206,14 +206,14 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
int strength = -1; int strength = -1;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &dev_path, DBUS_TYPE_OBJECT_PATH, &net_path, DBUS_TYPE_INT32, &strength, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &dev_path, DBUS_TYPE_OBJECT_PATH, &net_path, DBUS_TYPE_INT32, &strength, DBUS_TYPE_INVALID))
nmwa_dbus_update_strength (applet, dev_path, net_path, strength); nma_dbus_update_strength (applet, dev_path, net_path, strength);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceStrengthChanged")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceStrengthChanged"))
{ {
char *dev_path = NULL; char *dev_path = NULL;
int strength = -1; int strength = -1;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &dev_path, DBUS_TYPE_INT32, &strength, DBUS_TYPE_INVALID)) if (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &dev_path, DBUS_TYPE_INT32, &strength, DBUS_TYPE_INVALID))
nmwa_dbus_update_strength (applet, dev_path, NULL, strength); nma_dbus_update_strength (applet, dev_path, NULL, strength);
} }
else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, NM_DBUS_VPN_SIGNAL_LOGIN_FAILED) else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, NM_DBUS_VPN_SIGNAL_LOGIN_FAILED)
|| dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, NM_DBUS_VPN_SIGNAL_LAUNCH_FAILED) || dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, NM_DBUS_VPN_SIGNAL_LAUNCH_FAILED)
@ -225,9 +225,9 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
char *error_msg; char *error_msg;
if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &vpn_name, DBUS_TYPE_STRING, &error_msg, DBUS_TYPE_INVALID)) { if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &vpn_name, DBUS_TYPE_STRING, &error_msg, DBUS_TYPE_INVALID)) {
nmwa_show_vpn_failure_alert (applet, member, vpn_name, error_msg); nma_show_vpn_failure_alert (applet, member, vpn_name, error_msg);
/* clear the 'last_attempt_success' key in gconf so we prompt for password next time */ /* clear the 'last_attempt_success' key in gconf so we prompt for password next time */
nmwa_dbus_vpn_set_last_attempt_status (applet, vpn_name, FALSE); nma_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)) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE_VPN, NM_DBUS_VPN_SIGNAL_LOGIN_BANNER))
@ -239,11 +239,11 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
{ {
char *stripped = g_strstrip (g_strdup (banner)); char *stripped = g_strstrip (g_strdup (banner));
nmwa_show_vpn_login_banner (applet, vpn_name, stripped); nma_show_vpn_login_banner (applet, vpn_name, stripped);
g_free (stripped); g_free (stripped);
/* set the 'last_attempt_success' key in gconf so we DON'T prompt for password next time */ /* 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); nma_dbus_vpn_set_last_attempt_status (applet, vpn_name, TRUE);
} }
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivationFailed")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivationFailed"))
@ -257,11 +257,11 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
if (dev && net) if (dev && net)
{ {
char *string = g_strdup_printf (_("Connection to the wireless network '%s' failed."), net); char *string = g_strdup_printf (_("Connection to the wireless network '%s' failed."), net);
nmwa_schedule_warning_dialog (applet, string); nma_schedule_warning_dialog (applet, string);
g_free (string); g_free (string);
} }
else if (dev) else if (dev)
nmwa_schedule_warning_dialog (applet, _("Connection to the wired network failed.")); nma_schedule_warning_dialog (applet, _("Connection to the wired network failed."));
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivationStage")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivationStage"))
{ {
@ -272,7 +272,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
{ {
NetworkDevice *dev; NetworkDevice *dev;
if ((dev = nmwa_get_device_for_nm_path (applet->device_list, dev_path))) if ((dev = nma_get_device_for_nm_path (applet->device_list, dev_path)))
network_device_set_act_stage (dev, stage); network_device_set_act_stage (dev, stage);
} }
} }
@ -284,12 +284,12 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
/* /*
* nmwa_dbus_nm_is_running * nma_dbus_nm_is_running
* *
* Ask dbus whether or not NetworkManager is running * Ask dbus whether or not NetworkManager is running
* *
*/ */
static gboolean nmwa_dbus_nm_is_running (DBusConnection *connection) static gboolean nma_dbus_nm_is_running (DBusConnection *connection)
{ {
DBusError error; DBusError error;
gboolean exists; gboolean exists;
@ -305,12 +305,12 @@ static gboolean nmwa_dbus_nm_is_running (DBusConnection *connection)
/* /*
* nmwa_dbus_init * nma_dbus_init
* *
* Initialize a connection to NetworkManager if we can get one * Initialize a connection to NetworkManager if we can get one
* *
*/ */
static DBusConnection * nmwa_dbus_init (NMWirelessApplet *applet) static DBusConnection * nma_dbus_init (NMApplet *applet)
{ {
DBusConnection * connection = NULL; DBusConnection * connection = NULL;
DBusError error; DBusError error;
@ -332,7 +332,7 @@ static DBusConnection * nmwa_dbus_init (NMWirelessApplet *applet)
acquisition = dbus_bus_request_name (connection, NMI_DBUS_SERVICE, DBUS_NAME_FLAG_REPLACE_EXISTING, &error); acquisition = dbus_bus_request_name (connection, NMI_DBUS_SERVICE, DBUS_NAME_FLAG_REPLACE_EXISTING, &error);
if (dbus_error_is_set (&error)) if (dbus_error_is_set (&error))
{ {
nm_warning ("nmwa_dbus_init() could not acquire its service. dbus_bus_acquire_service() says: '%s'", error.message); nm_warning ("nma_dbus_init() could not acquire its service. dbus_bus_acquire_service() says: '%s'", error.message);
dbus_error_free (&error); dbus_error_free (&error);
return NULL; return NULL;
} }
@ -341,11 +341,11 @@ static DBusConnection * nmwa_dbus_init (NMWirelessApplet *applet)
if (!dbus_connection_register_object_path (connection, NMI_DBUS_PATH, &vtable, applet)) if (!dbus_connection_register_object_path (connection, NMI_DBUS_PATH, &vtable, applet))
{ {
nm_warning ("nmwa_dbus_init() could not register a handler for NetworkManagerInfo. Not enough memory?"); nm_warning ("nma_dbus_init() could not register a handler for NetworkManagerInfo. Not enough memory?");
return NULL; return NULL;
} }
if (!dbus_connection_add_filter (connection, nmwa_dbus_filter, applet, NULL)) if (!dbus_connection_add_filter (connection, nma_dbus_filter, applet, NULL))
return NULL; return NULL;
dbus_connection_set_exit_on_disconnect (connection, FALSE); dbus_connection_set_exit_on_disconnect (connection, FALSE);
@ -382,27 +382,27 @@ static DBusConnection * nmwa_dbus_init (NMWirelessApplet *applet)
/* /*
* nmwa_dbus_connection_watcher * nma_dbus_connection_watcher
* *
* Try to reconnect if we ever get disconnected from the bus * Try to reconnect if we ever get disconnected from the bus
* *
*/ */
static gboolean nmwa_dbus_connection_watcher (gpointer user_data) static gboolean nma_dbus_connection_watcher (gpointer user_data)
{ {
NMWirelessApplet *applet = (NMWirelessApplet *)user_data; NMApplet *applet = (NMApplet *)user_data;
g_return_val_if_fail (applet != NULL, TRUE); g_return_val_if_fail (applet != NULL, TRUE);
if (!applet->connection) if (!applet->connection)
{ {
if ((applet->connection = nmwa_dbus_init (applet))) if ((applet->connection = nma_dbus_init (applet)))
{ {
applet->nm_running = nmwa_dbus_nm_is_running (applet->connection); applet->nm_running = nma_dbus_nm_is_running (applet->connection);
nmwa_set_state (applet, NM_STATE_DISCONNECTED); nma_set_state (applet, NM_STATE_DISCONNECTED);
nmwa_dbus_update_nm_state (applet); nma_dbus_update_nm_state (applet);
nmwa_dbus_update_devices (applet); nma_dbus_update_devices (applet);
nmwa_dbus_update_dialup (applet); nma_dbus_update_dialup (applet);
nmwa_dbus_vpn_update_vpn_connections (applet); nma_dbus_vpn_update_vpn_connections (applet);
} }
} }
@ -411,13 +411,13 @@ static gboolean nmwa_dbus_connection_watcher (gpointer user_data)
/* /*
* nmwa_dbus_worker * nma_dbus_worker
* *
* Thread worker function that periodically grabs the NetworkManager state * Thread worker function that periodically grabs the NetworkManager state
* and updates our local applet state to reflect that. * and updates our local applet state to reflect that.
* *
*/ */
void nmwa_dbus_init_helper (NMWirelessApplet *applet) void nma_dbus_init_helper (NMApplet *applet)
{ {
GSource * timeout_source; GSource * timeout_source;
@ -425,20 +425,20 @@ void nmwa_dbus_init_helper (NMWirelessApplet *applet)
dbus_g_thread_init (); dbus_g_thread_init ();
applet->connection = nmwa_dbus_init (applet); applet->connection = nma_dbus_init (applet);
applet->nmi_methods = nmi_dbus_nmi_methods_setup (); applet->nmi_methods = nmi_dbus_nmi_methods_setup ();
timeout_source = g_timeout_source_new (2000); timeout_source = g_timeout_source_new (2000);
g_source_set_callback (timeout_source, nmwa_dbus_connection_watcher, applet, NULL); g_source_set_callback (timeout_source, nma_dbus_connection_watcher, applet, NULL);
g_source_attach (timeout_source, NULL); g_source_attach (timeout_source, NULL);
if (applet->connection && nmwa_dbus_nm_is_running (applet->connection)) if (applet->connection && nma_dbus_nm_is_running (applet->connection))
{ {
applet->nm_running = TRUE; applet->nm_running = TRUE;
nmwa_dbus_update_nm_state (applet); nma_dbus_update_nm_state (applet);
nmwa_dbus_update_devices (applet); nma_dbus_update_devices (applet);
nmwa_dbus_update_dialup (applet); nma_dbus_update_dialup (applet);
nmwa_dbus_vpn_update_vpn_connections (applet); nma_dbus_vpn_update_vpn_connections (applet);
} }
g_source_unref (timeout_source); g_source_unref (timeout_source);

View file

@ -42,10 +42,10 @@ static inline gboolean message_is_error (DBusMessage *msg)
return (dbus_message_get_type (msg) == DBUS_MESSAGE_TYPE_ERROR); return (dbus_message_get_type (msg) == DBUS_MESSAGE_TYPE_ERROR);
} }
void nmwa_dbus_init_helper (NMWirelessApplet *applet); void nma_dbus_init_helper (NMApplet *applet);
void nmwa_dbus_enable_wireless (NMWirelessApplet *applet, gboolean enabled); void nma_dbus_enable_wireless (NMApplet *applet, gboolean enabled);
void nmwa_dbus_enable_networking (NMWirelessApplet *applet, gboolean enabled); void nma_dbus_enable_networking (NMApplet *applet, gboolean enabled);
void nmwa_free_gui_data_model (NMWirelessApplet *applet); void nma_free_gui_data_model (NMApplet *applet);
void nmwa_free_dbus_data_model (NMWirelessApplet *applet); void nma_free_dbus_data_model (NMApplet *applet);
#endif #endif

View file

@ -23,7 +23,7 @@
#include "applet-notifications.h" #include "applet-notifications.h"
void void
nmwa_send_event_notification (NMWirelessApplet *applet, nma_send_event_notification (NMApplet *applet,
NotifyUrgency urgency, NotifyUrgency urgency,
const char *summary, const char *summary,
const char *message, const char *message,

View file

@ -25,7 +25,7 @@
#include "applet.h" #include "applet.h"
void void
nmwa_send_event_notification (NMWirelessApplet *applet, nma_send_event_notification (NMApplet *applet,
NotifyUrgency urgency, NotifyUrgency urgency,
const char *summary, const char *summary,
const char *message, const char *message,

File diff suppressed because it is too large Load diff

View file

@ -46,24 +46,17 @@
typedef struct VPNConnection VPNConnection; typedef struct VPNConnection VPNConnection;
enum NMWAEncryptionKeyTypes #define NM_TYPE_APPLET (nma_get_type())
{ #define NM_APPLET(object) (G_TYPE_CHECK_INSTANCE_CAST((object), NM_TYPE_APPLET, NMApplet))
KEY_TYPE_128_BIT_PASSPHRASE = 0, #define NM_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_APPLET, NMAppletClass))
KEY_TYPE_ASCII_KEY = 1, #define NM_IS_APPLET(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), NM_TYPE_APPLET))
KEY_TYPE_HEX_KEY = 2 #define NM_IS_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_APPLET))
}; #define NM_APPLET_GET_CLASS(object)(G_TYPE_INSTANCE_GET_CLASS((object), NM_TYPE_APPLET, NMAppletClass))
#define NM_TYPE_WIRELESS_APPLET (nmwa_get_type())
#define NM_WIRELESS_APPLET(object) (G_TYPE_CHECK_INSTANCE_CAST((object), NM_TYPE_WIRELESS_APPLET, NMWirelessApplet))
#define NM_WIRELESS_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_WIRELESS_APPLET, NMWirelessAppletClass))
#define NM_IS_WIRELESS_APPLET(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), NM_TYPE_WIRELESS_APPLET))
#define NM_IS_WIRELESS_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_WIRELESS_APPLET))
#define NM_WIRELESS_APPLET_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), NM_TYPE_WIRELESS_APPLET, NMWirelessAppletClass))
typedef struct typedef struct
{ {
EggTrayIconClass parent_class; EggTrayIconClass parent_class;
} NMWirelessAppletClass; } NMAppletClass;
/* /*
* Applet instance data * Applet instance data
@ -126,28 +119,28 @@ typedef struct
GtkWidget * passphrase_dialog; GtkWidget * passphrase_dialog;
GladeXML * info_dialog_xml; GladeXML * info_dialog_xml;
} NMWirelessApplet; } NMApplet;
typedef struct typedef struct
{ {
NMWirelessApplet * applet; NMApplet * applet;
NetworkDevice * dev; NetworkDevice * dev;
GladeXML * xml; GladeXML * xml;
} DriverNotifyCBData; } DriverNotifyCBData;
NetworkDevice * nmwa_get_device_for_nm_path (GSList *dev_list, const char *nm_dev); NetworkDevice * nma_get_device_for_nm_path (GSList *dev_list, const char *nm_dev);
NMWirelessApplet * nmwa_new (void); NMApplet * nma_new (void);
void nmwa_schedule_warning_dialog (NMWirelessApplet *applet, const char *msg); void nma_schedule_warning_dialog (NMApplet *applet, const char *msg);
gboolean nmwa_driver_notify (gpointer user_data); gboolean nma_driver_notify (gpointer user_data);
void nmwa_show_vpn_failure_alert (NMWirelessApplet *applet, const char *member, const char *vpn_name, const char *error_msg); void nma_show_vpn_failure_alert (NMApplet *applet, const char *member, const char *vpn_name, const char *error_msg);
void nmwa_show_vpn_login_banner (NMWirelessApplet *applet, const char *vpn_name, const char *banner); void nma_show_vpn_login_banner (NMApplet *applet, const char *vpn_name, const char *banner);
NetworkDevice * nmwa_get_first_active_device (GSList *dev_list); NetworkDevice * nma_get_first_active_device (GSList *dev_list);
VPNConnection * nmwa_get_first_active_vpn_connection (NMWirelessApplet *applet); VPNConnection * nma_get_first_active_vpn_connection (NMApplet *applet);
void nmwa_enable_wireless_set_active (NMWirelessApplet *applet); void nma_enable_wireless_set_active (NMApplet *applet);
void nmwa_set_state (NMWirelessApplet *applet, NMState state); void nma_set_state (NMApplet *applet, NMState state);
int nm_null_safe_strcmp (const char *s1, const char *s2); int nm_null_safe_strcmp (const char *s1, const char *s2);

View file

@ -44,8 +44,8 @@ static gboolean session_save (GnomeClient *client, gpointer client_data)
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
NMWirelessApplet * nmwa; NMApplet * nma;
GnomeClient * client = NULL; GnomeClient * client = NULL;
gnome_program_init ("nm-applet", VERSION, LIBGNOMEUI_MODULE, gnome_program_init ("nm-applet", VERSION, LIBGNOMEUI_MODULE,
argc, argv, argc, argv,
@ -61,9 +61,9 @@ int main (int argc, char *argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE); textdomain (GETTEXT_PACKAGE);
if ((nmwa = nmwa_new ())) if ((nma = nma_new ()))
{ {
gtk_widget_show_all (GTK_WIDGET (nmwa)); gtk_widget_show_all (GTK_WIDGET (nma));
gtk_main (); gtk_main ();
} }

View file

@ -83,13 +83,13 @@ static void update_button_cb (GtkWidget *unused, GtkDialog *dialog)
} }
/* /*
* nmwa_ond_device_combo_changed * nma_ond_device_combo_changed
* *
* Replace current wireless security information with options * Replace current wireless security information with options
* suitable for the current network device. * suitable for the current network device.
* *
*/ */
static void nmwa_ond_device_combo_changed (GtkWidget *dev_combo, gpointer user_data) static void nma_ond_device_combo_changed (GtkWidget *dev_combo, gpointer user_data)
{ {
GtkDialog * dialog = (GtkDialog *) user_data; GtkDialog * dialog = (GtkDialog *) user_data;
WirelessSecurityManager * wsm; WirelessSecurityManager * wsm;
@ -141,13 +141,13 @@ static void nmwa_ond_device_combo_changed (GtkWidget *dev_combo, gpointer user_d
/* /*
* nmwa_ond_security_combo_changed * nma_ond_security_combo_changed
* *
* Replace the current wireless security widgets with new ones * Replace the current wireless security widgets with new ones
* according to what the user chose. * according to what the user chose.
* *
*/ */
static void nmwa_ond_security_combo_changed (GtkWidget *combo, gpointer user_data) static void nma_ond_security_combo_changed (GtkWidget *combo, gpointer user_data)
{ {
GtkDialog * dialog = (GtkDialog *) user_data; GtkDialog * dialog = (GtkDialog *) user_data;
WirelessSecurityManager * wsm; WirelessSecurityManager * wsm;
@ -182,7 +182,7 @@ static void nmwa_ond_security_combo_changed (GtkWidget *combo, gpointer user_dat
update_button_cb (NULL, dialog); update_button_cb (NULL, dialog);
} }
static GtkTreeModel * create_wireless_adapter_model (NMWirelessApplet *applet) static GtkTreeModel * create_wireless_adapter_model (NMApplet *applet)
{ {
GtkListStore * model; GtkListStore * model;
GSList * elt; GSList * elt;
@ -256,7 +256,7 @@ static const char * get_host_name (void)
static GtkDialog *nmwa_ond_init (GladeXML *xml, NMWirelessApplet *applet, gboolean create_network) static GtkDialog *nma_ond_init (GladeXML *xml, NMApplet *applet, gboolean create_network)
{ {
GtkDialog * dialog = NULL; GtkDialog * dialog = NULL;
GtkWidget * network_name_entry; GtkWidget * network_name_entry;
@ -314,7 +314,7 @@ static GtkDialog *nmwa_ond_init (GladeXML *xml, NMWirelessApplet *applet, gboole
combo = glade_xml_get_widget (xml, "wireless_adapter_combo"); combo = glade_xml_get_widget (xml, "wireless_adapter_combo");
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), model); gtk_combo_box_set_model (GTK_COMBO_BOX (combo), model);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
g_signal_connect (G_OBJECT (combo), "changed", GTK_SIGNAL_FUNC (nmwa_ond_device_combo_changed), dialog); g_signal_connect (G_OBJECT (combo), "changed", GTK_SIGNAL_FUNC (nma_ond_device_combo_changed), dialog);
if (n_wireless_interfaces == 1) if (n_wireless_interfaces == 1)
{ {
@ -338,8 +338,8 @@ static GtkDialog *nmwa_ond_init (GladeXML *xml, NMWirelessApplet *applet, gboole
security_combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "security_combo")); security_combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "security_combo"));
wsm_update_combo (wsm, security_combo); wsm_update_combo (wsm, security_combo);
g_signal_connect (G_OBJECT (security_combo), "changed", GTK_SIGNAL_FUNC (nmwa_ond_security_combo_changed), dialog); g_signal_connect (G_OBJECT (security_combo), "changed", GTK_SIGNAL_FUNC (nma_ond_security_combo_changed), dialog);
nmwa_ond_security_combo_changed (GTK_WIDGET (security_combo), dialog); nma_ond_security_combo_changed (GTK_WIDGET (security_combo), dialog);
if (create_network) if (create_network)
{ {
@ -378,17 +378,17 @@ static GtkDialog *nmwa_ond_init (GladeXML *xml, NMWirelessApplet *applet, gboole
} }
static void nmwa_ond_response_cb (GtkDialog *dialog, gint response, gpointer data) static void nma_ond_response_cb (GtkDialog *dialog, gint response, gpointer data)
{ {
GladeXML * xml; GladeXML * xml;
NMWirelessApplet * applet; NMApplet * applet;
gboolean create_network; gboolean create_network;
GtkTreeModel * model; GtkTreeModel * model;
GtkComboBox * combo; GtkComboBox * combo;
WirelessSecurityManager *wsm; WirelessSecurityManager *wsm;
xml = (GladeXML *) g_object_get_data (G_OBJECT (dialog), "glade-xml"); xml = (GladeXML *) g_object_get_data (G_OBJECT (dialog), "glade-xml");
applet = (NMWirelessApplet *) g_object_get_data (G_OBJECT (dialog), "applet"); applet = (NMApplet *) g_object_get_data (G_OBJECT (dialog), "applet");
create_network = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "create-network")); create_network = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "create-network"));
combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "wireless_adapter_combo")); combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "wireless_adapter_combo"));
@ -420,9 +420,9 @@ static void nmwa_ond_response_cb (GtkDialog *dialog, gint response, gpointer dat
opt = wsm_get_option_for_active (wsm, security_combo); opt = wsm_get_option_for_active (wsm, security_combo);
if (create_network) if (create_network)
nmwa_dbus_create_network (applet->connection, dev, essid, opt); nma_dbus_create_network (applet->connection, dev, essid, opt);
else else
nmwa_dbus_set_device (applet->connection, dev, essid, opt); nma_dbus_set_device (applet->connection, dev, essid, opt);
} }
} }
@ -440,7 +440,7 @@ static void nmwa_ond_response_cb (GtkDialog *dialog, gint response, gpointer dat
} }
void nmwa_other_network_dialog_run (NMWirelessApplet *applet, gboolean create_network) void nma_other_network_dialog_run (NMApplet *applet, gboolean create_network)
{ {
GtkWidget * dialog; GtkWidget * dialog;
GladeXML * xml; GladeXML * xml;
@ -450,13 +450,13 @@ void nmwa_other_network_dialog_run (NMWirelessApplet *applet, gboolean create_ne
if (!(xml = glade_xml_new (applet->glade_file, "other_network_dialog", NULL))) if (!(xml = glade_xml_new (applet->glade_file, "other_network_dialog", NULL)))
{ {
nmwa_schedule_warning_dialog (applet, _("The NetworkManager Applet could not find some required resources (the glade file was not found).")); nma_schedule_warning_dialog (applet, _("The NetworkManager Applet could not find some required resources (the glade file was not found)."));
return; return;
} }
if (!(dialog = GTK_WIDGET (nmwa_ond_init (xml, applet, create_network)))) if (!(dialog = GTK_WIDGET (nma_ond_init (xml, applet, create_network))))
return; return;
g_signal_connect (dialog, "response", G_CALLBACK (nmwa_ond_response_cb), NULL); g_signal_connect (dialog, "response", G_CALLBACK (nma_ond_response_cb), NULL);
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS);
gtk_widget_realize (dialog); gtk_widget_realize (dialog);

View file

@ -25,6 +25,6 @@
#ifndef OTHER_NETWORK_DIALOG_H #ifndef OTHER_NETWORK_DIALOG_H
#define OTHER_NETWORK_DIALOG_H #define OTHER_NETWORK_DIALOG_H
void nmwa_other_network_dialog_run (NMWirelessApplet *applet, gboolean create_network); void nma_other_network_dialog_run (NMApplet *applet, gboolean create_network);
#endif #endif

View file

@ -127,7 +127,7 @@ nmi_passphrase_dialog_response_received (GtkWidget *dialog,
gint response, gint response,
gpointer user_data) gpointer user_data)
{ {
NMWirelessApplet * applet; NMApplet * applet;
GladeXML * xml; GladeXML * xml;
GtkComboBox * security_combo; GtkComboBox * security_combo;
DBusMessage * message; DBusMessage * message;
@ -139,7 +139,7 @@ nmi_passphrase_dialog_response_received (GtkWidget *dialog,
message = (DBusMessage *) g_object_get_data (G_OBJECT (dialog), "dbus-message"); message = (DBusMessage *) g_object_get_data (G_OBJECT (dialog), "dbus-message");
g_assert (message); g_assert (message);
applet = (NMWirelessApplet *) g_object_get_data (G_OBJECT (dialog), "applet"); applet = (NMApplet *) g_object_get_data (G_OBJECT (dialog), "applet");
g_assert (applet); g_assert (applet);
if (response != GTK_RESPONSE_OK) if (response != GTK_RESPONSE_OK)
@ -180,7 +180,7 @@ out:
* to the given UID. * to the given UID.
*/ */
GtkWidget * GtkWidget *
nmi_passphrase_dialog_new (NMWirelessApplet *applet, nmi_passphrase_dialog_new (NMApplet *applet,
guint32 uid, guint32 uid,
NetworkDevice *dev, NetworkDevice *dev,
WirelessNetwork *net, WirelessNetwork *net,
@ -224,7 +224,7 @@ nmi_passphrase_dialog_new (NMWirelessApplet *applet,
if (!(xml = glade_xml_new (applet->glade_file, "passphrase_dialog", NULL))) if (!(xml = glade_xml_new (applet->glade_file, "passphrase_dialog", NULL)))
{ {
nmwa_schedule_warning_dialog (applet, _("The NetworkManager Applet could not find some required resources (the glade file was not found).")); nma_schedule_warning_dialog (applet, _("The NetworkManager Applet could not find some required resources (the glade file was not found)."));
wsm_free (wsm); wsm_free (wsm);
return NULL; return NULL;
} }
@ -280,7 +280,7 @@ nmi_passphrase_dialog_new (NMWirelessApplet *applet,
* Dispose of the passphrase dialog and its data * Dispose of the passphrase dialog and its data
* *
*/ */
void nmi_passphrase_dialog_destroy (NMWirelessApplet *applet) void nmi_passphrase_dialog_destroy (NMApplet *applet)
{ {
char * data; char * data;
GtkWidget * dialog; GtkWidget * dialog;

View file

@ -26,13 +26,13 @@
#include "nm-device.h" #include "nm-device.h"
#include "wireless-network.h" #include "wireless-network.h"
GtkWidget * nmi_passphrase_dialog_new (NMWirelessApplet *applet, GtkWidget * nmi_passphrase_dialog_new (NMApplet *applet,
guint32 uid, guint32 uid,
NetworkDevice *dev, NetworkDevice *dev,
WirelessNetwork *net, WirelessNetwork *net,
DBusMessage *message); DBusMessage *message);
void nmi_passphrase_dialog_destroy (NMWirelessApplet *applet); void nmi_passphrase_dialog_destroy (NMApplet *applet);
#endif /* PASSPHRASE_DIALOG_H */ #endif /* PASSPHRASE_DIALOG_H */

View file

@ -32,7 +32,7 @@ struct VPNConnection
}; };
VPNConnection *nmwa_vpn_connection_new (const char *name) VPNConnection *nma_vpn_connection_new (const char *name)
{ {
VPNConnection *vpn; VPNConnection *vpn;
@ -46,7 +46,7 @@ VPNConnection *nmwa_vpn_connection_new (const char *name)
} }
VPNConnection *nmwa_vpn_connection_copy (VPNConnection *src_vpn) VPNConnection *nma_vpn_connection_copy (VPNConnection *src_vpn)
{ {
VPNConnection *dst_vpn; VPNConnection *dst_vpn;
@ -62,7 +62,7 @@ VPNConnection *nmwa_vpn_connection_copy (VPNConnection *src_vpn)
} }
void nmwa_vpn_connection_ref (VPNConnection *vpn) void nma_vpn_connection_ref (VPNConnection *vpn)
{ {
g_return_if_fail (vpn != NULL); g_return_if_fail (vpn != NULL);
@ -70,7 +70,7 @@ void nmwa_vpn_connection_ref (VPNConnection *vpn)
} }
void nmwa_vpn_connection_unref (VPNConnection *vpn) void nma_vpn_connection_unref (VPNConnection *vpn)
{ {
g_return_if_fail (vpn != NULL); g_return_if_fail (vpn != NULL);
@ -85,14 +85,14 @@ void nmwa_vpn_connection_unref (VPNConnection *vpn)
} }
const char *nmwa_vpn_connection_get_name (VPNConnection *vpn) const char *nma_vpn_connection_get_name (VPNConnection *vpn)
{ {
g_return_val_if_fail (vpn != NULL, NULL); g_return_val_if_fail (vpn != NULL, NULL);
return vpn->name; return vpn->name;
} }
const char *nmwa_vpn_connection_get_service (VPNConnection *vpn) const char *nma_vpn_connection_get_service (VPNConnection *vpn)
{ {
g_return_val_if_fail (vpn != NULL, NULL); g_return_val_if_fail (vpn != NULL, NULL);
@ -100,7 +100,7 @@ const char *nmwa_vpn_connection_get_service (VPNConnection *vpn)
} }
void nmwa_vpn_connection_set_service (VPNConnection *vpn, const char *service) void nma_vpn_connection_set_service (VPNConnection *vpn, const char *service)
{ {
g_return_if_fail (vpn != NULL); g_return_if_fail (vpn != NULL);
g_return_if_fail (service != NULL); g_return_if_fail (service != NULL);
@ -113,14 +113,14 @@ void nmwa_vpn_connection_set_service (VPNConnection *vpn, const char *service)
static int is_same_name (VPNConnection *vpn, const char *name) static int is_same_name (VPNConnection *vpn, const char *name)
{ {
if (!vpn || !name || !nmwa_vpn_connection_get_name (vpn)) if (!vpn || !name || !nma_vpn_connection_get_name (vpn))
return -1; return -1;
return strcmp (nmwa_vpn_connection_get_name (vpn), name); return strcmp (nma_vpn_connection_get_name (vpn), name);
} }
VPNConnection *nmwa_vpn_connection_find_by_name (GSList *list, const char *name) VPNConnection *nma_vpn_connection_find_by_name (GSList *list, const char *name)
{ {
GSList *elt; GSList *elt;
VPNConnection *vpn = NULL; VPNConnection *vpn = NULL;
@ -136,27 +136,27 @@ VPNConnection *nmwa_vpn_connection_find_by_name (GSList *list, const char *name)
return vpn; return vpn;
} }
NMVPNActStage nmwa_vpn_connection_get_stage (VPNConnection *vpn) NMVPNActStage nma_vpn_connection_get_stage (VPNConnection *vpn)
{ {
g_return_val_if_fail (vpn != NULL, NM_VPN_ACT_STAGE_UNKNOWN); g_return_val_if_fail (vpn != NULL, NM_VPN_ACT_STAGE_UNKNOWN);
return vpn->stage; return vpn->stage;
} }
void nmwa_vpn_connection_set_stage (VPNConnection *vpn, NMVPNActStage stage) void nma_vpn_connection_set_stage (VPNConnection *vpn, NMVPNActStage stage)
{ {
g_return_if_fail (vpn != NULL); g_return_if_fail (vpn != NULL);
vpn->stage = stage; vpn->stage = stage;
} }
gboolean nmwa_vpn_connection_is_activating (VPNConnection *vpn) gboolean nma_vpn_connection_is_activating (VPNConnection *vpn)
{ {
NMVPNActStage stage; NMVPNActStage stage;
g_return_val_if_fail (vpn != NULL, FALSE); g_return_val_if_fail (vpn != NULL, FALSE);
stage = nmwa_vpn_connection_get_stage (vpn); stage = nma_vpn_connection_get_stage (vpn);
if (stage == NM_VPN_ACT_STAGE_PREPARE || if (stage == NM_VPN_ACT_STAGE_PREPARE ||
stage == NM_VPN_ACT_STAGE_CONNECT || stage == NM_VPN_ACT_STAGE_CONNECT ||
stage == NM_VPN_ACT_STAGE_IP_CONFIG_GET) stage == NM_VPN_ACT_STAGE_IP_CONFIG_GET)

View file

@ -25,21 +25,21 @@
#include "applet.h" #include "applet.h"
#include "NetworkManagerVPN.h" #include "NetworkManagerVPN.h"
VPNConnection * nmwa_vpn_connection_new (const char *name); VPNConnection * nma_vpn_connection_new (const char *name);
VPNConnection * nmwa_vpn_connection_copy (VPNConnection *vpn); VPNConnection * nma_vpn_connection_copy (VPNConnection *vpn);
void nmwa_vpn_connection_ref (VPNConnection *vpn); void nma_vpn_connection_ref (VPNConnection *vpn);
void nmwa_vpn_connection_unref (VPNConnection *vpn); void nma_vpn_connection_unref (VPNConnection *vpn);
const char * nmwa_vpn_connection_get_name (VPNConnection *vpn); const char * nma_vpn_connection_get_name (VPNConnection *vpn);
const char * nmwa_vpn_connection_get_service (VPNConnection *vpn); const char * nma_vpn_connection_get_service (VPNConnection *vpn);
void nmwa_vpn_connection_set_service (VPNConnection *vpn, const char *service); void nma_vpn_connection_set_service (VPNConnection *vpn, const char *service);
NMVPNActStage nmwa_vpn_connection_get_stage (VPNConnection *vpn); NMVPNActStage nma_vpn_connection_get_stage (VPNConnection *vpn);
void nmwa_vpn_connection_set_stage (VPNConnection *vpn, NMVPNActStage stage); void nma_vpn_connection_set_stage (VPNConnection *vpn, NMVPNActStage stage);
gboolean nmwa_vpn_connection_is_activating (VPNConnection *vpn); gboolean nma_vpn_connection_is_activating (VPNConnection *vpn);
VPNConnection * nmwa_vpn_connection_find_by_name (GSList *list, const char *name); VPNConnection * nma_vpn_connection_find_by_name (GSList *list, const char *name);
#endif #endif

View file

@ -86,7 +86,7 @@ out:
} }
GSList * GSList *
nmwa_vpn_request_password (NMWirelessApplet *applet, const char *name, const char *service, gboolean retry) nma_vpn_request_password (NMApplet *applet, const char *name, const char *service, gboolean retry)
{ {
const char *argv[] = {NULL /*"/usr/libexec/nm-vpnc-auth-dialog"*/, const char *argv[] = {NULL /*"/usr/libexec/nm-vpnc-auth-dialog"*/,
"-n", NULL /*"davidznet42"*/, "-n", NULL /*"davidznet42"*/,

View file

@ -24,7 +24,7 @@
#include "applet.h" #include "applet.h"
GSList *nmwa_vpn_request_password (NMWirelessApplet *applet, GSList *nma_vpn_request_password (NMApplet *applet,
const char *name, const char *name,
const char *service, const char *service,
gboolean retry); gboolean retry);