[gnome-bluetooth] sendto: Don't allow sending to iDevices
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] sendto: Don't allow sending to iDevices
- Date: Mon, 8 Jun 2015 12:36:57 +0000 (UTC)
commit d3e1698b3e9ded6fce35096ff3dba9cd8e5a3c8b
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jun 8 14:35:34 2015 +0200
sendto: Don't allow sending to iDevices
iDevices don't have OBEX support. Disable the device selection's "Send"
button when an iPhone or similar is selected.
https://bugzilla.gnome.org/show_bug.cgi?id=746698
sendto/main.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/sendto/main.c b/sendto/main.c
index 083bad8..bd53da4 100644
--- a/sendto/main.c
+++ b/sendto/main.c
@@ -690,9 +690,26 @@ select_device_changed(BluetoothChooser *sel,
gpointer user_data)
{
GtkDialog *dialog = user_data;
+ char *icon;
- gtk_dialog_set_response_sensitive(dialog,
- GTK_RESPONSE_ACCEPT, address != NULL);
+ if (address == NULL)
+ goto bail;
+
+ icon = bluetooth_chooser_get_selected_device_icon (sel);
+ if (icon == NULL)
+ goto bail;
+
+ /* Apple's device don't have OBEX */
+ if (g_str_equal (icon, "phone-apple-iphone"))
+ goto bail;
+
+ gtk_dialog_set_response_sensitive (dialog,
+ GTK_RESPONSE_ACCEPT, TRUE);
+ return;
+
+bail:
+ gtk_dialog_set_response_sensitive (dialog,
+ GTK_RESPONSE_ACCEPT, FALSE);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]