gnome-power-manager r3309 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r3309 - in trunk: . src
- Date: Fri, 27 Feb 2009 16:00:57 +0000 (UTC)
Author: rhughes
Date: Fri Feb 27 16:00:57 2009
New Revision: 3309
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3309&view=rev
Log:
2009-02-27 Richard Hughes <richard hughsie com>
* src/gpm-button.c: (hal_daemon_new_device_cb), (gpm_button_init):
Add buttons as they appear, as would do on a hibernate with a USB
keyboard. Patch by Arnaud Patard, many thanks.
Modified:
trunk/ChangeLog
trunk/src/gpm-button.c
Modified: trunk/src/gpm-button.c
==============================================================================
--- trunk/src/gpm-button.c (original)
+++ trunk/src/gpm-button.c Fri Feb 27 16:00:57 2009
@@ -494,6 +494,26 @@
button->priv->hal_device_store = NULL;
}
}
+
+/**
+ * hal_daemon_new_device_cb
+ **/
+static void
+hal_daemon_new_device_cb (HalGManager *hal_manager, const gchar *udi, GpmButton *button)
+
+{
+ gboolean is_button;
+ HalDevice *device;
+
+ device = hal_gdevice_new ();
+ hal_device_set_udi (device, udi);
+ hal_device_query_capability (device, "button", &is_button, NULL);
+ if (is_button == TRUE) {
+ egg_debug ("Watching %s", udi);
+ watch_add_button (button, udi);
+ }
+ g_object_unref (device);
+}
#endif
/**
@@ -544,6 +564,8 @@
G_CALLBACK (hal_daemon_start_cb), button);
g_signal_connect (button->priv->hal_manager, "daemon-stop",
G_CALLBACK (hal_daemon_stop_cb), button);
+ g_signal_connect (button->priv->hal_manager, "device-added",
+ G_CALLBACK (hal_daemon_new_device_cb), button);
button->priv->hal_device_store = hal_device_store_new ();
coldplug_buttons (button);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]