diff options
author | Bastien Nocera <hadess@hadess.net> | 2015-06-08 14:35:34 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2015-06-08 14:35:34 +0200 |
commit | d3e1698b3e9ded6fce35096ff3dba9cd8e5a3c8b (patch) | |
tree | 58c80ecfe2faf3532ce090a6186e3dd3474c18b7 /sendto | |
parent | 49487eede220af64293096f8b51d793273c25ac2 (diff) | |
download | gnome-bluetooth-d3e1698b3e9ded6fce35096ff3dba9cd8e5a3c8b.tar.gz |
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
Diffstat (limited to 'sendto')
-rw-r--r-- | sendto/main.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sendto/main.c b/sendto/main.c index 083bad84..bd53da45 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 |