From 4fe5a5e2c98386e03e4d94e1ff84632ae9fea76a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 27 Feb 2006 06:26:31 +0000 Subject: [PATCH] 2006-02-27 Dan Williams * 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 --- ChangeLog | 11 + gnome/applet/Makefile.am | 2 +- gnome/applet/applet-dbus-devices.c | 238 ++++---- gnome/applet/applet-dbus-devices.h | 36 +- gnome/applet/applet-dbus-info.c | 28 +- gnome/applet/applet-dbus-vpn.c | 92 +-- gnome/applet/applet-dbus-vpn.h | 14 +- gnome/applet/applet-dbus.c | 114 ++-- gnome/applet/applet-dbus.h | 10 +- gnome/applet/applet-notifications.c | 2 +- gnome/applet/applet-notifications.h | 2 +- gnome/applet/applet.c | 550 +++++++++--------- .../{wireless-applet.glade => applet.glade} | 0 gnome/applet/applet.h | 45 +- gnome/applet/main.c | 8 +- gnome/applet/other-network-dialog.c | 36 +- gnome/applet/other-network-dialog.h | 2 +- gnome/applet/passphrase-dialog.c | 10 +- gnome/applet/passphrase-dialog.h | 4 +- gnome/applet/vpn-connection.c | 28 +- gnome/applet/vpn-connection.h | 22 +- gnome/applet/vpn-password-dialog.c | 2 +- gnome/applet/vpn-password-dialog.h | 2 +- 23 files changed, 631 insertions(+), 627 deletions(-) rename gnome/applet/{wireless-applet.glade => applet.glade} (100%) diff --git a/ChangeLog b/ChangeLog index f94f536359..85702ada60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-02-27 Dan Williams + + * 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 * dispatcher-daemon/NetworkManagerDispatcher.c diff --git a/gnome/applet/Makefile.am b/gnome/applet/Makefile.am index 15867d45b9..542bed9ab5 100644 --- a/gnome/applet/Makefile.am +++ b/gnome/applet/Makefile.am @@ -119,7 +119,7 @@ endif gladedir = $(datadir)/nm-applet -glade_DATA = wireless-applet.glade keyring.png +glade_DATA = applet.glade keyring.png dbusservicedir = $(DBUS_SYS_DIR) dbusservice_DATA = nm-applet.conf diff --git a/gnome/applet/applet-dbus-devices.c b/gnome/applet/applet-dbus-devices.c index 24fd9814d9..f4e1b68867 100644 --- a/gnome/applet/applet-dbus-devices.c +++ b/gnome/applet/applet-dbus-devices.c @@ -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; - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; NMState nm_state; 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_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_message_unref (reply); goto out; } 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); @@ -82,12 +82,12 @@ out: /* - * nmwa_dbus_update_nm_state + * nma_dbus_update_nm_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; 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); 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); } } @@ -106,21 +106,21 @@ void nmwa_dbus_update_nm_state (NMWirelessApplet *applet) typedef struct DriverCBData { - NMWirelessApplet * applet; + NMApplet * applet; NetworkDevice * dev; } 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; - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; DriverCBData * data = (DriverCBData *) user_data; 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_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_message_unref (reply); goto out; @@ -162,12 +162,12 @@ out: /* - * nmwa_dbus_device_get_driver + * nma_dbus_device_get_driver * * 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; DBusPendingCall * pcall = NULL; @@ -187,7 +187,7 @@ static void nmwa_dbus_device_get_driver (NetworkDevice *dev, NMWirelessApplet *a network_device_ref (dev); data->dev = dev; 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); } @@ -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; - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; gboolean wireless_enabled; 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_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_message_unref (reply); 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)) { applet->wireless_enabled = wireless_enabled; - nmwa_enable_wireless_set_active (applet); + nma_enable_wireless_set_active (applet); } 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 * */ -static void nmwa_dbus_update_wireless_enabled (NMWirelessApplet *applet) +static void nma_dbus_update_wireless_enabled (NMApplet *applet) { DBusMessage * message; 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); 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); } } @@ -262,7 +262,7 @@ static void nmwa_dbus_update_wireless_enabled (NMWirelessApplet *applet) typedef struct HalInfoCBData { - NMWirelessApplet * applet; + NMApplet * applet; NetworkDevice * dev; char * parent_op; char * vendor; @@ -309,7 +309,7 @@ static void hal_info_product_cb (DBusPendingCall *pcall, void *user_data) dbus_error_init (&err); 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_message_unref (reply); goto out; @@ -355,7 +355,7 @@ static void hal_info_vendor_cb (DBusPendingCall *pcall, void *user_data) dbus_error_init (&err); 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_message_unref (reply); goto out; @@ -397,7 +397,7 @@ out: /* * 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) @@ -420,7 +420,7 @@ static void hal_net_physdev_cb (DBusPendingCall *pcall, void *user_data) dbus_error_init (&err); 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_message_unref (reply); 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 * */ -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; 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); @@ -512,7 +512,7 @@ typedef struct NetPropCBData { char * dev_op; char * act_net; - NMWirelessApplet * applet; + NMApplet * applet; } NetPropCBData; 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; NetPropCBData * cb_data = (NetPropCBData *) user_data; - NMWirelessApplet * applet; + NMApplet * applet; const char * op = NULL; const char * essid = 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_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_message_unref (reply); goto out; @@ -588,7 +588,7 @@ static void nmwa_dbus_net_properties_cb (DBusPendingCall *pcall, void *user_data { 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 * 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. * */ -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; 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->act_net = (active_net_path && strlen (active_net_path)) ? g_strdup (active_net_path) : NULL; 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); } @@ -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. * */ -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; @@ -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 (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; @@ -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; - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; char * op = NULL; const char * iface = NULL; 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_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_message_unref (reply); goto out; @@ -794,7 +794,7 @@ static void nmwa_dbus_device_properties_cb (DBusPendingCall *pcall, void *user_d DBUS_TYPE_INVALID)) { 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_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); } - nmwa_dbus_update_device_info_from_hal (dev, applet); - nmwa_dbus_device_get_driver (dev, applet); + nma_dbus_update_device_info_from_hal (dev, applet); + nma_dbus_device_get_driver (dev, applet); 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; 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); @@ -848,12 +848,12 @@ out: /* - * nmwa_dbus_device_update_one_device + * nma_dbus_device_update_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; 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); 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); } } typedef struct _DeviceActivatedCBData { - NMWirelessApplet *applet; + NMApplet *applet; char *essid; } DeviceActivatedCBData; @@ -889,23 +889,23 @@ static void free_device_activated_cb_data (DeviceActivatedCBData *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; - NMWirelessApplet * applet = cb_data->applet; + NMApplet * applet = cb_data->applet; char * essid = cb_data->essid; NetworkDevice * active_device; char * message = 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 */ if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (applet))) goto out; #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 (applet->is_adhoc) @@ -928,7 +928,7 @@ static void nmwa_dbus_device_activated_cb (DBusPendingCall *pcall, void *user_da 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); #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; 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); 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); } } -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 /* Don't show anything if the applet isn't shown */ 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"); } #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; 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); 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); } } /* - * 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; - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; char ** 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_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_message_unref (reply); 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 (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); } @@ -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. * */ -void nmwa_dbus_update_devices (NMWirelessApplet *applet) +void nma_dbus_update_devices (NMApplet *applet) { DBusMessage * message; 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"))) { dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); 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); } - 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; - NMWirelessApplet *applet = (NMWirelessApplet *) user_data; + NMApplet *applet = (NMApplet *) user_data; char **dialup_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_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_message_unref (reply); 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. * */ -void nmwa_dbus_dialup_activate_connection (NMWirelessApplet *applet, const char *name) +void nma_dbus_dialup_activate_connection (NMApplet *applet, const char *name) { 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); 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); } 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. * */ -void nmwa_dbus_dialup_deactivate_connection (NMWirelessApplet *applet, const char *name) +void nma_dbus_dialup_deactivate_connection (NMApplet *applet, const char *name) { 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); 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); } 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. * */ -void nmwa_dbus_update_dialup (NMWirelessApplet *applet) +void nma_dbus_update_dialup (NMApplet *applet) { DBusMessage *message; 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"))) { dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); 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); } } /* - * nmwa_dbus_device_remove_one_device + * nma_dbus_device_remove_one_device * * 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; 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); 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 * 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) { DBusMessage * message; @@ -1303,17 +1303,17 @@ void nmwa_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const dbus_message_unref (message); } 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 * */ -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) { DBusMessage *message; @@ -1337,21 +1337,21 @@ void nmwa_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, c wso_append_dbus_params (opt, essid, message); dbus_connection_send (connection, message, NULL); } 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); } 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. * */ -void nmwa_dbus_enable_wireless (NMWirelessApplet *applet, gboolean enabled) +void nma_dbus_enable_wireless (NMApplet *applet, gboolean enabled) { 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_connection_send (applet->connection, message, NULL); - nmwa_dbus_update_wireless_enabled (applet); + nma_dbus_update_wireless_enabled (applet); dbus_message_unref (message); } } /* - * nmwa_dbus_enable_networking + * nma_dbus_enable_networking * * 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; 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; 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) { diff --git a/gnome/applet/applet-dbus-devices.h b/gnome/applet/applet-dbus-devices.h index 8cec2dd0bd..05562af299 100644 --- a/gnome/applet/applet-dbus-devices.h +++ b/gnome/applet/applet-dbus-devices.h @@ -31,27 +31,27 @@ #include "wireless-network.h" #include "wireless-security-option.h" -void nmwa_dbus_update_one_vpn_connection (DBusConnection *connection, const char *name, NMWirelessApplet *applet, gboolean is_active); -void nmwa_dbus_update_vpn_connections (NMWirelessApplet *applet); -gboolean nmwa_dbus_update_device_strength (NMWirelessApplet *applet); +void nma_dbus_update_one_vpn_connection (DBusConnection *connection, const char *name, NMApplet *applet, gboolean is_active); +void nma_dbus_update_vpn_connections (NMApplet *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 nmwa_dbus_update_dialup (NMWirelessApplet *applet); -void nmwa_dbus_dialup_activate_connection (NMWirelessApplet *applet, const char *name); -void nmwa_dbus_dialup_deactivate_connection (NMWirelessApplet *applet, const char *name); -void nmwa_dbus_device_update_one_device (NMWirelessApplet *applet, const char *dev_path); -void nmwa_dbus_device_activated (NMWirelessApplet *applet, const char *dev_path, const char *essid); -void nmwa_dbus_device_deactivated (NMWirelessApplet *applet, const char *dev_path); -void nmwa_dbus_device_remove_one_device (NMWirelessApplet *applet, const char *dev_path); +void nma_dbus_update_devices (NMApplet *applet); +void nma_dbus_update_dialup (NMApplet *applet); +void nma_dbus_dialup_activate_connection (NMApplet *applet, const char *name); +void nma_dbus_dialup_deactivate_connection (NMApplet *applet, const char *name); +void nma_dbus_device_update_one_device (NMApplet *applet, const char *dev_path); +void nma_dbus_device_activated (NMApplet *applet, const char *dev_path, const char *essid); +void nma_dbus_device_deactivated (NMApplet *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 nmwa_dbus_device_remove_one_network (NMWirelessApplet *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 nmwa_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_device_update_one_network (NMApplet *applet, const char *dev_path, const char *net_path, const char *active_net_path); +void nma_dbus_device_remove_one_network (NMApplet *applet, const char *dev_path, const char *net_path); +void nma_dbus_update_strength (NMApplet *applet, const char *dev_path, const char *net_path, int strength); +void nma_dbus_set_device (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 diff --git a/gnome/applet/applet-dbus-info.c b/gnome/applet/applet-dbus-info.c index 93b83d338a..00ef7576e3 100644 --- a/gnome/applet/applet-dbus-info.c +++ b/gnome/applet/applet-dbus-info.c @@ -71,7 +71,7 @@ static inline gboolean nmi_network_type_valid (NMNetworkType type) typedef struct NMGetNetworkKeyCBData { - NMWirelessApplet *applet; + NMApplet *applet; DBusMessage *message; NetworkDevice *dev; char *net_path; @@ -97,7 +97,7 @@ static void nmi_dbus_get_network_key_callback (GnomeKeyringResult result, gpointer data) { NMGetNetworkKeyCBData * cb_data = (NMGetNetworkKeyCBData*) data; - NMWirelessApplet * applet = cb_data->applet; + NMApplet * applet = cb_data->applet; DBusMessage * message = cb_data->message; NetworkDevice * dev = cb_data->dev; char * net_path = cb_data->net_path; @@ -141,7 +141,7 @@ nmi_dbus_get_key_for_network (DBusConnection *connection, DBusMessage *message, void *user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; char * dev_path = NULL; char * net_path = NULL; char * essid = NULL; @@ -164,7 +164,7 @@ nmi_dbus_get_key_for_network (DBusConnection *connection, DBUS_TYPE_INVALID)) 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; /* 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, void *user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; 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_MSG = "There are no wireless networks stored."; - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; GSList * dir_list = NULL; GSList * elt; DBusMessage * reply = NULL; @@ -386,7 +386,7 @@ nmi_dbus_get_network_properties (DBusConnection *connection, DBusMessage *message, void *user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; DBusMessage * reply = NULL; gchar * gconf_key = NULL; char * network = NULL; @@ -543,7 +543,7 @@ nmi_dbus_get_vpn_connections (DBusConnection *connection, DBusMessage *message, void *user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; GSList * dir_list = NULL; GSList * elt = NULL; DBusMessage * reply = NULL; @@ -614,7 +614,7 @@ nmi_dbus_get_vpn_connection_properties (DBusConnection *connection, DBusMessage *message, void *user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; DBusMessage * reply = NULL; char * vpn_connection = NULL; char * escaped_name = NULL; @@ -680,7 +680,7 @@ nmi_dbus_get_vpn_connection_vpn_data (DBusConnection *connection, DBusMessage *message, void *user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; DBusMessage * reply = NULL; gchar * gconf_key = NULL; char * name = NULL; @@ -753,7 +753,7 @@ nmi_dbus_get_vpn_connection_routes (DBusConnection *connection, DBusMessage *message, void *user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; DBusMessage * reply = NULL; gchar * gconf_key = NULL; char * name = NULL; @@ -823,7 +823,7 @@ nmi_dbus_get_vpn_connection_routes (DBusConnection *connection, * */ static void -nmi_save_network_info (NMWirelessApplet *applet, +nmi_save_network_info (NMApplet *applet, const char *essid, gboolean automatic, const char *bssid, @@ -959,7 +959,7 @@ nmi_dbus_update_network_info (DBusConnection *connection, DBusMessage *message, void *user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; char * essid = NULL; gboolean automatic; NMGConfWSO * gconf_wso = NULL; @@ -1026,7 +1026,7 @@ out: */ 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; gboolean handled; diff --git a/gnome/applet/applet-dbus-vpn.c b/gnome/applet/applet-dbus-vpn.c index 436372dfb1..111ae08fd5 100644 --- a/gnome/applet/applet-dbus-vpn.c +++ b/gnome/applet/applet-dbus-vpn.c @@ -34,17 +34,17 @@ #include "vpn-connection.h" #include "nm-utils.h" -static void nmwa_free_vpn_connections (NMWirelessApplet *applet); +static void nma_free_vpn_connections (NMApplet *applet); 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 *escaped_name; 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)); @@ -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. */ -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; 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) { /* 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 { - NMWirelessApplet * applet; + NMApplet * applet; char * name; } 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. * */ -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; VpnPropsCBData * cb_data = user_data; - NMWirelessApplet * applet; + NMApplet * applet; const char * name; const char * user_name; const char * service; @@ -128,7 +128,7 @@ static void nmwa_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data dbus_error_init (&err); 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_message_unref (reply); goto out; @@ -142,16 +142,16 @@ static void nmwa_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data stage = (NMVPNActStage) stage_int; /* If its already there, update the service, otherwise add it to the list */ - if ((vpn = nmwa_vpn_connection_find_by_name (applet->vpn_connections, name))) + if ((vpn = nma_vpn_connection_find_by_name (applet->vpn_connections, name))) { - nmwa_vpn_connection_set_service (vpn, service); - nmwa_vpn_connection_set_stage (vpn, stage); + nma_vpn_connection_set_service (vpn, service); + nma_vpn_connection_set_stage (vpn, stage); } else { - vpn = nmwa_vpn_connection_new (name); - nmwa_vpn_connection_set_service (vpn, service); - nmwa_vpn_connection_set_stage (vpn, stage); + vpn = nma_vpn_connection_new (name); + nma_vpn_connection_set_service (vpn, service); + nma_vpn_connection_set_stage (vpn, stage); 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 * */ -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; 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 (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"))) { @@ -189,22 +189,22 @@ void nmwa_dbus_vpn_update_one_vpn_connection (NMWirelessApplet *applet, const ch cb_data->applet = applet; 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; - NMWirelessApplet * applet = (NMWirelessApplet *) user_data; + NMApplet * applet = (NMApplet *) user_data; char ** 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_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_message_unref (reply); 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 (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); } @@ -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 * */ -void nmwa_dbus_vpn_update_vpn_connections (NMWirelessApplet *applet) +void nma_dbus_vpn_update_vpn_connections (NMApplet *applet) { DBusMessage * message; 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"))) { dbus_connection_send_with_reply (applet->connection, message, &pcall, -1); dbus_message_unref (message); 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 * */ -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; g_return_if_fail (applet != 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); - 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); 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); 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. * */ -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; DBusMessageIter iter; @@ -339,17 +339,17 @@ void nmwa_dbus_vpn_activate_connection (DBusConnection *connection, const char * dbus_connection_send (connection, message, NULL); } 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. * */ -void nmwa_dbus_vpn_deactivate_connection (DBusConnection *connection) +void nma_dbus_vpn_deactivate_connection (DBusConnection *connection) { DBusMessage *message; @@ -361,7 +361,7 @@ void nmwa_dbus_vpn_deactivate_connection (DBusConnection *connection) dbus_connection_send (connection, message, NULL); } else - nm_warning ("nmwa_dbus_activate_vpn_connection(): Couldn't allocate the dbus message"); + nm_warning ("Couldn't allocate the dbus message"); } diff --git a/gnome/applet/applet-dbus-vpn.h b/gnome/applet/applet-dbus-vpn.h index c673eeff9f..7961dc7911 100644 --- a/gnome/applet/applet-dbus-vpn.h +++ b/gnome/applet/applet-dbus-vpn.h @@ -27,14 +27,14 @@ #include #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 nmwa_dbus_vpn_update_vpn_connections (NMWirelessApplet *applet); -void nmwa_dbus_vpn_remove_one_vpn_connection (NMWirelessApplet *applet, const char *vpn_name); +void nma_dbus_vpn_update_one_vpn_connection (NMApplet *applet, const char *vpn_name); +void nma_dbus_vpn_update_vpn_connections (NMApplet *applet); +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 nmwa_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_activate_connection (DBusConnection *connection, const char *name, GSList *passwords); +void nma_dbus_vpn_deactivate_connection (DBusConnection *connection); +void nma_dbus_vpn_update_vpn_connection_stage (NMApplet *applet, const char *vpn_name, NMVPNActStage vpn_state); #endif diff --git a/gnome/applet/applet-dbus.c b/gnome/applet/applet-dbus.c index 9fea824a50..cf1de23b0c 100644 --- a/gnome/applet/applet-dbus.c +++ b/gnome/applet/applet-dbus.c @@ -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; const char * object_path; @@ -89,16 +89,16 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa { /* NetworkManager started up */ applet->nm_running = TRUE; - nmwa_set_state (applet, NM_STATE_DISCONNECTED); - nmwa_dbus_update_nm_state (applet); - nmwa_dbus_update_devices (applet); - nmwa_dbus_update_dialup (applet); - nmwa_dbus_vpn_update_vpn_connections (applet); + nma_set_state (applet, NM_STATE_DISCONNECTED); + nma_dbus_update_nm_state (applet); + nma_dbus_update_devices (applet); + nma_dbus_update_dialup (applet); + nma_dbus_vpn_update_vpn_connections (applet); } else if (old_owner_good && !new_owner_good) { applet->nm_running = FALSE; - nmwa_set_state (applet, NM_STATE_DISCONNECTED); + nma_set_state (applet, NM_STATE_DISCONNECTED); 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)) { - 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 * valid wireless network information for it. */ 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") @@ -130,7 +130,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa char *path = NULL; 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")) { @@ -138,23 +138,23 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa char *essid = NULL; 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)) - 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")) { char *path = NULL; 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")) { char *path = NULL; 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") || 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; 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 */ { @@ -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)) { 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")) @@ -181,7 +181,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa char *name = NULL; 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")) { @@ -189,7 +189,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa 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)) - 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")) { @@ -197,7 +197,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa 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)) - 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")) { @@ -206,14 +206,14 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa 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)) - 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")) { char *dev_path = NULL; int strength = -1; 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) || 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; 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 */ - 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)) @@ -239,11 +239,11 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa { 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); /* 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")) @@ -257,11 +257,11 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa if (dev && 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); } 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")) { @@ -272,7 +272,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa { 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); } } @@ -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 * */ -static gboolean nmwa_dbus_nm_is_running (DBusConnection *connection) +static gboolean nma_dbus_nm_is_running (DBusConnection *connection) { DBusError error; 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 * */ -static DBusConnection * nmwa_dbus_init (NMWirelessApplet *applet) +static DBusConnection * nma_dbus_init (NMApplet *applet) { DBusConnection * connection = NULL; 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); 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); 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)) { - 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; } - if (!dbus_connection_add_filter (connection, nmwa_dbus_filter, applet, NULL)) + if (!dbus_connection_add_filter (connection, nma_dbus_filter, applet, NULL)) return NULL; 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 * */ -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); 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); - nmwa_set_state (applet, NM_STATE_DISCONNECTED); - nmwa_dbus_update_nm_state (applet); - nmwa_dbus_update_devices (applet); - nmwa_dbus_update_dialup (applet); - nmwa_dbus_vpn_update_vpn_connections (applet); + applet->nm_running = nma_dbus_nm_is_running (applet->connection); + nma_set_state (applet, NM_STATE_DISCONNECTED); + nma_dbus_update_nm_state (applet); + nma_dbus_update_devices (applet); + nma_dbus_update_dialup (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 * 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; @@ -425,20 +425,20 @@ void nmwa_dbus_init_helper (NMWirelessApplet *applet) dbus_g_thread_init (); - applet->connection = nmwa_dbus_init (applet); + applet->connection = nma_dbus_init (applet); applet->nmi_methods = nmi_dbus_nmi_methods_setup (); 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); - if (applet->connection && nmwa_dbus_nm_is_running (applet->connection)) + if (applet->connection && nma_dbus_nm_is_running (applet->connection)) { applet->nm_running = TRUE; - nmwa_dbus_update_nm_state (applet); - nmwa_dbus_update_devices (applet); - nmwa_dbus_update_dialup (applet); - nmwa_dbus_vpn_update_vpn_connections (applet); + nma_dbus_update_nm_state (applet); + nma_dbus_update_devices (applet); + nma_dbus_update_dialup (applet); + nma_dbus_vpn_update_vpn_connections (applet); } g_source_unref (timeout_source); diff --git a/gnome/applet/applet-dbus.h b/gnome/applet/applet-dbus.h index f798924444..af6b7a2928 100644 --- a/gnome/applet/applet-dbus.h +++ b/gnome/applet/applet-dbus.h @@ -42,10 +42,10 @@ static inline gboolean message_is_error (DBusMessage *msg) return (dbus_message_get_type (msg) == DBUS_MESSAGE_TYPE_ERROR); } -void nmwa_dbus_init_helper (NMWirelessApplet *applet); -void nmwa_dbus_enable_wireless (NMWirelessApplet *applet, gboolean enabled); -void nmwa_dbus_enable_networking (NMWirelessApplet *applet, gboolean enabled); -void nmwa_free_gui_data_model (NMWirelessApplet *applet); -void nmwa_free_dbus_data_model (NMWirelessApplet *applet); +void nma_dbus_init_helper (NMApplet *applet); +void nma_dbus_enable_wireless (NMApplet *applet, gboolean enabled); +void nma_dbus_enable_networking (NMApplet *applet, gboolean enabled); +void nma_free_gui_data_model (NMApplet *applet); +void nma_free_dbus_data_model (NMApplet *applet); #endif diff --git a/gnome/applet/applet-notifications.c b/gnome/applet/applet-notifications.c index 5f64ee149d..86dcc4a69d 100644 --- a/gnome/applet/applet-notifications.c +++ b/gnome/applet/applet-notifications.c @@ -23,7 +23,7 @@ #include "applet-notifications.h" void -nmwa_send_event_notification (NMWirelessApplet *applet, +nma_send_event_notification (NMApplet *applet, NotifyUrgency urgency, const char *summary, const char *message, diff --git a/gnome/applet/applet-notifications.h b/gnome/applet/applet-notifications.h index bdbe2b0291..e95d0b965e 100644 --- a/gnome/applet/applet-notifications.h +++ b/gnome/applet/applet-notifications.h @@ -25,7 +25,7 @@ #include "applet.h" void -nmwa_send_event_notification (NMWirelessApplet *applet, +nma_send_event_notification (NMApplet *applet, NotifyUrgency urgency, const char *summary, const char *message, diff --git a/gnome/applet/applet.c b/gnome/applet/applet.c index 94af6d4b4a..b4343efbcb 100644 --- a/gnome/applet/applet.c +++ b/gnome/applet/applet.c @@ -75,17 +75,17 @@ #define GTK_STOCK_INFO GTK_STOCK_DIALOG_INFO #endif -static GObject * nmwa_constructor (GType type, guint n_props, GObjectConstructParam *construct_props); -static gboolean nmwa_icons_init (NMWirelessApplet *applet); -static void nmwa_icons_free (NMWirelessApplet *applet); -static void nmwa_about_cb (NMWirelessApplet *applet); -static void nmwa_context_menu_update (NMWirelessApplet *applet); -static GtkWidget * nmwa_get_instance (NMWirelessApplet *applet); -static void nmwa_update_state (NMWirelessApplet *applet); -static void nmwa_dropdown_menu_deactivate_cb (GtkWidget *menu, NMWirelessApplet *applet); -static GType nmwa_get_type (void); /* for G_DEFINE_TYPE */ +static GObject * nma_constructor (GType type, guint n_props, GObjectConstructParam *construct_props); +static gboolean nma_icons_init (NMApplet *applet); +static void nma_icons_free (NMApplet *applet); +static void nma_about_cb (NMApplet *applet); +static void nma_context_menu_update (NMApplet *applet); +static GtkWidget * nma_get_instance (NMApplet *applet); +static void nma_update_state (NMApplet *applet); +static void nma_dropdown_menu_deactivate_cb (GtkWidget *menu, NMApplet *applet); +static GType nma_get_type (void); /* for G_DEFINE_TYPE */ -G_DEFINE_TYPE(NMWirelessApplet, nmwa, EGG_TYPE_TRAY_ICON) +G_DEFINE_TYPE(NMApplet, nma, EGG_TYPE_TRAY_ICON) /* * nm_null_safe_strcmp @@ -107,12 +107,12 @@ int nm_null_safe_strcmp (const char *s1, const char *s2) /* - * nmwa_get_first_active_device + * nma_get_first_active_device * * Return the first device marked as "active". * */ -NetworkDevice * nmwa_get_first_active_device (GSList *dev_list) +NetworkDevice * nma_get_first_active_device (GSList *dev_list) { GSList * elt; @@ -127,36 +127,36 @@ NetworkDevice * nmwa_get_first_active_device (GSList *dev_list) } -static void nmwa_init (NMWirelessApplet *applet) +static void nma_init (NMApplet *applet) { applet->animation_id = 0; applet->animation_step = 0; glade_gnome_init (); - if (!nmwa_icons_init (applet)) + if (!nma_icons_init (applet)) return; -/* gtk_window_set_default_icon_from_file (ICONDIR"/NMWirelessApplet/wireless-applet.png", NULL); */ - gtk_widget_show (nmwa_get_instance (applet)); +/* gtk_window_set_default_icon_from_file (ICONDIR"/NMApplet/wireless-applet.png", NULL); */ + gtk_widget_show (nma_get_instance (applet)); } -static void nmwa_class_init (NMWirelessAppletClass *klass) +static void nma_class_init (NMAppletClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); - gobject_class->constructor = nmwa_constructor; + gobject_class->constructor = nma_constructor; } -static GObject *nmwa_constructor (GType type, guint n_props, GObjectConstructParam *construct_props) +static GObject *nma_constructor (GType type, guint n_props, GObjectConstructParam *construct_props) { GObject *obj; - NMWirelessApplet *applet; - NMWirelessAppletClass *klass; + NMApplet *applet; + NMAppletClass *klass; - klass = NM_WIRELESS_APPLET_CLASS (g_type_class_peek (type)); - obj = G_OBJECT_CLASS (nmwa_parent_class)->constructor (type, n_props, construct_props); - applet = NM_WIRELESS_APPLET (obj); + klass = NM_APPLET_CLASS (g_type_class_peek (type)); + obj = G_OBJECT_CLASS (nma_parent_class)->constructor (type, n_props, construct_props); + applet = NM_APPLET (obj); return obj; } @@ -176,7 +176,7 @@ static GtkWidget * get_label (GtkWidget *info_dialog, GladeXML *xml, const char return label; } -static void nmwa_show_socket_err (GtkWidget *info_dialog, const char *err) +static void nma_show_socket_err (GtkWidget *info_dialog, const char *err) { GtkWidget *error_dialog; @@ -186,7 +186,7 @@ static void nmwa_show_socket_err (GtkWidget *info_dialog, const char *err) g_signal_connect_swapped (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), error_dialog); } -static gboolean nmwa_update_info (NMWirelessApplet *applet) +static gboolean nma_update_info (NMApplet *applet) { GtkWidget *info_dialog; char *addr = NULL, *broadcast = NULL, *primary_dns = NULL, *secondary_dns = NULL; @@ -199,18 +199,18 @@ static gboolean nmwa_update_info (NMWirelessApplet *applet) if (!info_dialog) { char *err = g_strdup (_("Could not find some required resources (the glade file)!")); - nmwa_show_socket_err (info_dialog, err); + nma_show_socket_err (info_dialog, err); g_free (err); return FALSE; } - if ((dev = nmwa_get_first_active_device (applet->device_list))) + if ((dev = nma_get_first_active_device (applet->device_list))) iface = network_device_get_iface (dev); if (!dev || !iface) { char *err = g_strdup (_("No active connections!")); - nmwa_show_socket_err (info_dialog, err); + nma_show_socket_err (info_dialog, err); g_free (err); return FALSE; } @@ -262,13 +262,13 @@ static gboolean nmwa_update_info (NMWirelessApplet *applet) return TRUE; } -static void nmwa_show_info_cb (GtkMenuItem *mi, NMWirelessApplet *applet) +static void nma_show_info_cb (GtkMenuItem *mi, NMApplet *applet) { GtkWidget *info_dialog; info_dialog = glade_xml_get_widget (applet->info_dialog_xml, "info_dialog"); - if (nmwa_update_info (applet)) + if (nma_update_info (applet)) { gtk_window_present (GTK_WINDOW (info_dialog)); g_signal_connect_swapped (info_dialog, "response", G_CALLBACK (gtk_widget_hide), info_dialog); @@ -282,7 +282,7 @@ static void about_dialog_activate_link_cb (GtkAboutDialog *about, gnome_url_show (url, NULL); } -static void nmwa_about_cb (NMWirelessApplet *applet) +static void nma_about_cb (NMApplet *applet) { static const gchar *authors[] = { @@ -366,13 +366,13 @@ static void nmwa_about_cb (NMWirelessApplet *applet) #ifndef ENABLE_NOTIFY /* - * nmwa_show_vpn_failure_dialog + * nma_show_vpn_failure_dialog * * Present the VPN failure dialog. * */ static void -nmwa_show_vpn_failure_dialog (const char *title, +nma_show_vpn_failure_dialog (const char *title, const char *msg) { GtkWidget *dialog; @@ -397,12 +397,12 @@ nmwa_show_vpn_failure_dialog (const char *title, /* - * nmwa_schedule_vpn_failure_alert + * nma_schedule_vpn_failure_alert * * Schedule display of a VPN failure message. * */ -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) { char *title = NULL; char *desc = NULL; @@ -444,12 +444,12 @@ void nmwa_show_vpn_failure_alert (NMWirelessApplet *applet, const char *member, #ifdef ENABLE_NOTIFY msg = g_strdup_printf ("\n%s\n%s", desc, error_msg); - nmwa_send_event_notification (applet, NOTIFY_URGENCY_CRITICAL, + nma_send_event_notification (applet, NOTIFY_URGENCY_CRITICAL, title, msg, "gnome-lockscreen"); #else msg = g_strdup_printf ("%s\n\n" "%s\n\n%s", title, desc, error_msg); - nmwa_show_vpn_failure_dialog (title, msg); + nma_show_vpn_failure_dialog (title, msg); #endif g_free (msg); } @@ -461,13 +461,13 @@ void nmwa_show_vpn_failure_alert (NMWirelessApplet *applet, const char *member, #ifndef ENABLE_NOTIFY /* - * nmwa_show_vpn_login_banner_dialog + * nma_show_vpn_login_banner_dialog * * Present the VPN login banner dialog. * */ static void -nmwa_show_vpn_login_banner_dialog (const char *title, +nma_show_vpn_login_banner_dialog (const char *title, const char *msg) { GtkWidget *dialog; @@ -488,12 +488,12 @@ nmwa_show_vpn_login_banner_dialog (const char *title, /* - * nmwa_schedule_vpn_login_banner + * nma_schedule_vpn_login_banner * * Schedule a display of the VPN banner * */ -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) { const char * title; char * msg; @@ -505,25 +505,25 @@ void nmwa_show_vpn_login_banner (NMWirelessApplet *applet, const char *vpn_name, title = _("VPN Login Message"); #ifdef ENABLE_NOTIFY msg = g_strdup_printf ("\n%s", banner); - nmwa_send_event_notification (applet, NOTIFY_URGENCY_LOW, + nma_send_event_notification (applet, NOTIFY_URGENCY_LOW, title, msg, "gnome-lockscreen"); #else msg = g_strdup_printf ("%s\n\n%s", title, banner); - nmwa_show_vpn_login_banner_dialog (title, msg); + nma_show_vpn_login_banner_dialog (title, msg); #endif g_free (msg); } /* - * nmwa_driver_notify_get_ignored_list + * nma_driver_notify_get_ignored_list * * Return list of devices for which we are supposed to ignore driver * notifications for from GConf. * */ -static GSList *nmwa_driver_notify_get_ignored_list (NMWirelessApplet *applet) +static GSList *nma_driver_notify_get_ignored_list (NMApplet *applet) { char *key; GConfValue *value; @@ -548,13 +548,13 @@ static GSList *nmwa_driver_notify_get_ignored_list (NMWirelessApplet *applet) /* - * nmwa_driver_notify_is_device_ignored + * nma_driver_notify_is_device_ignored * * Look in GConf and determine whether or not we are supposed to * ignore driver notifications for a particular device. * */ -static gboolean nmwa_driver_notify_is_device_ignored (NMWirelessApplet *applet, NetworkDevice *dev) +static gboolean nma_driver_notify_is_device_ignored (NMApplet *applet, NetworkDevice *dev) { gboolean found = FALSE; GSList * mac_list = NULL; @@ -569,7 +569,7 @@ static gboolean nmwa_driver_notify_is_device_ignored (NMWirelessApplet *applet, g_return_val_if_fail (dev_addr != NULL, TRUE); g_return_val_if_fail (strlen (dev_addr) > 0, TRUE); - mac_list = nmwa_driver_notify_get_ignored_list (applet); + mac_list = nma_driver_notify_get_ignored_list (applet); /* Ensure that the MAC isn't already in the list */ for (elt = mac_list; elt; elt = g_slist_next (elt)) @@ -590,13 +590,13 @@ static gboolean nmwa_driver_notify_is_device_ignored (NMWirelessApplet *applet, /* - * nmwa_driver_notify_ignore_device + * nma_driver_notify_ignore_device * * Add a device's MAC address to the list of ones that we ignore * in GConf. Stores user's pref for "Don't remind me". * */ -static void nmwa_driver_notify_ignore_device (NMWirelessApplet *applet, NetworkDevice *dev) +static void nma_driver_notify_ignore_device (NMApplet *applet, NetworkDevice *dev) { gboolean found = FALSE; GSList * new_mac_list = NULL; @@ -611,7 +611,7 @@ static void nmwa_driver_notify_ignore_device (NMWirelessApplet *applet, NetworkD g_return_if_fail (dev_addr != NULL); g_return_if_fail (strlen (dev_addr) > 0); - new_mac_list = nmwa_driver_notify_get_ignored_list (applet); + new_mac_list = nma_driver_notify_get_ignored_list (applet); /* Ensure that the MAC isn't already in the list */ for (elt = new_mac_list; elt; elt = g_slist_next (elt)) @@ -638,13 +638,13 @@ static void nmwa_driver_notify_ignore_device (NMWirelessApplet *applet, NetworkD g_slist_free (new_mac_list); } -static gboolean nmwa_driver_notify_dialog_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) +static gboolean nma_driver_notify_dialog_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) { gtk_widget_destroy (widget); return FALSE; } -static gboolean nmwa_driver_notify_dialog_destroy_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) +static gboolean nma_driver_notify_dialog_destroy_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) { DriverNotifyCBData *cb_data = (DriverNotifyCBData *)(user_data); NetworkDevice *dev; @@ -664,11 +664,11 @@ static gboolean nmwa_driver_notify_dialog_destroy_cb (GtkWidget *widget, GdkEven } -static gboolean nmwa_driver_notify_ok_cb (GtkButton *button, gpointer user_data) +static gboolean nma_driver_notify_ok_cb (GtkButton *button, gpointer user_data) { DriverNotifyCBData *cb_data = (DriverNotifyCBData *)(user_data); NetworkDevice *dev; - NMWirelessApplet *applet; + NMApplet *applet; GtkWidget *dialog; GtkWidget *checkbox; @@ -683,7 +683,7 @@ static gboolean nmwa_driver_notify_ok_cb (GtkButton *button, gpointer user_data) checkbox = glade_xml_get_widget (cb_data->xml, "dont_remind_checkbox"); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox))) - nmwa_driver_notify_ignore_device (applet, dev); + nma_driver_notify_ignore_device (applet, dev); dialog = glade_xml_get_widget (cb_data->xml, "driver_sucks_dialog"); gtk_widget_destroy (dialog); @@ -693,17 +693,17 @@ static gboolean nmwa_driver_notify_ok_cb (GtkButton *button, gpointer user_data) /* - * nmwa_driver_notify + * nma_driver_notify * * Notify the user if there's some problem with the driver * of a specific network device. * */ -gboolean nmwa_driver_notify (gpointer user_data) +gboolean nma_driver_notify (gpointer user_data) { DriverNotifyCBData * cb_data = (DriverNotifyCBData *)(user_data); NetworkDevice * dev; - NMWirelessApplet * applet; + NMApplet * applet; GtkWidget * dialog; GtkLabel * label; char * label_text = NULL; @@ -721,18 +721,18 @@ gboolean nmwa_driver_notify (gpointer user_data) /* If the user has already requested that we ignore notifications for * this device, don't do anything. */ - if (nmwa_driver_notify_is_device_ignored (applet, dev)) + if (nma_driver_notify_is_device_ignored (applet, dev)) goto out; if (!(cb_data->xml = glade_xml_new (applet->glade_file, "driver_sucks_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).")); goto out; } dialog = glade_xml_get_widget (cb_data->xml, "driver_sucks_dialog"); - g_signal_connect (G_OBJECT (dialog), "destroy-event", GTK_SIGNAL_FUNC (nmwa_driver_notify_dialog_destroy_cb), cb_data); - g_signal_connect (G_OBJECT (dialog), "delete-event", GTK_SIGNAL_FUNC (nmwa_driver_notify_dialog_delete_cb), cb_data); + g_signal_connect (G_OBJECT (dialog), "destroy-event", GTK_SIGNAL_FUNC (nma_driver_notify_dialog_destroy_cb), cb_data); + g_signal_connect (G_OBJECT (dialog), "delete-event", GTK_SIGNAL_FUNC (nma_driver_notify_dialog_delete_cb), cb_data); label = GTK_LABEL (glade_xml_get_widget (cb_data->xml, "driver_sucks_label")); @@ -756,7 +756,7 @@ gboolean nmwa_driver_notify (gpointer user_data) gtk_label_set_markup (label, label_text); button = GTK_BUTTON (glade_xml_get_widget (cb_data->xml, "ok_button")); - g_signal_connect (G_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (nmwa_driver_notify_ok_cb), cb_data); + g_signal_connect (G_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (nma_driver_notify_ok_cb), cb_data); /* Bash focus-stealing prevention in the face */ gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS); @@ -771,12 +771,12 @@ out: /* - * nmwa_get_first_active_vpn_connection + * nma_get_first_active_vpn_connection * * Return the first active VPN connection, if any. * */ -VPNConnection *nmwa_get_first_active_vpn_connection (NMWirelessApplet *applet) +VPNConnection *nma_get_first_active_vpn_connection (NMApplet *applet) { VPNConnection * vpn; NMVPNActStage vpn_state; @@ -785,7 +785,7 @@ VPNConnection *nmwa_get_first_active_vpn_connection (NMWirelessApplet *applet) for (elt = applet->vpn_connections; elt; elt = g_slist_next (elt)) { vpn = (VPNConnection*) elt->data; - vpn_state = nmwa_vpn_connection_get_stage (vpn); + vpn_state = nma_vpn_connection_get_stage (vpn); if (vpn_state == NM_VPN_ACT_STAGE_ACTIVATED) return vpn; } @@ -793,7 +793,7 @@ VPNConnection *nmwa_get_first_active_vpn_connection (NMWirelessApplet *applet) return NULL; } -static VPNConnection *nmwa_get_first_activating_vpn_connection (NMWirelessApplet *applet) +static VPNConnection *nma_get_first_activating_vpn_connection (NMApplet *applet) { VPNConnection * vpn; GSList * elt; @@ -801,7 +801,7 @@ static VPNConnection *nmwa_get_first_activating_vpn_connection (NMWirelessApplet for (elt = applet->vpn_connections; elt; elt = g_slist_next (elt)) { vpn = (VPNConnection*) elt->data; - if (nmwa_vpn_connection_is_activating (vpn)) + if (nma_vpn_connection_is_activating (vpn)) return vpn; } @@ -809,7 +809,7 @@ static VPNConnection *nmwa_get_first_activating_vpn_connection (NMWirelessApplet } -static void nmwa_set_icon (NMWirelessApplet *applet, GdkPixbuf *link_icon, GdkPixbuf *vpn_icon) +static void nma_set_icon (NMApplet *applet, GdkPixbuf *link_icon, GdkPixbuf *vpn_icon) { GtkRequisition requisition; GdkPixbuf *composite; @@ -820,9 +820,9 @@ static void nmwa_set_icon (NMWirelessApplet *applet, GdkPixbuf *link_icon, GdkPi composite = gdk_pixbuf_copy (link_icon); - vpn = nmwa_get_first_active_vpn_connection (applet); + vpn = nma_get_first_active_vpn_connection (applet); if (!vpn) - vpn = nmwa_get_first_activating_vpn_connection (applet); + vpn = nma_get_first_activating_vpn_connection (applet); if (vpn && vpn_icon) gdk_pixbuf_composite (vpn_icon, composite, 0, 0, gdk_pixbuf_get_width (vpn_icon), @@ -841,7 +841,7 @@ static void nmwa_set_icon (NMWirelessApplet *applet, GdkPixbuf *link_icon, GdkPi } -static GdkPixbuf *nmwa_get_connected_icon (NMWirelessApplet *applet, NetworkDevice *dev) +static GdkPixbuf *nma_get_connected_icon (NMApplet *applet, NetworkDevice *dev) { int strength = 0; GdkPixbuf *pixbuf = NULL; @@ -875,7 +875,7 @@ static GdkPixbuf *nmwa_get_connected_icon (NMWirelessApplet *applet, NetworkDevi } -static GdkPixbuf * nmwa_act_stage_to_pixbuf (NMWirelessApplet *applet, NetworkDevice *dev, WirelessNetwork *net, char **tip) +static GdkPixbuf * nma_act_stage_to_pixbuf (NMApplet *applet, NetworkDevice *dev, WirelessNetwork *net, char **tip) { const char *essid; const char *iface; @@ -975,7 +975,7 @@ static GdkPixbuf * nmwa_act_stage_to_pixbuf (NMWirelessApplet *applet, NetworkDe * is supposed to be animated. * */ -static gboolean animation_timeout (NMWirelessApplet *applet) +static gboolean animation_timeout (NMApplet *applet) { NetworkDevice *act_dev; GdkPixbuf *pixbuf; @@ -989,7 +989,7 @@ static gboolean animation_timeout (NMWirelessApplet *applet) return FALSE; } - act_dev = nmwa_get_first_active_device (applet->device_list); + act_dev = nma_get_first_active_device (applet->device_list); if (!act_dev) { applet->animation_step = 0; @@ -1002,28 +1002,28 @@ static gboolean animation_timeout (NMWirelessApplet *applet) if (act_dev) { char *tip = NULL; - pixbuf = nmwa_act_stage_to_pixbuf (applet, act_dev, NULL, &tip); + pixbuf = nma_act_stage_to_pixbuf (applet, act_dev, NULL, &tip); g_free (tip); if (pixbuf) - nmwa_set_icon (applet, pixbuf, NULL); + nma_set_icon (applet, pixbuf, NULL); } applet->animation_step ++; } - else if (nmwa_get_first_activating_vpn_connection (applet) != NULL) + else if (nma_get_first_activating_vpn_connection (applet) != NULL) { - pixbuf = nmwa_get_connected_icon (applet, act_dev); + pixbuf = nma_get_connected_icon (applet, act_dev); if (applet->animation_step >= NUM_VPN_CONNECTING_FRAMES) applet->animation_step = 0; - nmwa_set_icon (applet, pixbuf, applet->vpn_connecting_icons[applet->animation_step]); + nma_set_icon (applet, pixbuf, applet->vpn_connecting_icons[applet->animation_step]); applet->animation_step ++; } else { applet->animation_step = 0; - nmwa_update_state (applet); + nma_update_state (applet); return FALSE; } @@ -1032,13 +1032,13 @@ static gboolean animation_timeout (NMWirelessApplet *applet) /* - * nmwa_update_state + * nma_update_state * * Figure out what the currently active device is from NetworkManager, its type, * and what our icon on the panel should look like for each type. * */ -static void nmwa_update_state (NMWirelessApplet *applet) +static void nma_update_state (NMApplet *applet) { gboolean show_applet = TRUE; gboolean need_animation = FALSE; @@ -1050,7 +1050,7 @@ static void nmwa_update_state (NMWirelessApplet *applet) NetworkDevice * act_dev = NULL; VPNConnection *vpn; - act_dev = nmwa_get_first_active_device (applet->device_list); + act_dev = nma_get_first_active_device (applet->device_list); if (act_dev && network_device_is_wireless (act_dev)) { active_network = network_device_get_active_wireless_network (act_dev); @@ -1066,7 +1066,7 @@ static void nmwa_update_state (NMWirelessApplet *applet) #if 0 if (!act_dev) - nmwa_set_state (applet, NM_STATE_DISCONNECTED); + nma_set_state (applet, NM_STATE_DISCONNECTED); #endif switch (applet->nm_state) @@ -1092,12 +1092,12 @@ static void nmwa_update_state (NMWirelessApplet *applet) tip = g_strdup_printf (_("Wireless network connection to '%s' (%d%%)"), active_network ? wireless_network_get_essid (active_network) : "(unknown)", strength); } - pixbuf = nmwa_get_connected_icon (applet, act_dev); + pixbuf = nma_get_connected_icon (applet, act_dev); break; case NM_STATE_CONNECTING: { - pixbuf = nmwa_act_stage_to_pixbuf (applet, act_dev, active_network, &tip); + pixbuf = nma_act_stage_to_pixbuf (applet, act_dev, active_network, &tip); need_animation = TRUE; } break; @@ -1106,18 +1106,18 @@ static void nmwa_update_state (NMWirelessApplet *applet) break; } - vpn = nmwa_get_first_active_vpn_connection (applet); + vpn = nma_get_first_active_vpn_connection (applet); if (vpn != NULL) { - vpntip = g_strdup_printf (_("VPN connection to '%s'"), nmwa_vpn_connection_get_name (vpn)); + vpntip = g_strdup_printf (_("VPN connection to '%s'"), nma_vpn_connection_get_name (vpn)); } else { - vpn = nmwa_get_first_activating_vpn_connection (applet); + vpn = nma_get_first_activating_vpn_connection (applet); if (vpn != NULL) { need_animation = TRUE; - vpntip = g_strdup_printf (_("VPN connecting to '%s'"), nmwa_vpn_connection_get_name (vpn)); + vpntip = g_strdup_printf (_("VPN connecting to '%s'"), nma_vpn_connection_get_name (vpn)); } } @@ -1149,7 +1149,7 @@ done: } if (pixbuf) - nmwa_set_icon (applet, pixbuf, applet->vpn_lock_icon); + nma_set_icon (applet, pixbuf, applet->vpn_lock_icon); else show_applet = FALSE; } @@ -1163,15 +1163,15 @@ done: /* - * nmwa_redraw_timeout + * nma_redraw_timeout * * Called regularly to update the applet's state and icon in the panel * */ -static int nmwa_redraw_timeout (NMWirelessApplet *applet) +static int nma_redraw_timeout (NMApplet *applet) { if (!applet->animation_id) - nmwa_update_state (applet); + nma_update_state (applet); return TRUE; } @@ -1203,12 +1203,12 @@ static gboolean show_warning_dialog (char *mesg) /* - * nmwa_schedule_warning_dialog + * nma_schedule_warning_dialog * * Run a warning dialog in the main event loop. * */ -void nmwa_schedule_warning_dialog (NMWirelessApplet *applet, const char *msg) +void nma_schedule_warning_dialog (NMApplet *applet, const char *msg) { char *lcl_msg; @@ -1221,13 +1221,13 @@ void nmwa_schedule_warning_dialog (NMWirelessApplet *applet, const char *msg) /* - * nmwa_get_device_for_nm_device + * nma_get_device_for_nm_device * * Searches the device list for a device that matches the * NetworkManager ID given. * */ -NetworkDevice *nmwa_get_device_for_nm_path (GSList *dev_list, const char *nm_path) +NetworkDevice *nma_get_device_for_nm_path (GSList *dev_list, const char *nm_path) { NetworkDevice *found_dev = NULL; GSList *elt; @@ -1250,14 +1250,14 @@ NetworkDevice *nmwa_get_device_for_nm_path (GSList *dev_list, const char *nm_pat /* - * nmwa_menu_item_activate + * nma_menu_item_activate * * Signal function called when user clicks on a menu item * */ -static void nmwa_menu_item_activate (GtkMenuItem *item, gpointer user_data) +static void nma_menu_item_activate (GtkMenuItem *item, gpointer user_data) { - NMWirelessApplet *applet = (NMWirelessApplet *)user_data; + NMApplet *applet = (NMApplet *)user_data; NetworkDevice *dev = NULL; WirelessNetwork *net = NULL; char *tag; @@ -1268,7 +1268,7 @@ static void nmwa_menu_item_activate (GtkMenuItem *item, gpointer user_data) if (!(tag = g_object_get_data (G_OBJECT (item), "device"))) return; - if ((dev = nmwa_get_device_for_nm_path (applet->device_list, tag))) + if ((dev = nma_get_device_for_nm_path (applet->device_list, tag))) network_device_ref (dev); if (!dev) @@ -1277,7 +1277,7 @@ static void nmwa_menu_item_activate (GtkMenuItem *item, gpointer user_data) if ((tag = g_object_get_data (G_OBJECT (item), "network"))) net = network_device_get_wireless_network_by_essid (dev, tag); - nmwa_dbus_set_device (applet->connection, dev, net ? wireless_network_get_essid (net) : NULL, NULL); + nma_dbus_set_device (applet->connection, dev, net ? wireless_network_get_essid (net) : NULL, NULL); network_device_unref (dev); nmi_dbus_signal_user_interface_activated (applet->connection); @@ -1285,14 +1285,14 @@ static void nmwa_menu_item_activate (GtkMenuItem *item, gpointer user_data) /* - * nmwa_menu_vpn_item_activate + * nma_menu_vpn_item_activate * * Signal function called when user clicks on a VPN menu item * */ -static void nmwa_menu_vpn_item_activate (GtkMenuItem *item, gpointer user_data) +static void nma_menu_vpn_item_activate (GtkMenuItem *item, gpointer user_data) { - NMWirelessApplet *applet = (NMWirelessApplet *)user_data; + NMApplet *applet = (NMApplet *)user_data; char *tag; g_return_if_fail (item != NULL); @@ -1301,9 +1301,9 @@ static void nmwa_menu_vpn_item_activate (GtkMenuItem *item, gpointer user_data) if ((tag = g_object_get_data (G_OBJECT (item), "vpn"))) { VPNConnection *vpn = (VPNConnection *)tag; - const char *name = nmwa_vpn_connection_get_name (vpn); + const char *name = nma_vpn_connection_get_name (vpn); GSList *passwords; - VPNConnection *active_vpn = nmwa_get_first_active_vpn_connection (applet); + VPNConnection *active_vpn = nma_get_first_active_vpn_connection (applet); if (vpn != active_vpn) { @@ -1320,12 +1320,12 @@ static void nmwa_menu_vpn_item_activate (GtkMenuItem *item, gpointer user_data) reprompt = ! last_attempt_success; /* it's obvious, but.. */ - if ((passwords = nmwa_vpn_request_password (applet, + if ((passwords = nma_vpn_request_password (applet, name, - nmwa_vpn_connection_get_service (vpn), + nma_vpn_connection_get_service (vpn), reprompt)) != NULL) { - nmwa_dbus_vpn_activate_connection (applet->connection, name, passwords); + nma_dbus_vpn_activate_connection (applet->connection, name, passwords); g_slist_foreach (passwords, (GFunc)g_free, NULL); g_slist_free (passwords); @@ -1338,14 +1338,14 @@ static void nmwa_menu_vpn_item_activate (GtkMenuItem *item, gpointer user_data) /* - * nmwa_menu_connect_item_activate + * nma_menu_connect_item_activate * * Signal function called when user clicks on a dialup menu item * */ -static void nmwa_menu_dialup_connect_item_activate (GtkMenuItem *item, gpointer user_data) +static void nma_menu_dialup_connect_item_activate (GtkMenuItem *item, gpointer user_data) { - NMWirelessApplet *applet = (NMWirelessApplet *) user_data; + NMApplet *applet = (NMApplet *) user_data; const char *dialup; g_return_if_fail (item != NULL); @@ -1355,21 +1355,21 @@ static void nmwa_menu_dialup_connect_item_activate (GtkMenuItem *item, gpointer if (!dialup) return; - nmwa_dbus_dialup_activate_connection (applet, dialup); + nma_dbus_dialup_activate_connection (applet, dialup); nmi_dbus_signal_user_interface_activated (applet->connection); } /* - * nmwa_menu_dialup_hangup_activate + * nma_menu_dialup_hangup_activate * * Signal function called when user clicks on a dialup menu item * */ -static void nmwa_menu_dialup_disconnect_item_activate (GtkMenuItem *item, gpointer user_data) +static void nma_menu_dialup_disconnect_item_activate (GtkMenuItem *item, gpointer user_data) { - NMWirelessApplet *applet = (NMWirelessApplet *) user_data; + NMApplet *applet = (NMApplet *) user_data; const char *dialup; g_return_if_fail (item != NULL); @@ -1379,21 +1379,21 @@ static void nmwa_menu_dialup_disconnect_item_activate (GtkMenuItem *item, gpoint if (!dialup) return; - nmwa_dbus_dialup_deactivate_connection (applet, dialup); + nma_dbus_dialup_deactivate_connection (applet, dialup); nmi_dbus_signal_user_interface_activated (applet->connection); } /* - * nmwa_menu_configure_vpn_item_activate + * nma_menu_configure_vpn_item_activate * * Signal function called when user clicks "Configure VPN..." * */ -static void nmwa_menu_configure_vpn_item_activate (GtkMenuItem *item, gpointer user_data) +static void nma_menu_configure_vpn_item_activate (GtkMenuItem *item, gpointer user_data) { - NMWirelessApplet *applet = (NMWirelessApplet *)user_data; + NMApplet *applet = (NMApplet *)user_data; const char *argv[] = { BINDIR "/nm-vpn-properties", NULL}; g_return_if_fail (item != NULL); @@ -1405,29 +1405,29 @@ static void nmwa_menu_configure_vpn_item_activate (GtkMenuItem *item, gpointer u } /* - * nmwa_menu_disconnect_vpn_item_activate + * nma_menu_disconnect_vpn_item_activate * * Signal function called when user clicks "Disconnect VPN..." * */ -static void nmwa_menu_disconnect_vpn_item_activate (GtkMenuItem *item, gpointer user_data) +static void nma_menu_disconnect_vpn_item_activate (GtkMenuItem *item, gpointer user_data) { - NMWirelessApplet *applet = (NMWirelessApplet *)user_data; + NMApplet *applet = (NMApplet *)user_data; g_return_if_fail (item != NULL); g_return_if_fail (applet != NULL); - nmwa_dbus_vpn_deactivate_connection (applet->connection); + nma_dbus_vpn_deactivate_connection (applet->connection); nmi_dbus_signal_user_interface_activated (applet->connection); } /* - * nmwa_menu_add_separator_item + * nma_menu_add_separator_item * */ -static void nmwa_menu_add_separator_item (GtkWidget *menu) +static void nma_menu_add_separator_item (GtkWidget *menu) { GtkWidget *menu_item; menu_item = gtk_separator_menu_item_new (); @@ -1437,12 +1437,12 @@ static void nmwa_menu_add_separator_item (GtkWidget *menu) /* - * nmwa_menu_add_text_item + * nma_menu_add_text_item * * Add a non-clickable text item to a menu * */ -static void nmwa_menu_add_text_item (GtkWidget *menu, char *text) +static void nma_menu_add_text_item (GtkWidget *menu, char *text) { GtkWidget *menu_item; @@ -1458,12 +1458,12 @@ static void nmwa_menu_add_text_item (GtkWidget *menu, char *text) /* - * nmwa_menu_add_device_item + * nma_menu_add_device_item * * Add a network device to the menu * */ -static void nmwa_menu_add_device_item (GtkWidget *menu, NetworkDevice *device, gint n_devices, NMWirelessApplet *applet) +static void nma_menu_add_device_item (GtkWidget *menu, NetworkDevice *device, gint n_devices, NMApplet *applet) { g_return_if_fail (menu != NULL); g_return_if_fail (device != NULL); @@ -1483,7 +1483,7 @@ static void nmwa_menu_add_device_item (GtkWidget *menu, NetworkDevice *device, g g_object_set_data (G_OBJECT (gtk_item), "device", g_strdup (network_device_get_nm_path (device))); g_object_set_data (G_OBJECT (gtk_item), "nm-item-data", item); - g_signal_connect(G_OBJECT (gtk_item), "activate", G_CALLBACK (nmwa_menu_item_activate), applet); + g_signal_connect(G_OBJECT (gtk_item), "activate", G_CALLBACK (nma_menu_item_activate), applet); gtk_menu_shell_append (GTK_MENU_SHELL (menu), GTK_WIDGET (gtk_item)); gtk_widget_show (GTK_WIDGET (gtk_item)); @@ -1505,7 +1505,7 @@ static void nmwa_menu_add_device_item (GtkWidget *menu, NetworkDevice *device, g g_object_set_data (G_OBJECT (gtk_item), "device", g_strdup (network_device_get_nm_path (device))); g_object_set_data (G_OBJECT (gtk_item), "nm-item-data", item); - g_signal_connect(G_OBJECT (gtk_item), "activate", G_CALLBACK (nmwa_menu_item_activate), applet); + g_signal_connect(G_OBJECT (gtk_item), "activate", G_CALLBACK (nma_menu_item_activate), applet); gtk_menu_shell_append (GTK_MENU_SHELL (menu), GTK_WIDGET (gtk_item)); gtk_widget_show (GTK_WIDGET (gtk_item)); @@ -1518,13 +1518,13 @@ static void nmwa_menu_add_device_item (GtkWidget *menu, NetworkDevice *device, g } -static void custom_essid_item_selected (GtkWidget *menu_item, NMWirelessApplet *applet) +static void custom_essid_item_selected (GtkWidget *menu_item, NMApplet *applet) { - nmwa_other_network_dialog_run (applet, FALSE); + nma_other_network_dialog_run (applet, FALSE); } -static void nmwa_menu_add_custom_essid_item (GtkWidget *menu, NMWirelessApplet *applet) +static void nma_menu_add_custom_essid_item (GtkWidget *menu, NMApplet *applet) { GtkWidget *menu_item; GtkWidget *label; @@ -1539,13 +1539,13 @@ static void nmwa_menu_add_custom_essid_item (GtkWidget *menu, NMWirelessApplet * } -static void new_network_item_selected (GtkWidget *menu_item, NMWirelessApplet *applet) +static void new_network_item_selected (GtkWidget *menu_item, NMApplet *applet) { - nmwa_other_network_dialog_run (applet, TRUE); + nma_other_network_dialog_run (applet, TRUE); } -static void nmwa_menu_add_create_network_item (GtkWidget *menu, NMWirelessApplet *applet) +static void nma_menu_add_create_network_item (GtkWidget *menu, NMApplet *applet) { GtkWidget *menu_item; GtkWidget *label; @@ -1562,17 +1562,17 @@ static void nmwa_menu_add_create_network_item (GtkWidget *menu, NMWirelessApplet typedef struct AddNetworksCB { - NMWirelessApplet * applet; + NMApplet * applet; gboolean has_encrypted; GtkWidget * menu; } AddNetworksCB; /* - * nmwa_add_networks_helper + * nma_add_networks_helper * */ -static void nmwa_add_networks_helper (NetworkDevice *dev, WirelessNetwork *net, gpointer user_data) +static void nma_add_networks_helper (NetworkDevice *dev, WirelessNetwork *net, gpointer user_data) { AddNetworksCB * cb_data = (AddNetworksCB *)user_data; NMNetworkMenuItem * item; @@ -1599,17 +1599,17 @@ static void nmwa_add_networks_helper (NetworkDevice *dev, WirelessNetwork *net, g_object_set_data (G_OBJECT (gtk_item), "network", g_strdup (wireless_network_get_essid (net))); g_object_set_data (G_OBJECT (gtk_item), "device", g_strdup (network_device_get_nm_path (dev))); g_object_set_data (G_OBJECT (gtk_item), "nm-item-data", item); - g_signal_connect (G_OBJECT (gtk_item), "activate", G_CALLBACK (nmwa_menu_item_activate), cb_data->applet); + g_signal_connect (G_OBJECT (gtk_item), "activate", G_CALLBACK (nma_menu_item_activate), cb_data->applet); gtk_widget_show (GTK_WIDGET (gtk_item)); } /* - * nmwa_has_encrypted_networks_helper + * nma_has_encrypted_networks_helper * */ -static void nmwa_has_encrypted_networks_helper (NetworkDevice *dev, WirelessNetwork *net, gpointer user_data) +static void nma_has_encrypted_networks_helper (NetworkDevice *dev, WirelessNetwork *net, gpointer user_data) { gboolean *has_encrypted = user_data; int capabilities; @@ -1627,10 +1627,10 @@ static void nmwa_has_encrypted_networks_helper (NetworkDevice *dev, WirelessNetw /* - * nmwa_menu_device_add_networks + * nma_menu_device_add_networks * */ -static void nmwa_menu_device_add_networks (GtkWidget *menu, NetworkDevice *dev, NMWirelessApplet *applet) +static void nma_menu_device_add_networks (GtkWidget *menu, NetworkDevice *dev, NMApplet *applet) { gboolean has_encrypted = FALSE; AddNetworksCB * add_networks_cb = NULL; @@ -1643,7 +1643,7 @@ static void nmwa_menu_device_add_networks (GtkWidget *menu, NetworkDevice *dev, return; /* Check for any security */ - network_device_foreach_wireless_network (dev, nmwa_has_encrypted_networks_helper, &has_encrypted); + network_device_foreach_wireless_network (dev, nma_has_encrypted_networks_helper, &has_encrypted); add_networks_cb = g_malloc0 (sizeof (AddNetworksCB)); add_networks_cb->applet = applet; @@ -1651,17 +1651,17 @@ static void nmwa_menu_device_add_networks (GtkWidget *menu, NetworkDevice *dev, add_networks_cb->menu = menu; /* Add all networks in our network list to the menu */ - network_device_foreach_wireless_network (dev, nmwa_add_networks_helper, add_networks_cb); + network_device_foreach_wireless_network (dev, nma_add_networks_helper, add_networks_cb); g_free (add_networks_cb); } /* - * nmwa_menu_add_devices + * nma_menu_add_devices * */ -static void nmwa_menu_add_vpn_menu (GtkWidget *menu, NMWirelessApplet *applet) +static void nma_menu_add_vpn_menu (GtkWidget *menu, NMApplet *applet) { GtkMenuItem *item; GtkMenu *vpn_menu; @@ -1675,19 +1675,19 @@ static void nmwa_menu_add_vpn_menu (GtkWidget *menu, NMWirelessApplet *applet) item = GTK_MENU_ITEM (gtk_menu_item_new_with_mnemonic (_("_VPN Connections"))); vpn_menu = GTK_MENU (gtk_menu_new ()); - active_vpn = nmwa_get_first_active_vpn_connection (applet); + active_vpn = nma_get_first_active_vpn_connection (applet); for (elt = applet->vpn_connections; elt; elt = g_slist_next (elt)) { GtkCheckMenuItem *vpn_item; VPNConnection *vpn = elt->data; - const char *vpn_name = nmwa_vpn_connection_get_name (vpn); + const char *vpn_name = nma_vpn_connection_get_name (vpn); vpn_item = GTK_CHECK_MENU_ITEM (gtk_check_menu_item_new_with_label (vpn_name)); /* temporarily do this until we support multiple VPN connections */ gtk_check_menu_item_set_draw_as_radio (vpn_item, TRUE); - nmwa_vpn_connection_ref (vpn); + nma_vpn_connection_ref (vpn); g_object_set_data (G_OBJECT (vpn_item), "vpn", vpn); if (active_vpn && active_vpn == vpn) @@ -1696,7 +1696,7 @@ static void nmwa_menu_add_vpn_menu (GtkWidget *menu, NMWirelessApplet *applet) if (applet->nm_state != NM_STATE_CONNECTED) gtk_widget_set_sensitive (GTK_WIDGET (vpn_item), FALSE); - g_signal_connect (G_OBJECT (vpn_item), "activate", G_CALLBACK (nmwa_menu_vpn_item_activate), applet); + g_signal_connect (G_OBJECT (vpn_item), "activate", G_CALLBACK (nma_menu_vpn_item_activate), applet); gtk_menu_shell_append (GTK_MENU_SHELL (vpn_menu), GTK_WIDGET (vpn_item)); } @@ -1708,11 +1708,11 @@ static void nmwa_menu_add_vpn_menu (GtkWidget *menu, NMWirelessApplet *applet) } other_item = GTK_MENU_ITEM (gtk_menu_item_new_with_mnemonic (_("_Configure VPN..."))); - g_signal_connect (G_OBJECT (other_item), "activate", G_CALLBACK (nmwa_menu_configure_vpn_item_activate), applet); + g_signal_connect (G_OBJECT (other_item), "activate", G_CALLBACK (nma_menu_configure_vpn_item_activate), applet); gtk_menu_shell_append (GTK_MENU_SHELL (vpn_menu), GTK_WIDGET (other_item)); other_item = GTK_MENU_ITEM (gtk_menu_item_new_with_mnemonic (_("_Disconnect VPN..."))); - g_signal_connect (G_OBJECT (other_item), "activate", G_CALLBACK (nmwa_menu_disconnect_vpn_item_activate), applet); + g_signal_connect (G_OBJECT (other_item), "activate", G_CALLBACK (nma_menu_disconnect_vpn_item_activate), applet); if (!active_vpn) gtk_widget_set_sensitive (GTK_WIDGET (other_item), FALSE); gtk_menu_shell_append (GTK_MENU_SHELL (vpn_menu), GTK_WIDGET (other_item)); @@ -1724,7 +1724,7 @@ static void nmwa_menu_add_vpn_menu (GtkWidget *menu, NMWirelessApplet *applet) } -static void nmwa_menu_add_dialup_menu (GtkWidget *menu, NMWirelessApplet *applet) +static void nma_menu_add_dialup_menu (GtkWidget *menu, NMApplet *applet) { GtkMenuItem *item; GtkMenu *dialup_menu; @@ -1747,13 +1747,13 @@ static void nmwa_menu_add_dialup_menu (GtkWidget *menu, NMWirelessApplet *applet label = g_strdup_printf (_("Connect to %s..."), name); connect_item = GTK_MENU_ITEM (gtk_menu_item_new_with_label (label)); g_object_set_data (G_OBJECT (connect_item), "dialup", name); - g_signal_connect (G_OBJECT (connect_item), "activate", G_CALLBACK (nmwa_menu_dialup_connect_item_activate), applet); + g_signal_connect (G_OBJECT (connect_item), "activate", G_CALLBACK (nma_menu_dialup_connect_item_activate), applet); gtk_menu_shell_append (GTK_MENU_SHELL (dialup_menu), GTK_WIDGET (connect_item)); label = g_strdup_printf (_("Disconnect from %s..."), name); disconnect_item = GTK_MENU_ITEM (gtk_menu_item_new_with_label (label)); g_object_set_data (G_OBJECT (disconnect_item), "dialup", name); - g_signal_connect (G_OBJECT (disconnect_item), "activate", G_CALLBACK (nmwa_menu_dialup_disconnect_item_activate), applet); + g_signal_connect (G_OBJECT (disconnect_item), "activate", G_CALLBACK (nma_menu_dialup_disconnect_item_activate), applet); gtk_menu_shell_append (GTK_MENU_SHELL (dialup_menu), GTK_WIDGET (disconnect_item)); } @@ -1784,10 +1784,10 @@ static gboolean is_vpn_available (void) } /* - * nmwa_menu_add_devices + * nma_menu_add_devices * */ -static void nmwa_menu_add_devices (GtkWidget *menu, NMWirelessApplet *applet) +static void nma_menu_add_devices (GtkWidget *menu, NMApplet *applet) { GSList *element; gint n_wireless_interfaces = 0; @@ -1799,13 +1799,13 @@ static void nmwa_menu_add_devices (GtkWidget *menu, NMWirelessApplet *applet) if (!applet->device_list) { - nmwa_menu_add_text_item (menu, _("No network devices have been found")); + nma_menu_add_text_item (menu, _("No network devices have been found")); return; } if (applet->nm_state == NM_STATE_ASLEEP) { - nmwa_menu_add_text_item (menu, _("Networking disabled")); + nma_menu_add_text_item (menu, _("Networking disabled")); return; } @@ -1861,8 +1861,8 @@ static void nmwa_menu_add_devices (GtkWidget *menu, NMWirelessApplet *applet) if (n_devices >= 0) { - nmwa_menu_add_device_item (menu, dev, n_devices, applet); - nmwa_menu_device_add_networks (menu, dev, applet); + nma_menu_add_device_item (menu, dev, n_devices, applet); + nma_menu_device_add_networks (menu, dev, applet); } } } @@ -1872,24 +1872,24 @@ static void nmwa_menu_add_devices (GtkWidget *menu, NMWirelessApplet *applet) dialup_available = !! applet->dialup_list; if (vpn_available || dialup_available) { - nmwa_menu_add_separator_item (menu); + nma_menu_add_separator_item (menu); if (vpn_available) - nmwa_menu_add_vpn_menu (menu, applet); + nma_menu_add_vpn_menu (menu, applet); if (dialup_available) - nmwa_menu_add_dialup_menu (menu, applet); + nma_menu_add_dialup_menu (menu, applet); } if (n_wireless_interfaces > 0 && applet->wireless_enabled) { /* Add the "Other wireless network..." entry */ - nmwa_menu_add_separator_item (menu); - nmwa_menu_add_custom_essid_item (menu, applet); - nmwa_menu_add_create_network_item (menu, applet); + nma_menu_add_separator_item (menu); + nma_menu_add_custom_essid_item (menu, applet); + nma_menu_add_create_network_item (menu, applet); } } -static void nmwa_set_wireless_enabled_cb (GtkWidget *widget, NMWirelessApplet *applet) +static void nma_set_wireless_enabled_cb (GtkWidget *widget, NMApplet *applet) { gboolean state; @@ -1897,11 +1897,11 @@ static void nmwa_set_wireless_enabled_cb (GtkWidget *widget, NMWirelessApplet *a state = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)); if (applet->wireless_enabled != state) - nmwa_dbus_enable_wireless (applet, state); + nma_dbus_enable_wireless (applet, state); } -static void nmwa_set_networking_enabled_cb (GtkWidget *widget, NMWirelessApplet *applet) +static void nma_set_networking_enabled_cb (GtkWidget *widget, NMApplet *applet) { gboolean state; @@ -1909,17 +1909,17 @@ static void nmwa_set_networking_enabled_cb (GtkWidget *widget, NMWirelessApplet state = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)); if ((applet->nm_state == NM_STATE_ASLEEP && state) || (applet->nm_state != NM_STATE_ASLEEP && !state)) - nmwa_dbus_enable_networking (applet, state); + nma_dbus_enable_networking (applet, state); } /* - * nmwa_menu_item_data_free + * nma_menu_item_data_free * * Frees the "network" data tag on a menu item we've created * */ -static void nmwa_menu_item_data_free (GtkWidget *menu_item, gpointer data) +static void nma_menu_item_data_free (GtkWidget *menu_item, gpointer data) { char *tag; GtkMenu *menu; @@ -1948,7 +1948,7 @@ static void nmwa_menu_item_data_free (GtkWidget *menu_item, gpointer data) if ((tag = g_object_get_data (G_OBJECT (menu_item), "vpn"))) { g_object_set_data (G_OBJECT (menu_item), "vpn", NULL); - nmwa_vpn_connection_unref ((VPNConnection *)tag); + nma_vpn_connection_unref ((VPNConnection *)tag); } if ((tag = g_object_get_data (G_OBJECT (menu_item), "disconnect"))) @@ -1958,52 +1958,52 @@ static void nmwa_menu_item_data_free (GtkWidget *menu_item, gpointer data) } if ((menu = GTK_MENU (gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item))))) - gtk_container_foreach (GTK_CONTAINER (menu), nmwa_menu_item_data_free, menu); + gtk_container_foreach (GTK_CONTAINER (menu), nma_menu_item_data_free, menu); gtk_widget_destroy (menu_item); } /* - * nmwa_dispose_menu_items + * nma_dispose_menu_items * * Destroy the menu and each of its items data tags * */ -static void nmwa_dropdown_menu_clear (GtkWidget *menu) +static void nma_dropdown_menu_clear (GtkWidget *menu) { g_return_if_fail (menu != NULL); /* Free the "network" data on each menu item, and destroy the item */ - gtk_container_foreach (GTK_CONTAINER (menu), nmwa_menu_item_data_free, menu); + gtk_container_foreach (GTK_CONTAINER (menu), nma_menu_item_data_free, menu); } /* - * nmwa_dropdown_menu_populate + * nma_dropdown_menu_populate * * Set up our networks menu from scratch * */ -static void nmwa_dropdown_menu_populate (GtkWidget *menu, NMWirelessApplet *applet) +static void nma_dropdown_menu_populate (GtkWidget *menu, NMApplet *applet) { g_return_if_fail (menu != NULL); g_return_if_fail (applet != NULL); if (!applet->nm_running) - nmwa_menu_add_text_item (menu, _("NetworkManager is not running...")); + nma_menu_add_text_item (menu, _("NetworkManager is not running...")); else - nmwa_menu_add_devices (menu, applet); + nma_menu_add_devices (menu, applet); } /* - * nmwa_dropdown_menu_show_cb + * nma_dropdown_menu_show_cb * * Pop up the wireless networks menu * */ -static void nmwa_dropdown_menu_show_cb (GtkWidget *menu, NMWirelessApplet *applet) +static void nma_dropdown_menu_show_cb (GtkWidget *menu, NMApplet *applet) { g_return_if_fail (menu != NULL); g_return_if_fail (applet != NULL); @@ -2014,8 +2014,8 @@ static void nmwa_dropdown_menu_show_cb (GtkWidget *menu, NMWirelessApplet *apple if (applet->dropdown_menu && (menu == applet->dropdown_menu)) { - nmwa_dropdown_menu_clear (applet->dropdown_menu); - nmwa_dropdown_menu_populate (applet->dropdown_menu, applet); + nma_dropdown_menu_clear (applet->dropdown_menu); + nma_dropdown_menu_populate (applet->dropdown_menu, applet); gtk_widget_show_all (applet->dropdown_menu); } @@ -2023,12 +2023,12 @@ static void nmwa_dropdown_menu_show_cb (GtkWidget *menu, NMWirelessApplet *apple } /* - * nmwa_dropdown_menu_create + * nma_dropdown_menu_create * * Create the applet's dropdown menu * */ -static GtkWidget *nmwa_dropdown_menu_create (GtkMenuItem *parent, NMWirelessApplet *applet) +static GtkWidget *nma_dropdown_menu_create (GtkMenuItem *parent, NMApplet *applet) { GtkWidget *menu; @@ -2038,17 +2038,17 @@ static GtkWidget *nmwa_dropdown_menu_create (GtkMenuItem *parent, NMWirelessAppl menu = gtk_menu_new (); gtk_container_set_border_width (GTK_CONTAINER (menu), 0); gtk_menu_item_set_submenu (GTK_MENU_ITEM (parent), menu); - g_signal_connect (menu, "show", G_CALLBACK (nmwa_dropdown_menu_show_cb), applet); + g_signal_connect (menu, "show", G_CALLBACK (nma_dropdown_menu_show_cb), applet); return menu; } /* - * nmwa_context_menu_update + * nma_context_menu_update * */ -static void nmwa_context_menu_update (NMWirelessApplet *applet) +static void nma_context_menu_update (NMApplet *applet) { GSList *element; gboolean have_wireless = FALSE; @@ -2059,7 +2059,7 @@ static void nmwa_context_menu_update (NMWirelessApplet *applet) g_return_if_fail (applet->stop_wireless_item != NULL); g_return_if_fail (applet->info_menu_item != NULL); - if ((dev = nmwa_get_first_active_device (applet->device_list))) + if ((dev = nma_get_first_active_device (applet->device_list))) iface = network_device_get_iface (dev); if (!dev || !iface) @@ -2088,55 +2088,55 @@ static void nmwa_context_menu_update (NMWirelessApplet *applet) /* - * nmwa_enable_wireless_set_active + * nma_enable_wireless_set_active * * Set the 'Enable Wireless' menu item state to match the daemon's last DBUS * message. We cannot just do this at menu creation time because the DBUS * message might not have been sent yet or in case the daemon state changes * out from under us. */ -void nmwa_enable_wireless_set_active (NMWirelessApplet *applet) +void nma_enable_wireless_set_active (NMApplet *applet) { gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (applet->stop_wireless_item), applet->wireless_enabled); } /* - * nmwa_enable_networking_set_active + * nma_enable_networking_set_active * * Set the 'Enable Networking' menu item state to match the daemon's last DBUS * message. We cannot just do this at menu creation time because the DBUS * message might not have been sent yet or in case the daemon state changes * out from under us. */ -static inline void nmwa_enable_networking_set_active (NMWirelessApplet *applet) +static inline void nma_enable_networking_set_active (NMApplet *applet) { gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (applet->enable_networking_item), applet->nm_state != NM_STATE_ASLEEP); } /* - * nmwa_set_state + * nma_set_state * * Set the applet's state to one of the NMState enumerations. * */ -void nmwa_set_state (NMWirelessApplet *applet, enum NMState state) +void nma_set_state (NMApplet *applet, enum NMState state) { g_return_if_fail (applet != NULL); g_return_if_fail (state <= NM_STATE_DISCONNECTED); applet->nm_state = state; - nmwa_enable_networking_set_active (applet); + nma_enable_networking_set_active (applet); } /* - * nmwa_context_menu_create + * nma_context_menu_create * * Generate the contextual popup menu. * */ -static GtkWidget *nmwa_context_menu_create (NMWirelessApplet *applet) +static GtkWidget *nma_context_menu_create (NMApplet *applet) { GtkWidget *menu; GtkWidget *menu_item; @@ -2148,30 +2148,30 @@ static GtkWidget *nmwa_context_menu_create (NMWirelessApplet *applet) /* 'Enable Networking' item */ applet->enable_networking_item = gtk_check_menu_item_new_with_mnemonic (_("Enable _Networking")); - nmwa_enable_networking_set_active (applet); - g_signal_connect (G_OBJECT (applet->enable_networking_item), "toggled", G_CALLBACK (nmwa_set_networking_enabled_cb), applet); + nma_enable_networking_set_active (applet); + g_signal_connect (G_OBJECT (applet->enable_networking_item), "toggled", G_CALLBACK (nma_set_networking_enabled_cb), applet); gtk_menu_shell_append (GTK_MENU_SHELL (menu), applet->enable_networking_item); /* 'Enable Wireless' item */ applet->stop_wireless_item = gtk_check_menu_item_new_with_mnemonic (_("Enable _Wireless")); - nmwa_enable_wireless_set_active (applet); - g_signal_connect (G_OBJECT (applet->stop_wireless_item), "toggled", G_CALLBACK (nmwa_set_wireless_enabled_cb), applet); + nma_enable_wireless_set_active (applet); + g_signal_connect (G_OBJECT (applet->stop_wireless_item), "toggled", G_CALLBACK (nma_set_wireless_enabled_cb), applet); gtk_menu_shell_append (GTK_MENU_SHELL (menu), applet->stop_wireless_item); /* 'Connection Information' item */ applet->info_menu_item = gtk_image_menu_item_new_with_mnemonic (_("Connection _Information")); - g_signal_connect (G_OBJECT (applet->info_menu_item), "activate", G_CALLBACK (nmwa_show_info_cb), applet); + g_signal_connect (G_OBJECT (applet->info_menu_item), "activate", G_CALLBACK (nma_show_info_cb), applet); image = gtk_image_new_from_stock (GTK_STOCK_INFO, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (applet->info_menu_item), image); gtk_menu_shell_append (GTK_MENU_SHELL (menu), applet->info_menu_item); /* Separator */ - nmwa_menu_add_separator_item (menu); + nma_menu_add_separator_item (menu); -#if 0 /* FIXME: Implement the help callback, nmwa_help_cb()! */ +#if 0 /* FIXME: Implement the help callback, nma_help_cb()! */ /* Help item */ menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Help")); - g_signal_connect (G_OBJECT (menu_item), "activate", G_CALLBACK (nmwa_help_cb), applet); + g_signal_connect (G_OBJECT (menu_item), "activate", G_CALLBACK (nma_help_cb), applet); image = gtk_image_new_from_stock (GTK_STOCK_HELP, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); @@ -2180,7 +2180,7 @@ static GtkWidget *nmwa_context_menu_create (NMWirelessApplet *applet) /* About item */ menu_item = gtk_image_menu_item_new_with_mnemonic (_("_About")); - g_signal_connect (G_OBJECT (menu_item), "activate", G_CALLBACK (nmwa_about_cb), applet); + g_signal_connect (G_OBJECT (menu_item), "activate", G_CALLBACK (nma_about_cb), applet); image = gtk_image_new_from_stock (GTK_STOCK_ABOUT, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); @@ -2192,38 +2192,38 @@ static GtkWidget *nmwa_context_menu_create (NMWirelessApplet *applet) /* - * nmwa_theme_change_cb + * nma_theme_change_cb * * Destroy the popdown menu when the theme changes * */ -static void nmwa_theme_change_cb (NMWirelessApplet *applet) +static void nma_theme_change_cb (NMApplet *applet) { g_return_if_fail (applet != NULL); if (applet->dropdown_menu) - nmwa_dropdown_menu_clear (applet->dropdown_menu); + nma_dropdown_menu_clear (applet->dropdown_menu); if (applet->top_menu_item) { gtk_menu_item_remove_submenu (GTK_MENU_ITEM (applet->top_menu_item)); - applet->dropdown_menu = nmwa_dropdown_menu_create (GTK_MENU_ITEM (applet->top_menu_item), applet); - g_signal_connect (applet->dropdown_menu, "deactivate", G_CALLBACK (nmwa_dropdown_menu_deactivate_cb), applet); + applet->dropdown_menu = nma_dropdown_menu_create (GTK_MENU_ITEM (applet->top_menu_item), applet); + g_signal_connect (applet->dropdown_menu, "deactivate", G_CALLBACK (nma_dropdown_menu_deactivate_cb), applet); } } /* - * nmwa_menu_position_func + * nma_menu_position_func * * Position main dropdown menu, adapted from netapplet * */ -static void nmwa_menu_position_func (GtkMenu *menu G_GNUC_UNUSED, int *x, int *y, gboolean *push_in, gpointer user_data) +static void nma_menu_position_func (GtkMenu *menu G_GNUC_UNUSED, int *x, int *y, gboolean *push_in, gpointer user_data) { int screen_w, screen_h, button_x, button_y, panel_w, panel_h; GtkRequisition requisition; GdkScreen *screen; - NMWirelessApplet *applet = (NMWirelessApplet *)user_data; + NMApplet *applet = (NMApplet *)user_data; screen = gtk_widget_get_screen (applet->event_box); screen_w = gdk_screen_get_width (screen); @@ -2245,12 +2245,12 @@ static void nmwa_menu_position_func (GtkMenu *menu G_GNUC_UNUSED, int *x, int *y } /* - * nmwa_toplevel_menu_button_press_cb + * nma_toplevel_menu_button_press_cb * * Handle left/right-clicks for the dropdown and context popup menus * */ -static gboolean nmwa_toplevel_menu_button_press_cb (GtkWidget *widget, GdkEventButton *event, NMWirelessApplet *applet) +static gboolean nma_toplevel_menu_button_press_cb (GtkWidget *widget, GdkEventButton *event, NMApplet *applet) { g_return_val_if_fail (applet != NULL, FALSE); @@ -2258,11 +2258,11 @@ static gboolean nmwa_toplevel_menu_button_press_cb (GtkWidget *widget, GdkEventB { case 1: gtk_widget_set_state (applet->event_box, GTK_STATE_SELECTED); - gtk_menu_popup (GTK_MENU (applet->dropdown_menu), NULL, NULL, nmwa_menu_position_func, applet, event->button, event->time); + gtk_menu_popup (GTK_MENU (applet->dropdown_menu), NULL, NULL, nma_menu_position_func, applet, event->button, event->time); return TRUE; case 3: - nmwa_context_menu_update (applet); - gtk_menu_popup (GTK_MENU (applet->context_menu), NULL, NULL, nmwa_menu_position_func, applet, event->button, event->time); + nma_context_menu_update (applet); + gtk_menu_popup (GTK_MENU (applet->context_menu), NULL, NULL, nma_menu_position_func, applet, event->button, event->time); return TRUE; default: g_signal_stop_emission_by_name (widget, "button_press_event"); @@ -2274,12 +2274,12 @@ static gboolean nmwa_toplevel_menu_button_press_cb (GtkWidget *widget, GdkEventB /* - * nmwa_toplevel_menu_button_press_cb + * nma_toplevel_menu_button_press_cb * * Handle left-unclick on the dropdown menu. * */ -static void nmwa_dropdown_menu_deactivate_cb (GtkWidget *menu, NMWirelessApplet *applet) +static void nma_dropdown_menu_deactivate_cb (GtkWidget *menu, NMApplet *applet) { g_return_if_fail (applet != NULL); @@ -2289,13 +2289,13 @@ static void nmwa_dropdown_menu_deactivate_cb (GtkWidget *menu, NMWirelessApplet /* - * nmwa_setup_widgets + * nma_setup_widgets * * Intialize the applet's widgets and packing, create the initial * menu of networks. * */ -static void nmwa_setup_widgets (NMWirelessApplet *applet) +static void nma_setup_widgets (NMApplet *applet) { /* Event box is the main applet widget */ applet->event_box = gtk_event_box_new (); @@ -2310,24 +2310,24 @@ static void nmwa_setup_widgets (NMWirelessApplet *applet) gtk_container_add (GTK_CONTAINER (applet), applet->event_box); gtk_widget_show_all (GTK_WIDGET (applet)); - applet->dropdown_menu = nmwa_dropdown_menu_create (GTK_MENU_ITEM (applet->top_menu_item), applet); - g_signal_connect (applet->event_box, "button_press_event", G_CALLBACK (nmwa_toplevel_menu_button_press_cb), applet); - g_signal_connect (applet->dropdown_menu, "deactivate", G_CALLBACK (nmwa_dropdown_menu_deactivate_cb), applet); + applet->dropdown_menu = nma_dropdown_menu_create (GTK_MENU_ITEM (applet->top_menu_item), applet); + g_signal_connect (applet->event_box, "button_press_event", G_CALLBACK (nma_toplevel_menu_button_press_cb), applet); + g_signal_connect (applet->dropdown_menu, "deactivate", G_CALLBACK (nma_dropdown_menu_deactivate_cb), applet); - applet->context_menu = nmwa_context_menu_create (applet); + applet->context_menu = nma_context_menu_create (applet); applet->encryption_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); } /* - * nmwa_gconf_info_notify_callback + * nma_gconf_info_notify_callback * * Callback from gconf when wireless key/values have changed. * */ -static void nmwa_gconf_info_notify_callback (GConfClient *client, guint connection_id, GConfEntry *entry, gpointer user_data) +static void nma_gconf_info_notify_callback (GConfClient *client, guint connection_id, GConfEntry *entry, gpointer user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *)user_data; + NMApplet * applet = (NMApplet *)user_data; const char * key = NULL; g_return_if_fail (client != NULL); @@ -2360,17 +2360,17 @@ static void nmwa_gconf_info_notify_callback (GConfClient *client, guint connecti /* - * nmwa_gconf_vpn_connections_notify_callback + * nma_gconf_vpn_connections_notify_callback * * Callback from gconf when VPN connection values have changed. * */ -static void nmwa_gconf_vpn_connections_notify_callback (GConfClient *client, guint connection_id, GConfEntry *entry, gpointer user_data) +static void nma_gconf_vpn_connections_notify_callback (GConfClient *client, guint connection_id, GConfEntry *entry, gpointer user_data) { - NMWirelessApplet * applet = (NMWirelessApplet *)user_data; + NMApplet * applet = (NMApplet *)user_data; const char * key = NULL; - /*g_debug ("Entering nmwa_gconf_vpn_connections_notify_callback, key='%s'", gconf_entry_get_key (entry));*/ + /*g_debug ("Entering nma_gconf_vpn_connections_notify_callback, key='%s'", gconf_entry_get_key (entry));*/ g_return_if_fail (client != NULL); g_return_if_fail (entry != NULL); @@ -2401,7 +2401,7 @@ static void nmwa_gconf_vpn_connections_notify_callback (GConfClient *client, gui value = gconf_client_get (client, name_path, NULL); if (value == NULL) { /*g_debug ("removing '%s' from UI", name_path);*/ - nmwa_dbus_vpn_remove_one_vpn_connection (applet, unescaped_name); + nma_dbus_vpn_remove_one_vpn_connection (applet, unescaped_name); } else { gconf_value_free (value); } @@ -2418,20 +2418,20 @@ static void nmwa_gconf_vpn_connections_notify_callback (GConfClient *client, gui /* - * nmwa_destroy + * nma_destroy * * Destroy the applet and clean up its data * */ static void G_GNUC_NORETURN -nmwa_destroy (NMWirelessApplet *applet, gpointer user_data) +nma_destroy (NMApplet *applet, gpointer user_data) { if (applet->dropdown_menu) - nmwa_dropdown_menu_clear (applet->dropdown_menu); + nma_dropdown_menu_clear (applet->dropdown_menu); if (applet->top_menu_item) gtk_menu_item_remove_submenu (GTK_MENU_ITEM (applet->top_menu_item)); - nmwa_icons_free (applet); + nma_icons_free (applet); nmi_passphrase_dialog_destroy (applet); @@ -2444,7 +2444,7 @@ nmwa_destroy (NMWirelessApplet *applet, gpointer user_data) if (applet->gconf_client) g_object_unref (G_OBJECT (applet->gconf_client)); - nmwa_free_data_model (applet); + nma_free_data_model (applet); g_free (applet->glade_file); @@ -2459,12 +2459,12 @@ nmwa_destroy (NMWirelessApplet *applet, gpointer user_data) /* - * nmwa_get_instance + * nma_get_instance * * Create the initial instance of our wireless applet * */ -static GtkWidget * nmwa_get_instance (NMWirelessApplet *applet) +static GtkWidget * nma_get_instance (NMApplet *applet) { gtk_widget_hide (GTK_WIDGET (applet)); @@ -2475,10 +2475,10 @@ static GtkWidget * nmwa_get_instance (NMWirelessApplet *applet) applet->nm_state = NM_STATE_DISCONNECTED; applet->tooltips = NULL; applet->passphrase_dialog = NULL; - applet->glade_file = g_build_filename (GLADEDIR, "wireless-applet.glade", NULL); + applet->glade_file = g_build_filename (GLADEDIR, "applet.glade", NULL); if (!applet->glade_file || !g_file_test (applet->glade_file, G_FILE_TEST_IS_REGULAR)) { - 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).")); g_free (applet->glade_file); applet->glade_file = NULL; return NULL; @@ -2492,11 +2492,11 @@ static GtkWidget * nmwa_get_instance (NMWirelessApplet *applet) gconf_client_add_dir (applet->gconf_client, GCONF_PATH_WIRELESS, GCONF_CLIENT_PRELOAD_NONE, NULL); applet->gconf_prefs_notify_id = gconf_client_notify_add (applet->gconf_client, GCONF_PATH_WIRELESS, - nmwa_gconf_info_notify_callback, applet, NULL, NULL); + nma_gconf_info_notify_callback, applet, NULL, NULL); gconf_client_add_dir (applet->gconf_client, GCONF_PATH_VPN_CONNECTIONS, GCONF_CLIENT_PRELOAD_NONE, NULL); applet->gconf_vpn_notify_id = gconf_client_notify_add (applet->gconf_client, GCONF_PATH_VPN_CONNECTIONS, - nmwa_gconf_vpn_connections_notify_callback, applet, NULL, NULL); + nma_gconf_vpn_connections_notify_callback, applet, NULL, NULL); /* Convert old-format stored network entries to the new format. * Must be RUN BEFORE DBUS INITIALIZATION since we have to do @@ -2504,22 +2504,22 @@ static GtkWidget * nmwa_get_instance (NMWirelessApplet *applet) */ nma_compat_convert_oldformat_entries (applet->gconf_client); - nmwa_dbus_init_helper (applet); + nma_dbus_init_helper (applet); /* Load pixmaps and create applet widgets */ - nmwa_setup_widgets (applet); + nma_setup_widgets (applet); - g_signal_connect (applet, "destroy", G_CALLBACK (nmwa_destroy), NULL); - g_signal_connect (applet, "style-set", G_CALLBACK (nmwa_theme_change_cb), NULL); + g_signal_connect (applet, "destroy", G_CALLBACK (nma_destroy), NULL); + g_signal_connect (applet, "style-set", G_CALLBACK (nma_theme_change_cb), NULL); /* Start redraw timeout */ - applet->redraw_timeout_id = g_timeout_add (1000, (GtkFunction) nmwa_redraw_timeout, applet); + applet->redraw_timeout_id = g_timeout_add (1000, (GtkFunction) nma_redraw_timeout, applet); return GTK_WIDGET (applet); } -static void nmwa_icons_free (NMWirelessApplet *applet) +static void nma_icons_free (NMApplet *applet) { gint i,j; @@ -2555,7 +2555,7 @@ static void nmwa_icons_free (NMWirelessApplet *applet) } static gboolean -nmwa_icons_load_from_disk (NMWirelessApplet *applet, GtkIconTheme *icon_theme) +nma_icons_load_from_disk (NMApplet *applet, GtkIconTheme *icon_theme) { char * name; int i, j; @@ -2599,20 +2599,20 @@ out: { char *msg = g_strdup(_("The NetworkManager applet could not find some required resources. It cannot continue.\n")); show_warning_dialog (msg); - nmwa_icons_free (applet); + nma_icons_free (applet); } return success; } -static void nmwa_icon_theme_changed (GtkIconTheme *icon_theme, NMWirelessApplet *applet) +static void nma_icon_theme_changed (GtkIconTheme *icon_theme, NMApplet *applet) { - nmwa_icons_free (applet); - nmwa_icons_load_from_disk (applet, icon_theme); + nma_icons_free (applet); + nma_icons_load_from_disk (applet, icon_theme); /* FIXME: force redraw */ } -static gboolean nmwa_icons_init (NMWirelessApplet *applet) +static gboolean nma_icons_init (NMApplet *applet) { GtkIconTheme *icon_theme; const gchar *style = " \ @@ -2634,15 +2634,15 @@ static gboolean nmwa_icons_init (NMWirelessApplet *applet) gtk_rc_parse_string (style); icon_theme = gtk_icon_theme_get_default (); - if (!nmwa_icons_load_from_disk (applet, icon_theme)) + if (!nma_icons_load_from_disk (applet, icon_theme)) return FALSE; - g_signal_connect (icon_theme, "changed", G_CALLBACK (nmwa_icon_theme_changed), applet); + g_signal_connect (icon_theme, "changed", G_CALLBACK (nma_icon_theme_changed), applet); return TRUE; } -NMWirelessApplet *nmwa_new () +NMApplet *nma_new () { - return g_object_new (NM_TYPE_WIRELESS_APPLET, "title", "NetworkManager", NULL); + return g_object_new (NM_TYPE_APPLET, "title", "NetworkManager", NULL); } diff --git a/gnome/applet/wireless-applet.glade b/gnome/applet/applet.glade similarity index 100% rename from gnome/applet/wireless-applet.glade rename to gnome/applet/applet.glade diff --git a/gnome/applet/applet.h b/gnome/applet/applet.h index c5c251aed0..16334c2672 100644 --- a/gnome/applet/applet.h +++ b/gnome/applet/applet.h @@ -46,24 +46,17 @@ typedef struct VPNConnection VPNConnection; -enum NMWAEncryptionKeyTypes -{ - KEY_TYPE_128_BIT_PASSPHRASE = 0, - KEY_TYPE_ASCII_KEY = 1, - KEY_TYPE_HEX_KEY = 2 -}; - -#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)) +#define NM_TYPE_APPLET (nma_get_type()) +#define NM_APPLET(object) (G_TYPE_CHECK_INSTANCE_CAST((object), NM_TYPE_APPLET, NMApplet)) +#define NM_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_APPLET, NMAppletClass)) +#define NM_IS_APPLET(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), NM_TYPE_APPLET)) +#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)) typedef struct { EggTrayIconClass parent_class; -} NMWirelessAppletClass; +} NMAppletClass; /* * Applet instance data @@ -126,28 +119,28 @@ typedef struct GtkWidget * passphrase_dialog; GladeXML * info_dialog_xml; -} NMWirelessApplet; +} NMApplet; typedef struct { - NMWirelessApplet * applet; + NMApplet * applet; NetworkDevice * dev; GladeXML * xml; } DriverNotifyCBData; -NetworkDevice * nmwa_get_device_for_nm_path (GSList *dev_list, const char *nm_dev); -NMWirelessApplet * nmwa_new (void); -void nmwa_schedule_warning_dialog (NMWirelessApplet *applet, const char *msg); -gboolean nmwa_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 nmwa_show_vpn_login_banner (NMWirelessApplet *applet, const char *vpn_name, const char *banner); +NetworkDevice * nma_get_device_for_nm_path (GSList *dev_list, const char *nm_dev); +NMApplet * nma_new (void); +void nma_schedule_warning_dialog (NMApplet *applet, const char *msg); +gboolean nma_driver_notify (gpointer user_data); +void nma_show_vpn_failure_alert (NMApplet *applet, const char *member, const char *vpn_name, const char *error_msg); +void nma_show_vpn_login_banner (NMApplet *applet, const char *vpn_name, const char *banner); -NetworkDevice * nmwa_get_first_active_device (GSList *dev_list); -VPNConnection * nmwa_get_first_active_vpn_connection (NMWirelessApplet *applet); +NetworkDevice * nma_get_first_active_device (GSList *dev_list); +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); diff --git a/gnome/applet/main.c b/gnome/applet/main.c index 49ade58c3b..f53197ecc4 100644 --- a/gnome/applet/main.c +++ b/gnome/applet/main.c @@ -44,8 +44,8 @@ static gboolean session_save (GnomeClient *client, gpointer client_data) int main (int argc, char *argv[]) { - NMWirelessApplet * nmwa; - GnomeClient * client = NULL; + NMApplet * nma; + GnomeClient * client = NULL; gnome_program_init ("nm-applet", VERSION, LIBGNOMEUI_MODULE, argc, argv, @@ -61,9 +61,9 @@ int main (int argc, char *argv[]) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 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 (); } diff --git a/gnome/applet/other-network-dialog.c b/gnome/applet/other-network-dialog.c index cfb54ce578..e66cf49bd7 100644 --- a/gnome/applet/other-network-dialog.c +++ b/gnome/applet/other-network-dialog.c @@ -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 * 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; 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 * 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; WirelessSecurityManager * wsm; @@ -182,7 +182,7 @@ static void nmwa_ond_security_combo_changed (GtkWidget *combo, gpointer user_dat update_button_cb (NULL, dialog); } -static GtkTreeModel * create_wireless_adapter_model (NMWirelessApplet *applet) +static GtkTreeModel * create_wireless_adapter_model (NMApplet *applet) { GtkListStore * model; 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; 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"); gtk_combo_box_set_model (GTK_COMBO_BOX (combo), model); 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) { @@ -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")); wsm_update_combo (wsm, security_combo); - g_signal_connect (G_OBJECT (security_combo), "changed", GTK_SIGNAL_FUNC (nmwa_ond_security_combo_changed), dialog); - nmwa_ond_security_combo_changed (GTK_WIDGET (security_combo), dialog); + g_signal_connect (G_OBJECT (security_combo), "changed", GTK_SIGNAL_FUNC (nma_ond_security_combo_changed), dialog); + nma_ond_security_combo_changed (GTK_WIDGET (security_combo), dialog); 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; - NMWirelessApplet * applet; + NMApplet * applet; gboolean create_network; GtkTreeModel * model; GtkComboBox * combo; WirelessSecurityManager *wsm; 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")); 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); if (create_network) - nmwa_dbus_create_network (applet->connection, dev, essid, opt); + nma_dbus_create_network (applet->connection, dev, essid, opt); 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; 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))) { - 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; } - if (!(dialog = GTK_WIDGET (nmwa_ond_init (xml, applet, create_network)))) + if (!(dialog = GTK_WIDGET (nma_ond_init (xml, applet, create_network)))) 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_widget_realize (dialog); diff --git a/gnome/applet/other-network-dialog.h b/gnome/applet/other-network-dialog.h index 8dc55f5344..ad8090de9e 100644 --- a/gnome/applet/other-network-dialog.h +++ b/gnome/applet/other-network-dialog.h @@ -25,6 +25,6 @@ #ifndef 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 diff --git a/gnome/applet/passphrase-dialog.c b/gnome/applet/passphrase-dialog.c index a2c16e9759..efb1b88882 100644 --- a/gnome/applet/passphrase-dialog.c +++ b/gnome/applet/passphrase-dialog.c @@ -127,7 +127,7 @@ nmi_passphrase_dialog_response_received (GtkWidget *dialog, gint response, gpointer user_data) { - NMWirelessApplet * applet; + NMApplet * applet; GladeXML * xml; GtkComboBox * security_combo; DBusMessage * message; @@ -139,7 +139,7 @@ nmi_passphrase_dialog_response_received (GtkWidget *dialog, message = (DBusMessage *) g_object_get_data (G_OBJECT (dialog), "dbus-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); if (response != GTK_RESPONSE_OK) @@ -180,7 +180,7 @@ out: * to the given UID. */ GtkWidget * -nmi_passphrase_dialog_new (NMWirelessApplet *applet, +nmi_passphrase_dialog_new (NMApplet *applet, guint32 uid, NetworkDevice *dev, WirelessNetwork *net, @@ -224,7 +224,7 @@ nmi_passphrase_dialog_new (NMWirelessApplet *applet, 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); return NULL; } @@ -280,7 +280,7 @@ nmi_passphrase_dialog_new (NMWirelessApplet *applet, * Dispose of the passphrase dialog and its data * */ -void nmi_passphrase_dialog_destroy (NMWirelessApplet *applet) +void nmi_passphrase_dialog_destroy (NMApplet *applet) { char * data; GtkWidget * dialog; diff --git a/gnome/applet/passphrase-dialog.h b/gnome/applet/passphrase-dialog.h index 5cc05a9ca7..297867a34e 100644 --- a/gnome/applet/passphrase-dialog.h +++ b/gnome/applet/passphrase-dialog.h @@ -26,13 +26,13 @@ #include "nm-device.h" #include "wireless-network.h" -GtkWidget * nmi_passphrase_dialog_new (NMWirelessApplet *applet, +GtkWidget * nmi_passphrase_dialog_new (NMApplet *applet, guint32 uid, NetworkDevice *dev, WirelessNetwork *net, DBusMessage *message); -void nmi_passphrase_dialog_destroy (NMWirelessApplet *applet); +void nmi_passphrase_dialog_destroy (NMApplet *applet); #endif /* PASSPHRASE_DIALOG_H */ diff --git a/gnome/applet/vpn-connection.c b/gnome/applet/vpn-connection.c index c3cc2c6619..e199ed99c4 100644 --- a/gnome/applet/vpn-connection.c +++ b/gnome/applet/vpn-connection.c @@ -32,7 +32,7 @@ struct VPNConnection }; -VPNConnection *nmwa_vpn_connection_new (const char *name) +VPNConnection *nma_vpn_connection_new (const char *name) { 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; @@ -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); @@ -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); @@ -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); 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); @@ -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 (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) { - if (!vpn || !name || !nmwa_vpn_connection_get_name (vpn)) + if (!vpn || !name || !nma_vpn_connection_get_name (vpn)) 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; VPNConnection *vpn = NULL; @@ -136,27 +136,27 @@ VPNConnection *nmwa_vpn_connection_find_by_name (GSList *list, const char *name) 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); 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); vpn->stage = stage; } -gboolean nmwa_vpn_connection_is_activating (VPNConnection *vpn) +gboolean nma_vpn_connection_is_activating (VPNConnection *vpn) { NMVPNActStage stage; 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 || stage == NM_VPN_ACT_STAGE_CONNECT || stage == NM_VPN_ACT_STAGE_IP_CONFIG_GET) diff --git a/gnome/applet/vpn-connection.h b/gnome/applet/vpn-connection.h index e710a6fd43..b634c42725 100644 --- a/gnome/applet/vpn-connection.h +++ b/gnome/applet/vpn-connection.h @@ -25,21 +25,21 @@ #include "applet.h" #include "NetworkManagerVPN.h" -VPNConnection * nmwa_vpn_connection_new (const char *name); -VPNConnection * nmwa_vpn_connection_copy (VPNConnection *vpn); -void nmwa_vpn_connection_ref (VPNConnection *vpn); -void nmwa_vpn_connection_unref (VPNConnection *vpn); +VPNConnection * nma_vpn_connection_new (const char *name); +VPNConnection * nma_vpn_connection_copy (VPNConnection *vpn); +void nma_vpn_connection_ref (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); -void nmwa_vpn_connection_set_service (VPNConnection *vpn, const char *service); +const char * nma_vpn_connection_get_service (VPNConnection *vpn); +void nma_vpn_connection_set_service (VPNConnection *vpn, const char *service); -NMVPNActStage nmwa_vpn_connection_get_stage (VPNConnection *vpn); -void nmwa_vpn_connection_set_stage (VPNConnection *vpn, NMVPNActStage stage); +NMVPNActStage nma_vpn_connection_get_stage (VPNConnection *vpn); +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 diff --git a/gnome/applet/vpn-password-dialog.c b/gnome/applet/vpn-password-dialog.c index b1bfca957b..e32b5ee88f 100644 --- a/gnome/applet/vpn-password-dialog.c +++ b/gnome/applet/vpn-password-dialog.c @@ -86,7 +86,7 @@ out: } 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"*/, "-n", NULL /*"davidznet42"*/, diff --git a/gnome/applet/vpn-password-dialog.h b/gnome/applet/vpn-password-dialog.h index 54cf9e98c8..5e831f9cc5 100644 --- a/gnome/applet/vpn-password-dialog.h +++ b/gnome/applet/vpn-password-dialog.h @@ -24,7 +24,7 @@ #include "applet.h" -GSList *nmwa_vpn_request_password (NMWirelessApplet *applet, +GSList *nma_vpn_request_password (NMApplet *applet, const char *name, const char *service, gboolean retry);