[gnome-bluetooth/meego-dev: 2/15] Make default-adaptor-powered a read/write property
- From: Ross Burton <rburton src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/meego-dev: 2/15] Make default-adaptor-powered a read/write property
- Date: Thu, 25 Feb 2010 17:10:24 +0000 (UTC)
commit 9bf399322049e760c5616b952d2bd2c4d2a8e16e
Author: Ross Burton <ross linux intel com>
Date: Mon Jan 25 17:21:06 2010 +0000
Make default-adaptor-powered a read/write property
lib/bluetooth-client.c | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 06fd7be..967c113 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -1217,6 +1217,35 @@ bluetooth_client_get_property (GObject *object,
}
}
+static void
+bluetooth_client_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_DEFAULT_ADAPTER_POWERED:
+ {
+ DBusGProxy *adapter;
+
+ adapter = bluetooth_client_get_default_adapter (BLUETOOTH_CLIENT (object));
+ if (adapter == NULL)
+ return;
+
+ dbus_g_proxy_call (adapter, "SetProperty", NULL,
+ G_TYPE_STRING, "Powered",
+ G_TYPE_VALUE, value,
+ G_TYPE_INVALID, G_TYPE_INVALID);
+
+ g_object_unref (adapter);
+ }
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
+ break;
+ }
+}
+
static void bluetooth_client_finalize(GObject *client)
{
BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client);
@@ -1254,6 +1283,7 @@ static void bluetooth_client_class_init(BluetoothClientClass *klass)
object_class->finalize = bluetooth_client_finalize;
object_class->get_property = bluetooth_client_get_property;
+ object_class->set_property = bluetooth_client_set_property;
g_object_class_install_property (object_class, PROP_DEFAULT_ADAPTER,
@@ -1261,7 +1291,7 @@ static void bluetooth_client_class_init(BluetoothClientClass *klass)
NULL, G_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_DEFAULT_ADAPTER_POWERED,
g_param_spec_boolean ("default-adapter-powered", NULL, NULL,
- FALSE, G_PARAM_READABLE));
+ FALSE, G_PARAM_READWRITE));
dbus_g_object_register_marshaller(marshal_VOID__STRING_BOXED,
G_TYPE_NONE, G_TYPE_STRING,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]