[gnome-bluetooth] properties: Use new default-adapter-name property
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] properties: Use new default-adapter-name property
- Date: Wed, 12 Oct 2011 18:22:12 +0000 (UTC)
commit f1a200a8c3fda25728a4086de646f4b37e4bc88a
Author: Bastien Nocera <hadess hadess net>
Date: Wed Oct 12 18:24:20 2011 +0100
properties: Use new default-adapter-name property
properties/cc-bluetooth-panel.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/properties/cc-bluetooth-panel.c b/properties/cc-bluetooth-panel.c
index 6c59af4..bff92b4 100644
--- a/properties/cc-bluetooth-panel.c
+++ b/properties/cc-bluetooth-panel.c
@@ -536,7 +536,7 @@ cc_bluetooth_panel_update_visibility (CcBluetoothPanel *self)
gtk_switch_set_active (button, discoverable);
g_signal_handlers_unblock_by_func (button, switch_discoverable_active_changed, self);
- name = bluetooth_client_get_name (self->priv->client);
+ g_object_get (G_OBJECT (self->priv->client), "default-adapter-name", &name, NULL);
if (name == NULL) {
gtk_widget_set_sensitive (WID ("switch_discoverable"), FALSE);
gtk_widget_set_sensitive (WID ("visible_label"), FALSE);
@@ -563,6 +563,14 @@ discoverable_changed (BluetoothClient *client,
}
static void
+name_changed (BluetoothClient *client,
+ GParamSpec *spec,
+ CcBluetoothPanel *self)
+{
+ cc_bluetooth_panel_update_visibility (self);
+}
+
+static void
device_selected_changed (BluetoothChooser *chooser,
GParamSpec *spec,
CcBluetoothPanel *self)
@@ -697,6 +705,8 @@ cc_bluetooth_panel_init (CcBluetoothPanel *self)
cc_bluetooth_panel_update_visibility (self);
g_signal_connect (G_OBJECT (self->priv->client), "notify::default-adapter-discoverable",
G_CALLBACK (discoverable_changed), self);
+ g_signal_connect (G_OBJECT (self->priv->client), "notify::default-adapter-name",
+ G_CALLBACK (name_changed), self);
g_signal_connect (G_OBJECT (WID ("switch_discoverable")), "notify::active",
G_CALLBACK (switch_discoverable_active_changed), self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]