[gnome-bluetooth] lib: Remove BluetoothChooser helper to remove devices
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] lib: Remove BluetoothChooser helper to remove devices
- Date: Tue, 27 Sep 2011 17:19:10 +0000 (UTC)
commit a952947809d6530c97c33399945b07033483ef3e
Author: Bastien Nocera <hadess hadess net>
Date: Tue Sep 27 15:46:48 2011 +0100
lib: Remove BluetoothChooser helper to remove devices
As this isn't something that general applications should
be interested in.
lib/bluetooth-chooser.c | 74 -------------------------------------------
lib/gnome-bluetooth.symbols | 1 -
2 files changed, 0 insertions(+), 75 deletions(-)
---
diff --git a/lib/bluetooth-chooser.c b/lib/bluetooth-chooser.c
index f738c65..f999c43 100644
--- a/lib/bluetooth-chooser.c
+++ b/lib/bluetooth-chooser.c
@@ -362,80 +362,6 @@ bluetooth_chooser_get_selected_device_info (BluetoothChooser *self,
return TRUE;
}
-static gboolean
-show_confirm_dialog (BluetoothChooser *chooser, const char *name)
-{
- GtkWidget *dialog, *parent;
- gint response;
-
- parent = gtk_widget_get_toplevel (GTK_WIDGET (chooser));
- dialog = gtk_message_dialog_new (GTK_WINDOW (parent), GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
- _("Remove '%s' from the list of devices?"), name);
- g_object_set (G_OBJECT (dialog), "secondary-text",
- _("If you remove the device, you will have to set it up again before next use."),
- NULL);
-
- gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_REMOVE, GTK_RESPONSE_ACCEPT);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
-
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_ACCEPT)
- return TRUE;
-
- return FALSE;
-}
-
-/**
- * bluetooth_chooser_remove_selected_device:
- * @self: A #BluetoothChooser widget.
- *
- * Returns whether the removal was successful.
- *
- * Return value: %TRUE if the selected device was correctly removed.
- **/
-gboolean
-bluetooth_chooser_remove_selected_device (BluetoothChooser *self)
-{
- BluetoothChooserPrivate *priv = BLUETOOTH_CHOOSER_GET_PRIVATE(self);
- GtkTreeIter iter;
- gboolean ret = FALSE;
- GError *err = NULL;
- gchar *name;
- DBusGProxy *device, *adapter;
-
- if (gtk_tree_selection_get_selected (priv->selection, NULL, &iter) == FALSE)
- return FALSE;
-
- gtk_tree_model_get (priv->filter, &iter,
- BLUETOOTH_COLUMN_PROXY, &device,
- BLUETOOTH_COLUMN_ALIAS, &name, -1);
-
- adapter = bluetooth_client_get_default_adapter(priv->client);
-
- if (show_confirm_dialog (self, name) != FALSE) {
- const gchar *device_path;
-
- device_path = dbus_g_proxy_get_path (device);
-
- if (dbus_g_proxy_call (adapter, "RemoveDevice", &err,
- DBUS_TYPE_G_OBJECT_PATH, device_path,
- G_TYPE_INVALID, G_TYPE_INVALID) == FALSE) {
- g_warning ("Failed to remove device %s: %s", name,
- err->message);
- g_error_free (err);
- } else {
- ret = TRUE;
- }
- g_object_unref (adapter);
- }
-
- return ret;
-}
-
/**
* bluetooth_chooser_get_model:
* @self: A #BluetoothChooser widget.
diff --git a/lib/gnome-bluetooth.symbols b/lib/gnome-bluetooth.symbols
index 66f2dec..8c1521d 100644
--- a/lib/gnome-bluetooth.symbols
+++ b/lib/gnome-bluetooth.symbols
@@ -16,7 +16,6 @@ bluetooth_chooser_start_discovery
bluetooth_chooser_stop_discovery
bluetooth_client_set_discoverable
bluetooth_client_get_name
-bluetooth_chooser_remove_selected_device
bluetooth_chooser_button_get_type
bluetooth_chooser_button_new
bluetooth_chooser_button_available
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]