mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 04:50:30 +01:00
2005-12-10 Dan Williams <dcbw@redhat.com>
* gnome/applet/applet-dbus-devices.c - Print out error message details for dbus pending call callbacks - Move nmwa_dbus_update_devices() up * gnome/applet/applet-dbus-vpn.c - Print out error message details for dbus pending call callbacks git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1155 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
d9ac9fbdf3
commit
8bc5acbc99
3 changed files with 115 additions and 27 deletions
11
ChangeLog
11
ChangeLog
|
|
@ -1,4 +1,13 @@
|
|||
2005-12-09 Dan Williams <dcbw@redhat.com>
|
||||
2005-12-10 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* gnome/applet/applet-dbus-devices.c
|
||||
- Print out error message details for dbus pending call callbacks
|
||||
- Move nmwa_dbus_update_devices() up
|
||||
|
||||
* gnome/applet/applet-dbus-vpn.c
|
||||
- Print out error message details for dbus pending call callbacks
|
||||
|
||||
2005-12-10 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* libnm-util/*
|
||||
- More fixups
|
||||
|
|
|
|||
|
|
@ -56,6 +56,11 @@ static void nmwa_dbus_nm_state_cb (DBusPendingCall *pcall, void *user_data)
|
|||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -113,6 +118,11 @@ static void nmwa_dbus_update_wireless_enabled_cb (DBusPendingCall *pcall, void *
|
|||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -198,6 +208,11 @@ static void hal_info_product_cb (DBusPendingCall *pcall, void *user_data)
|
|||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -238,6 +253,11 @@ static void hal_info_vendor_cb (DBusPendingCall *pcall, void *user_data)
|
|||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -297,6 +317,11 @@ static void hal_net_physdev_cb (DBusPendingCall *pcall, void *user_data)
|
|||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -504,6 +529,17 @@ static void nmwa_dbus_net_properties_cb (DBusPendingCall *pcall, void *user_data
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &op,
|
||||
DBUS_TYPE_STRING, &essid,
|
||||
DBUS_TYPE_STRING, &hw_addr,
|
||||
|
|
@ -686,8 +722,13 @@ static void nmwa_dbus_device_properties_cb (DBusPendingCall *pcall, void *user_d
|
|||
if (!(reply = dbus_pending_call_steal_reply (pcall)))
|
||||
goto out;
|
||||
|
||||
if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -814,6 +855,17 @@ static void nmwa_dbus_update_devices_cb (DBusPendingCall *pcall, void *user_data
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &devices, &num_devices, DBUS_TYPE_INVALID))
|
||||
{
|
||||
char ** item;
|
||||
|
|
@ -831,6 +883,30 @@ out:
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* nmwa_dbus_update_devices
|
||||
*
|
||||
* Do a full update of network devices, wireless networks, and dial up devices.
|
||||
*
|
||||
*/
|
||||
void nmwa_dbus_update_devices (NMWirelessApplet *applet)
|
||||
{
|
||||
DBusMessage * message;
|
||||
DBusPendingCall * pcall;
|
||||
|
||||
nmwa_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_message_unref (message);
|
||||
}
|
||||
nmwa_dbus_update_wireless_enabled (applet);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nmwa_dbus_update_dialup_cb
|
||||
*
|
||||
|
|
@ -856,6 +932,17 @@ static void nmwa_dbus_update_dialup_cb (DBusPendingCall *pcall, void *user_data)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &dialup_devices, &num_devices, DBUS_TYPE_INVALID))
|
||||
{
|
||||
char **item;
|
||||
|
|
@ -922,30 +1009,6 @@ void nmwa_dbus_dialup_activate_connection (NMWirelessApplet *applet, const char
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* nmwa_dbus_update_devices
|
||||
*
|
||||
* Do a full update of network devices, wireless networks, and dial up devices.
|
||||
*
|
||||
*/
|
||||
void nmwa_dbus_update_devices (NMWirelessApplet *applet)
|
||||
{
|
||||
DBusMessage * message;
|
||||
DBusPendingCall * pcall;
|
||||
|
||||
nmwa_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_message_unref (message);
|
||||
}
|
||||
nmwa_dbus_update_wireless_enabled (applet);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nmwa_dbus_update_dialup
|
||||
*
|
||||
|
|
|
|||
|
|
@ -122,8 +122,13 @@ static void nmwa_dbus_vpn_properties_cb (DBusPendingCall *pcall, void *user_data
|
|||
if (!(reply = dbus_pending_call_steal_reply (pcall)))
|
||||
goto out;
|
||||
|
||||
if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -214,6 +219,17 @@ static void nmwa_dbus_vpn_update_vpn_connections_cb (DBusPendingCall *pcall, voi
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (message_is_error (reply))
|
||||
{
|
||||
DBusError 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);
|
||||
dbus_error_free (&err);
|
||||
dbus_message_unref (reply);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &vpn_names, &num_vpn_names, DBUS_TYPE_INVALID))
|
||||
{
|
||||
char ** item;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue