[gnome-bluetooth] settings: Export the state of the Bluetooth adapter
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] settings: Export the state of the Bluetooth adapter
- Date: Sun, 10 Jan 2016 14:59:52 +0000 (UTC)
commit bd3b6f03ab3f96bde3665b74187a0c932592c17e
Author: Bastien Nocera <hadess hadess net>
Date: Sun Jan 10 14:46:31 2016 +0100
settings: Export the state of the Bluetooth adapter
So that we can avoid showing filler text when the Bluetooth adapter is
powered off/rfkilled but the overall Bluetooth rfkill is off.
See https://bugzilla.gnome.org/show_bug.cgi?id=760168
lib/bluetooth-settings-widget.c | 22 ++++++++++++++++++++++
lib/bluetooth-settings-widget.h | 2 ++
lib/gnome-bluetooth.symbols | 1 +
3 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 3db2efb..356eb41 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -2007,3 +2007,25 @@ bluetooth_settings_widget_new (void)
{
return g_object_new (BLUETOOTH_TYPE_SETTINGS_WIDGET, NULL);
}
+
+/**
+ * bluetooth_settings_widget_get_default_adapter_powered:
+ * @widget: a #BluetoothSettingsWidget widget.
+ *
+ * Return value: Whether the default Bluetooth adapter is powered.
+ **/
+gboolean
+bluetooth_settings_widget_get_default_adapter_powered (BluetoothSettingsWidget *widget)
+{
+ BluetoothSettingsWidgetPrivate *priv;
+ gboolean ret;
+
+ g_return_val_if_fail (BLUETOOTH_IS_SETTINGS_WIDGET (widget), FALSE);
+
+ priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (widget);
+ g_object_get (G_OBJECT (priv->client),
+ "default-adapter-powered", &ret,
+ NULL);
+
+ return ret;
+}
diff --git a/lib/bluetooth-settings-widget.h b/lib/bluetooth-settings-widget.h
index 6e943bd..8b72295 100644
--- a/lib/bluetooth-settings-widget.h
+++ b/lib/bluetooth-settings-widget.h
@@ -58,6 +58,8 @@ GType bluetooth_settings_widget_get_type (void);
GtkWidget *bluetooth_settings_widget_new (void);
+gboolean bluetooth_settings_widget_get_default_adapter_powered (BluetoothSettingsWidget *widget);
+
G_END_DECLS
#endif /* __BLUETOOTH_SETTINGS_WIDGET_H */
diff --git a/lib/gnome-bluetooth.symbols b/lib/gnome-bluetooth.symbols
index 7030070..6840979 100644
--- a/lib/gnome-bluetooth.symbols
+++ b/lib/gnome-bluetooth.symbols
@@ -59,6 +59,7 @@ bluetooth_agent_set_authorize_service_func
bluetooth_agent_setup
bluetooth_settings_widget_get_type
bluetooth_settings_widget_new
+bluetooth_settings_widget_get_default_adapter_powered
bluetooth_pairing_dialog_new
bluetooth_pairing_dialog_get_type
bluetooth_pairing_dialog_set_mode
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]