[arch-commits] Commit in bluez-gnome/trunk (11 files)

Jan de Groot jgc at archlinux.org
Sun Jun 14 15:52:49 UTC 2009


    Date: Sunday, June 14, 2009 @ 11:52:48
  Author: jgc
Revision: 42442

Add patches from ubuntu, mainly to fix outstanding bugs with newer versions of bluez and obex-data-server.

PKGBUILD: Fix gconf-merge schemas call to pick up the schemas, use the gettext domain option to shrink the files
bluez-gnome.install: run update-mime-database and gtk-update-icon-cache.

Should fix FS#14942, FS#13293

Added:
  bluez-gnome/trunk/02_MenusRevisited.patch
  bluez-gnome/trunk/04_bluetooth-sendto-ods-svn.patch
  bluez-gnome/trunk/05_bluetooth_sendto_dbus-snd.patch
  bluez-gnome/trunk/06_preferences-horizontal-layout.patch
  bluez-gnome/trunk/07_null_device_name.patch
  bluez-gnome/trunk/08_XFCE.patch
  bluez-gnome/trunk/09_visibility.patch
  bluez-gnome/trunk/10_wizard-custom-pin.patch
  bluez-gnome/trunk/11_bluez-notifications.patch
Modified:
  bluez-gnome/trunk/PKGBUILD
  bluez-gnome/trunk/bluez-gnome.install

----------------------------------------+
 02_MenusRevisited.patch                |    8 +
 04_bluetooth-sendto-ods-svn.patch      |   13 +
 05_bluetooth_sendto_dbus-snd.patch     |  153 ++++++++++++++++++++++
 06_preferences-horizontal-layout.patch |   91 +++++++++++++
 07_null_device_name.patch              |   18 ++
 08_XFCE.patch                          |   35 +++++
 09_visibility.patch                    |   59 ++++++++
 10_wizard-custom-pin.patch             |  209 +++++++++++++++++++++++++++++++
 11_bluez-notifications.patch           |  174 +++++++++++++++++++++++++
 PKGBUILD                               |   49 +++++--
 bluez-gnome.install                    |   15 +-
 11 files changed, 806 insertions(+), 18 deletions(-)

Added: 02_MenusRevisited.patch
===================================================================
--- 02_MenusRevisited.patch	                        (rev 0)
+++ 02_MenusRevisited.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,8 @@
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.4/analyzer/bluetooth-analyzer.desktop.in bluez-gnome-1.4.new/analyzer/bluetooth-analyzer.desktop.in
+--- bluez-gnome-1.4/analyzer/bluetooth-analyzer.desktop.in	2008-08-24 11:05:50.000000000 -0500
++++ bluez-gnome-1.4.new/analyzer/bluetooth-analyzer.desktop.in	2008-09-26 15:59:26.000000000 -0500
+@@ -9,3 +9,4 @@
+ Type=Application
+ Categories=System;Monitor;
+ OnlyShowIn=GNOME;
++NoDisplay=true

Added: 04_bluetooth-sendto-ods-svn.patch
===================================================================
--- 04_bluetooth-sendto-ods-svn.patch	                        (rev 0)
+++ 04_bluetooth-sendto-ods-svn.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,13 @@
+diff --git a/sendto/main.c b/sendto/main.c
+index 044bbbc..f0c435b 100644
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/sendto/main.c bluez-gnome-1.8.new/sendto/main.c
+--- bluez-gnome-1.8/sendto/main.c	2008-10-04 14:32:56.000000000 -0500
++++ bluez-gnome-1.8.new/sendto/main.c	2008-10-06 01:01:19.000000000 -0500
+@@ -790,6 +790,7 @@
+ 		dbus_g_proxy_begin_call(proxy, "CreateBluetoothSession",
+ 					create_notify, NULL, NULL,
+ 					G_TYPE_STRING, option_device,
++					G_TYPE_STRING, "00:00:00:00:00:00",
+ 					G_TYPE_STRING, "opp", G_TYPE_INVALID);
+ 	} else {
+ 		GHashTable *hash = NULL;

Added: 05_bluetooth_sendto_dbus-snd.patch
===================================================================
--- 05_bluetooth_sendto_dbus-snd.patch	                        (rev 0)
+++ 05_bluetooth_sendto_dbus-snd.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,153 @@
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/common/marshal.list bluez-gnome-1.8.new/common/marshal.list
+--- bluez-gnome-1.8/common/marshal.list	2008-08-24 16:14:24.000000000 -0500
++++ bluez-gnome-1.8.new/common/marshal.list	2008-10-06 01:01:59.000000000 -0500
+@@ -3,3 +3,4 @@
+ VOID:STRING,STRING
+ VOID:STRING,STRING,UINT64
+ VOID:UINT64
++VOID:STRING,STRING,STRING
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/sendto/main.c bluez-gnome-1.8.new/sendto/main.c
+--- bluez-gnome-1.8/sendto/main.c	2008-10-06 01:01:58.000000000 -0500
++++ bluez-gnome-1.8.new/sendto/main.c	2008-10-06 01:05:05.000000000 -0500
+@@ -64,6 +64,8 @@
+ static gint64 first_update = 0;
+ static gint64 last_update = 0;
+ 
++static DBusGProxy *session_proxy = NULL;
++
+ static gchar *filename_to_path(const gchar *filename)
+ {
+ 	GFile *file;
+@@ -354,7 +356,16 @@
+ static void error_occurred(DBusGProxy *proxy, const gchar *name,
+ 				const gchar *message, gpointer user_data)
+ {
+-	transfer_completed(proxy, user_data);
++	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress),
++							_("Error Occurred"));
++							
++	gchar *text = g_strdup_printf("<span foreground=\"red\">%s</span>",
++								message);
++	gtk_label_set_markup(GTK_LABEL(label_status), text);
++	g_free(text);
++
++	gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
++						GTK_RESPONSE_CLOSE, TRUE);
+ }
+ 
+ static void session_connected(DBusGProxy *proxy, gpointer user_data)
+@@ -363,7 +374,7 @@
+ 
+ 	first_update = get_system_time();
+ 
+-	send_file(proxy);
++	send_file(session_proxy);
+ }
+ 
+ #define OPENOBEX_CONNECTION_FAILED "org.openobex.Error.ConnectionAttemptFailed"
+@@ -407,60 +418,41 @@
+ 	if (dbus_g_proxy_end_call(proxy, call, &error,
+ 					DBUS_TYPE_G_OBJECT_PATH, &path,
+ 						G_TYPE_INVALID) == FALSE) {
+-		gchar *text, *message;
++		gchar *message;
+ 
+ 		message = get_error_message(error);
+ 
+-		text = g_strdup_printf("<span foreground=\"red\">%s</span>",
+-								message);
+-		gtk_label_set_markup(GTK_LABEL(label_status), text);
+-		g_free(text);
++		error_occurred(proxy,NULL,message,NULL);
+ 
+ 		g_free(message);
+ 
+-		gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
+-						GTK_RESPONSE_CLOSE, TRUE);
+ 		return;
+ 	}
+-
+-	proxy = dbus_g_proxy_new_for_name(conn, "org.openobex",
++	session_proxy = dbus_g_proxy_new_for_name(conn, "org.openobex",
+ 						path, "org.openobex.Session");
+ 
+-	dbus_g_proxy_add_signal(proxy, "Connected", G_TYPE_INVALID);
++	dbus_g_proxy_add_signal(session_proxy, "Cancelled", G_TYPE_INVALID);
+ 
+-	dbus_g_proxy_connect_signal(proxy, "Connected",
+-				G_CALLBACK(session_connected), NULL, NULL);
+-
+-	dbus_g_proxy_add_signal(proxy, "ErrorOccurred",
+-				G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
+-
+-	dbus_g_proxy_connect_signal(proxy, "ErrorOccurred",
+-				G_CALLBACK(error_occurred), NULL, NULL);
+-
+-	dbus_g_proxy_add_signal(proxy, "Cancelled", G_TYPE_INVALID);
+-
+-	dbus_g_proxy_connect_signal(proxy, "Cancelled",
++	dbus_g_proxy_connect_signal(session_proxy, "Cancelled",
+ 				G_CALLBACK(transfer_cancelled), NULL, NULL);
+ 
+-	dbus_g_proxy_add_signal(proxy, "TransferStarted", G_TYPE_STRING,
++	dbus_g_proxy_add_signal(session_proxy, "TransferStarted", G_TYPE_STRING,
+ 				G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_INVALID);
+ 
+-	dbus_g_proxy_connect_signal(proxy, "TransferStarted",
++	dbus_g_proxy_connect_signal(session_proxy, "TransferStarted",
+ 				G_CALLBACK(transfer_started), NULL, NULL);
+ 
+-	dbus_g_proxy_add_signal(proxy, "TransferProgress",
++	dbus_g_proxy_add_signal(session_proxy, "TransferProgress",
+ 						G_TYPE_UINT64, G_TYPE_INVALID);
+ 
+-	dbus_g_proxy_connect_signal(proxy, "TransferProgress",
++	dbus_g_proxy_connect_signal(session_proxy, "TransferProgress",
+ 				G_CALLBACK(transfer_progress), NULL, NULL);
+ 
+-	dbus_g_proxy_add_signal(proxy, "TransferCompleted", G_TYPE_INVALID);
++	dbus_g_proxy_add_signal(session_proxy, "TransferCompleted", G_TYPE_INVALID);
+ 
+-	dbus_g_proxy_connect_signal(proxy, "TransferCompleted",
++	dbus_g_proxy_connect_signal(session_proxy, "TransferCompleted",
+ 				G_CALLBACK(transfer_completed), NULL, NULL);
+ 
+-	dbus_g_proxy_call(proxy, "Connect", NULL, G_TYPE_INVALID,
+-							G_TYPE_INVALID);
+ }
+ 
+ static gchar *get_name(DBusGProxy *device)
+@@ -766,6 +758,14 @@
+ 
+ 	dbus_g_object_register_marshaller(marshal_VOID__UINT64,
+ 				G_TYPE_NONE, G_TYPE_UINT64, G_TYPE_INVALID);
++				
++	dbus_g_object_register_marshaller(marshal_VOID__STRING_STRING_STRING,
++                                       G_TYPE_NONE,
++                                       DBUS_TYPE_G_OBJECT_PATH,
++                                       G_TYPE_STRING,
++                                       G_TYPE_STRING,
++                                       G_TYPE_INVALID);
++
+ 
+ 	device_name = get_device_name(option_device);
+ 	if (device_name == NULL)
+@@ -787,6 +787,18 @@
+ 		dbus_g_proxy_connect_signal(proxy, "NameOwnerChanged",
+ 				G_CALLBACK(name_owner_changed), NULL, NULL);
+ 
++	dbus_g_proxy_add_signal(proxy, "SessionConnected", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
++
++	dbus_g_proxy_connect_signal(proxy, "SessionConnected",
++				G_CALLBACK(session_connected), NULL, NULL);
++
++	dbus_g_proxy_add_signal(proxy, "SessionConnectError",
++				DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
++
++	dbus_g_proxy_connect_signal(proxy, "SessionConnectError",
++				G_CALLBACK(error_occurred), NULL, NULL);
++
++
+ 		dbus_g_proxy_begin_call(proxy, "CreateBluetoothSession",
+ 					create_notify, NULL, NULL,
+ 					G_TYPE_STRING, option_device,

Added: 06_preferences-horizontal-layout.patch
===================================================================
--- 06_preferences-horizontal-layout.patch	                        (rev 0)
+++ 06_preferences-horizontal-layout.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,91 @@
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.6/properties/adapter.c bluez-gnome-1.6.new/properties/adapter.c
+--- bluez-gnome-1.6/properties/adapter.c	2008-09-29 07:08:50.000000000 -0500
++++ bluez-gnome-1.6.new/properties/adapter.c	2008-09-29 09:55:36.000000000 -0500
+@@ -246,16 +246,10 @@
+ 	}
+ 
+ 	update_buttons(adapter, paired, trusted, connected);
+-
+-	if (selected == TRUE) {
+-		gtk_widget_show(adapter->button_disconnect);
+-		gtk_widget_show(adapter->button_trusted);
+-		gtk_widget_show(adapter->button_delete);
+-	} else {
+-		gtk_widget_hide(adapter->button_disconnect);
+-		gtk_widget_hide(adapter->button_trusted);
+-		gtk_widget_hide(adapter->button_delete);
+-	}
++	
++	gtk_widget_set_sensitive(adapter->button_disconnect,selected);
++	gtk_widget_set_sensitive(adapter->button_trusted,selected);
++	gtk_widget_set_sensitive(adapter->button_delete,selected);
+ }
+ 
+ static void row_callback(GtkTreeModel *model, GtkTreePath  *path,
+@@ -461,7 +455,7 @@
+ 	adapter->discoverable = discoverable;
+ 	adapter->timeout_value = timeout;
+ 
+-	mainbox = gtk_vbox_new(FALSE, 18);
++	mainbox = gtk_hbox_new(FALSE, 12);
+ 	gtk_container_set_border_width(GTK_CONTAINER(mainbox), 12);
+ 
+ 	gtk_notebook_prepend_page(GTK_NOTEBOOK(adapter->notebook),
+@@ -471,6 +465,9 @@
+ 
+ 	adapter->child = mainbox;
+ 
++	mainbox = gtk_vbox_new (FALSE, 18);
++	gtk_container_add(GTK_CONTAINER (GTK_CONTAINER (adapter->child)), mainbox);
++
+ 	vbox = gtk_vbox_new(FALSE, 6);
+ 	gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
+ 
+@@ -569,7 +566,7 @@
+ 	entry = gtk_entry_new();
+ 	gtk_entry_set_max_length(GTK_ENTRY(entry), 248);
+ 	gtk_widget_set_size_request(entry, 240, -1);
+-	gtk_box_pack_start(GTK_BOX(vbox), entry, TRUE, TRUE, 0);
++	gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0);
+ 
+ 	if (name != NULL)
+ 		gtk_entry_set_text(GTK_ENTRY(entry), name);
+@@ -582,7 +579,7 @@
+ 					G_CALLBACK(focus_callback), adapter);
+ 
+ 	vbox = gtk_vbox_new(FALSE, 6);
+-	gtk_box_pack_start(GTK_BOX(mainbox), vbox, TRUE, TRUE, 0);
++	gtk_box_pack_start(GTK_BOX(adapter->child), vbox, TRUE, TRUE, 0);
+ 
+ 	label = create_label(_("Known devices"));
+ 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+@@ -634,8 +631,8 @@
+ 						GTK_ICON_SIZE_BUTTON);
+ 	gtk_container_add(GTK_CONTAINER(button), image);
+ 	gtk_container_set_border_width(GTK_CONTAINER(button), 0);
+-	gtk_widget_set_no_show_all(button, TRUE);
+ 	gtk_widget_show(image);
++	gtk_widget_set_sensitive(button,FALSE);
+ 	gtk_box_pack_end(GTK_BOX(buttonbox), button, FALSE, FALSE, 0);
+ 	gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(buttonbox),
+ 								button, TRUE);
+@@ -651,8 +648,8 @@
+ 						GTK_ICON_SIZE_BUTTON);
+ 	gtk_container_add(GTK_CONTAINER(button), image);
+ 	gtk_container_set_border_width(GTK_CONTAINER(button), 0);
+-	gtk_widget_set_no_show_all(button, TRUE);
+ 	gtk_widget_show(image);
++	gtk_widget_set_sensitive(button,FALSE);
+ 	gtk_box_pack_end(GTK_BOX(buttonbox), button, FALSE, FALSE, 0);
+ 	gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(buttonbox),
+ 								button, TRUE);
+@@ -668,8 +665,8 @@
+ 						GTK_ICON_SIZE_BUTTON);
+ 	gtk_container_add(GTK_CONTAINER(button), image);
+ 	gtk_container_set_border_width(GTK_CONTAINER(button), 0);
+-	gtk_widget_set_no_show_all(button, TRUE);
+ 	gtk_widget_show(image);
++	gtk_widget_set_sensitive(button,FALSE);
+ 	gtk_box_pack_end(GTK_BOX(buttonbox), button, FALSE, FALSE, 0);
+ 	gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(buttonbox),
+ 								button, TRUE);

Added: 07_null_device_name.patch
===================================================================
--- 07_null_device_name.patch	                        (rev 0)
+++ 07_null_device_name.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,18 @@
+From: Marcel Holtmann <marcel at holtmann.org>
+Date: Mon, 6 Oct 2008 08:01:50 +0000 (+0200)
+Subject: Display the alias instead of the remote device name
+X-Git-Url: http://git.kernel.org/?p=bluetooth%2Fbluez-gnome.git;a=commitdiff_plain;h=7256de93be73f50913f6689a0690e3c0a28dfe3b
+
+Display the alias instead of the remote device name
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/wizard/main.c bluez-gnome-1.8.new/wizard/main.c
+--- bluez-gnome-1.8/wizard/main.c	2008-10-06 01:23:55.000000000 -0500
++++ bluez-gnome-1.8.new/wizard/main.c	2008-10-06 08:27:57.000000000 -0500
+@@ -353,7 +353,7 @@
+ 		gtk_tree_model_get(model, &iter,
+ 				BLUETOOTH_COLUMN_PAIRED, &paired,
+ 				BLUETOOTH_COLUMN_ADDRESS, &address,
+-				BLUETOOTH_COLUMN_NAME, &name,
++				BLUETOOTH_COLUMN_ALIAS, &name,
+ 				BLUETOOTH_COLUMN_TYPE, &type, -1);
+ 
+ 		if (paired == TRUE)

Added: 08_XFCE.patch
===================================================================
--- 08_XFCE.patch	                        (rev 0)
+++ 08_XFCE.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,35 @@
+#
+# Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/bluez-gnome/+bug/325530
+# Upstream: http://bugzilla.gnome.org/show_bug.cgi?id=571535
+# Patch: http://bugzilla.gnome.org/attachment.cgi?id=128584
+# Description: Show BlueZ in XFCE
+#
+
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/analyzer/bluetooth-analyzer.desktop.in bluez-gnome-1.8.new/analyzer/bluetooth-analyzer.desktop.in
+--- bluez-gnome-1.8/analyzer/bluetooth-analyzer.desktop.in	2009-02-04 14:04:41.000000000 -0800
++++ bluez-gnome-1.8.new/analyzer/bluetooth-analyzer.desktop.in	2009-02-04 14:02:24.000000000 -0800
+@@ -8,5 +8,5 @@
+ MimeType=application/x-hcidump;application/x-btsnoop;application/x-pktlog;
+ Type=Application
+ Categories=System;Monitor;
+-OnlyShowIn=GNOME;
++OnlyShowIn=GNOME;XFCE;
+ NoDisplay=true
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/applet/bluetooth-applet.desktop.in bluez-gnome-1.8.new/applet/bluetooth-applet.desktop.in
+--- bluez-gnome-1.8/applet/bluetooth-applet.desktop.in	2008-08-29 08:32:53.000000000 -0700
++++ bluez-gnome-1.8.new/applet/bluetooth-applet.desktop.in	2009-02-04 13:55:31.000000000 -0800
+@@ -7,4 +7,4 @@
+ Terminal=false
+ Type=Application
+ Categories=
+-OnlyShowIn=GNOME;
++OnlyShowIn=GNOME;XFCE;
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/properties/bluetooth-properties.desktop.in bluez-gnome-1.8.new/properties/bluetooth-properties.desktop.in
+--- bluez-gnome-1.8/properties/bluetooth-properties.desktop.in	2008-09-13 10:34:11.000000000 -0700
++++ bluez-gnome-1.8.new/properties/bluetooth-properties.desktop.in	2009-02-04 14:02:56.000000000 -0800
+@@ -7,4 +7,4 @@
+ Terminal=false
+ Type=Application
+ Categories=GTK;GNOME;Settings;HardwareSettings;
+-OnlyShowIn=GNOME;
++OnlyShowIn=GNOME;XFCE;

Added: 09_visibility.patch
===================================================================
--- 09_visibility.patch	                        (rev 0)
+++ 09_visibility.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,59 @@
+# Description: Fixes visibility settings
+# This patch was taken from upstream.  Please see this link for more information:
+# Upstream: http://git.kernel.org/?p=bluetooth/bluez-gnome.git;a=blobdiff;f=applet/main.c;h=62993755f098d06fbdc5aa3eaaa1325e448aa15f;hp=71f8778dd4388187f163fc736e440bace9256f3c;hb=4d56f10dc2a065d60724ccce8496d173fa0dc85a;hpb=68b98e6b6043acd8f6b2875d9f17fce84b14b9fb
+# Ubuntu: 297819
+
+diff --git a/applet/main.c b/applet/main.c
+index 71f8778..6299375 100644 (file)
+diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/applet/main.c bluez-gnome-1.8.new/applet/main.c
+--- bluez-gnome-1.8/applet/main.c	2008-09-29 07:08:50.000000000 -0500
++++ bluez-gnome-1.8.new/applet/main.c	2009-02-12 14:39:54.000000000 -0600
+@@ -288,6 +288,20 @@
+ 	}
+ }
+ 
++static void update_icon_visibility()
++{
++       if (icon_policy == ICON_POLICY_NEVER)
++               hide_icon();
++       else if (icon_policy == ICON_POLICY_ALWAYS)
++               show_icon();
++       else if (icon_policy == ICON_POLICY_PRESENT) {
++               if (adapter_present == TRUE)
++                       show_icon();
++               else
++                       hide_icon();
++       }
++}
++
+ static GConfEnumStringPair icon_policy_enum_map [] = {
+ 	{ ICON_POLICY_NEVER,	"never"		},
+ 	{ ICON_POLICY_ALWAYS,	"always"	},
+@@ -313,16 +327,7 @@
+ 
+ 		gconf_string_to_enum(icon_policy_enum_map, str, &icon_policy);
+ 
+-		if (icon_policy == ICON_POLICY_NEVER)
+-			hide_icon();
+-		else if (icon_policy == ICON_POLICY_ALWAYS)
+-			show_icon();
+-		else if (icon_policy == ICON_POLICY_PRESENT) {
+-			if (adapter_present == TRUE)
+-				show_icon();
+-			else
+-				hide_icon();
+-		}
++		update_icon_visibility();
+ 		return;
+ 	}
+ 
+@@ -410,8 +415,7 @@
+ 
+ 	statusicon = init_notification();
+ 
+-	if (icon_policy != ICON_POLICY_ALWAYS && adapter_present == FALSE)
+-		hide_icon();
++	update_icon_visibility();
+ 
+ 	g_signal_connect(statusicon, "activate",
+ 				G_CALLBACK(activate_callback), NULL);

Added: 10_wizard-custom-pin.patch
===================================================================
--- 10_wizard-custom-pin.patch	                        (rev 0)
+++ 10_wizard-custom-pin.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,209 @@
+# Description: Allow the user to enter a custom PIN for pairing. A lot of devices use a hardcoded PIN and do not have a keyboard for entering a random one.
+# Ubuntu: https://launchpad.net/bugs/284994
+# Upstream: http://bugzilla.gnome.org/show_bug.cgi?id=570457
+Index: bluez-gnome-1.8/wizard/main.c
+===================================================================
+--- bluez-gnome-1.8.orig/wizard/main.c
++++ bluez-gnome-1.8/wizard/main.c
+@@ -27,6 +27,7 @@
+ 
+ #include <glib/gi18n.h>
+ #include <gtk/gtk.h>
++#include <gdk/gdkkeysyms.h>
+ 
+ #include <dbus/dbus-glib.h>
+ 
+@@ -47,6 +48,11 @@ static gchar *target_pincode = NULL;
+ static guint target_type = BLUETOOTH_TYPE_ANY;
+ static gboolean target_ssp = FALSE;
+ 
++/* NULL means automatic, anything else is a pincode specified by the user */
++static const gchar *user_pincode = NULL;
++static const gchar *last_fixed_pincode = "0000";
++
++static GtkWidget *window_assistant = NULL;
+ static GtkWidget *page_search = NULL;
+ static GtkWidget *page_setup = NULL;
+ static GtkWidget *page_summary = NULL;
+@@ -72,6 +78,9 @@ static gboolean pincode_callback(DBusGMe
+ 				target_type == BLUETOOTH_TYPE_HEADPHONE)
+ 		pincode = "0000";
+ 
++	if (user_pincode != NULL && strlen(user_pincode) == 4)
++		pincode = user_pincode;
++
+ 	text = g_strdup_printf(_("Please enter the following PIN code: %s"),
+ 								pincode);
+ 	gtk_label_set_markup(GTK_LABEL(label_passkey), text);
+@@ -337,6 +346,19 @@ static void create_type(GtkWidget *assis
+ }
+ #endif
+ 
++static void set_page_search_complete(void)
++{
++	int selected;
++	gboolean complete;
++
++	selected = gtk_tree_selection_count_selected_rows (search_selection);
++	complete = (selected != 0 &&
++			(user_pincode == NULL || strlen(user_pincode) == 4));
++
++	gtk_assistant_set_page_complete(GTK_ASSISTANT (window_assistant),
++					page_search, complete);
++}
++
+ static void select_callback(GtkTreeSelection *selection, gpointer user_data)
+ {
+ 	GtkAssistant *assistant = user_data;
+@@ -368,7 +390,7 @@ static void select_callback(GtkTreeSelec
+ 		target_type = type;
+ 	}
+ 
+-	gtk_assistant_set_page_complete(assistant, page_search, selected);
++	set_page_search_complete();
+ }
+ 
+ static gboolean device_filter(GtkTreeModel *model,
+@@ -381,6 +403,54 @@ static gboolean device_filter(GtkTreeMod
+ 	return (paired == TRUE) ? FALSE : TRUE;
+ }
+ 
++static gboolean entry_custom_event(GtkWidget *entry,
++					GdkEventKey *event, GtkWidget *box)
++{
++	if (event->length == 0)
++		return FALSE;
++
++	if ((event->keyval >= GDK_0 && event->keyval <= GDK_9) ||
++	    (event->keyval >= GDK_KP_0 && event->keyval <= GDK_KP_9))
++		return FALSE;
++
++	return TRUE;
++}
++
++static void entry_custom_changed(GtkWidget *entry, gpointer user_data)
++{
++	user_pincode = gtk_entry_get_text(GTK_ENTRY(entry));
++	set_page_search_complete();
++}
++
++static void toggle_set_sensitive(GtkWidget *button, GtkWidget *widget)
++{
++	gboolean active;
++
++	active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
++	gtk_widget_set_sensitive(widget, active);
++}
++
++static void set_user_pincode(GtkWidget *button, const gchar *pincode)
++{
++	if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
++		return;
++
++	if (pincode == NULL && user_pincode != NULL)
++		last_fixed_pincode = user_pincode;
++
++	user_pincode = pincode;
++	set_page_search_complete();
++}
++
++static void set_from_last_fixed_pincode(GtkWidget *button, gpointer user_data)
++{
++	if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
++		return;
++
++	user_pincode = last_fixed_pincode;
++	set_page_search_complete();
++}
++
+ static void create_search(GtkWidget *assistant)
+ {
+ 	GtkWidget *vbox;
+@@ -389,6 +459,16 @@ static void create_search(GtkWidget *ass
+ 	GtkTreeModel *model;
+ 	GtkTreeModel *sorted;
+ 	GtkTreeSelection *selection;
++	GtkWidget *radio_auto;
++	GtkWidget *radio_fixed;
++	GtkWidget *align_fixed;
++	GtkWidget *vbox_fixed;
++	GtkWidget *radio_0000;
++	GtkWidget *radio_1111;
++	GtkWidget *radio_1234;
++	GtkWidget *hbox_custom;
++	GtkWidget *radio_custom;
++	GtkWidget *entry_custom;
+ 
+ 	vbox = create_vbox(assistant, GTK_ASSISTANT_PAGE_CONTENT,
+ 				_("Device search"),
+@@ -418,6 +498,62 @@ static void create_search(GtkWidget *ass
+ 
+ 	gtk_container_add(GTK_CONTAINER(scrolled), tree);
+ 
++	radio_auto = gtk_radio_button_new_with_mnemonic(NULL,
++					_("_Automatic PIN code selection"));
++	gtk_container_add(GTK_CONTAINER(vbox), radio_auto);
++
++	radio_fixed = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(radio_auto), _("Use _fixed PIN code:"));
++	gtk_container_add(GTK_CONTAINER(vbox), radio_fixed);
++
++	align_fixed = gtk_alignment_new(0, 0, 1, 1);
++	gtk_alignment_set_padding(GTK_ALIGNMENT(align_fixed), 0, 0, 24, 0);
++	gtk_container_add(GTK_CONTAINER(vbox), align_fixed);
++	vbox_fixed = gtk_vbox_new(FALSE, 0);
++	gtk_container_add(GTK_CONTAINER(align_fixed), vbox_fixed);
++
++	radio_0000 = gtk_radio_button_new_with_label(NULL, _("'0000' (most headsets, mice and GPS devices)"));
++	gtk_container_add(GTK_CONTAINER(vbox_fixed), radio_0000);
++
++	radio_1111 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_0000), _("'1111'"));
++	gtk_container_add(GTK_CONTAINER(vbox_fixed), radio_1111);
++
++	radio_1234 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_0000), _("'1234'"));
++	gtk_container_add(GTK_CONTAINER(vbox_fixed), radio_1234);
++
++	hbox_custom = gtk_hbox_new(FALSE, 6);
++	radio_custom = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio_0000), _("Custom PIN code:"));
++	entry_custom = gtk_entry_new_with_max_length(4);
++	gtk_entry_set_width_chars(GTK_ENTRY(entry_custom), 4);
++        g_signal_connect (entry_custom, "key-press-event",
++			  G_CALLBACK (entry_custom_event), NULL);
++        g_signal_connect (entry_custom, "changed",
++			  G_CALLBACK (entry_custom_changed), NULL);
++	gtk_box_pack_start(GTK_BOX(hbox_custom), radio_custom,
++			FALSE, FALSE, 0);
++	gtk_box_pack_start(GTK_BOX(hbox_custom), entry_custom,
++			FALSE, FALSE, 0);
++	gtk_container_add(GTK_CONTAINER(vbox_fixed), hbox_custom);
++
++	toggle_set_sensitive(radio_fixed, vbox_fixed);
++	g_signal_connect(radio_fixed, "toggled",
++			G_CALLBACK(toggle_set_sensitive), vbox_fixed);
++	toggle_set_sensitive(radio_custom, entry_custom);
++	g_signal_connect(radio_custom, "toggled",
++			G_CALLBACK(toggle_set_sensitive), entry_custom);
++
++	g_signal_connect(radio_auto, "toggled",
++			G_CALLBACK(set_user_pincode), NULL);
++	g_signal_connect(radio_fixed, "toggled",
++			G_CALLBACK(set_from_last_fixed_pincode), NULL);
++	g_signal_connect(radio_0000, "toggled",
++			G_CALLBACK(set_user_pincode), "0000");
++	g_signal_connect(radio_1111, "toggled",
++			G_CALLBACK(set_user_pincode), "1111");
++	g_signal_connect(radio_1234, "toggled",
++			G_CALLBACK(set_user_pincode), "1234");
++        g_signal_connect_swapped (radio_custom, "toggled",
++			  G_CALLBACK (entry_custom_changed), entry_custom);
++
+ 	page_search = vbox;
+ }
+ 
+@@ -529,6 +665,7 @@ int main(int argc, char *argv[])
+ 	bluetooth_agent_setup(agent, AGENT_PATH);
+ 
+ 	window = create_wizard();
++	window_assistant = window;
+ 
+ 	bluetooth_instance_set_window(instance, GTK_WINDOW(window));
+ 

Added: 11_bluez-notifications.patch
===================================================================
--- 11_bluez-notifications.patch	                        (rev 0)
+++ 11_bluez-notifications.patch	2009-06-14 15:52:48 UTC (rev 42442)
@@ -0,0 +1,174 @@
+#
+# Ubuntu: https://bugs.launchpad.net/ubuntu/+source/bluez-gnome/+bug/337219
+# Upstream: http://permalink.gmane.org/gmane.linux.bluez.kernel/1912
+# Description: Check if actions are supported by the notification daemon 
+#              and display an unfocused alert box if they aren't
+#
+=== modified file 'applet/agent.c'
+--- old/applet/agent.c	2008-10-30 18:07:50 +0000
++++ new/applet/agent.c	2009-03-27 14:45:19 +0000
+@@ -258,7 +258,10 @@
+ 	gtk_window_set_title(GTK_WINDOW(dialog), _("Authentication request"));
+ 	gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
+ 	gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
+-	gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
++        if (supports_actions ())
++          gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
++        else
++          gtk_window_set_focus_on_map(GTK_WINDOW(dialog), FALSE);
+ 	gtk_window_set_urgency_hint(GTK_WINDOW(dialog), TRUE);
+ 	gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
+ 	input->dialog = dialog;
+@@ -530,13 +533,18 @@
+ 	gtk_window_present(GTK_WINDOW(input->dialog));
+ }
+ 
+-static void notification_closed(GObject *object, gpointer user_data)
++static void present_notification_dialogs ()
+ {
+ 	g_list_foreach(input_list, show_dialog, NULL);
+ 
+ 	disable_blinking();
+ }
+ 
++static void notification_closed (GObject *object, gpointer user_data)
++{
++  present_notification_dialogs ();
++}
++
+ #ifndef DBUS_TYPE_G_DICTIONARY
+ #define DBUS_TYPE_G_DICTIONARY \
+ 	(dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))
+@@ -587,9 +595,12 @@
+ 
+ 	g_free(name);
+ 
+-	show_notification(_("Bluetooth device"),
+-					line, _("Enter PIN code"), 0,
+-					G_CALLBACK(notification_closed));
++        if (supports_actions ())
++          show_notification(_("Bluetooth device"),
++                            line, _("Enter PIN code"), 0,
++                            G_CALLBACK(notification_closed));
++        else
++          present_notification_dialogs ();
+ 
+ 	g_free(line);
+ 
+@@ -634,9 +645,12 @@
+ 
+ 	g_free(name);
+ 
+-	show_notification(_("Bluetooth device"),
+-					line, _("Enter passkey"), 0,
+-					G_CALLBACK(notification_closed));
++        if (supports_actions ())
++          show_notification(_("Bluetooth device"),
++                            line, _("Enter passkey"), 0,
++                            G_CALLBACK(notification_closed));
++        else
++          present_notification_dialogs ();
+ 
+ 	g_free(line);
+ 
+@@ -684,9 +698,12 @@
+ 
+ 	g_free(name);
+ 
+-	show_notification(_("Bluetooth device"),
+-					line, _("Enter passkey"), 0,
+-					G_CALLBACK(notification_closed));
++        if (supports_actions ())
++          show_notification(_("Bluetooth device"),
++                            line, _("Enter passkey"), 0,
++                            G_CALLBACK(notification_closed));
++        else
++          present_notification_dialogs ();
+ 
+ 	g_free(line);
+ 
+@@ -733,9 +750,12 @@
+ 
+ 	g_free(name);
+ 
+-	show_notification(_("Bluetooth device"),
+-					line, _("Confirm passkey"), 0,
+-					G_CALLBACK(notification_closed));
++        if (supports_actions ())
++          show_notification(_("Bluetooth device"),
++                            line, _("Confirm passkey"), 0,
++                            G_CALLBACK(notification_closed));
++        else
++          present_notification_dialogs ();
+ 
+ 	g_free(line);
+ 
+@@ -778,9 +798,12 @@
+ 
+ 	g_free(name);
+ 
+-	show_notification(_("Bluetooth device"),
+-					line, _("Check authorization"), 0,
+-					G_CALLBACK(notification_closed));
++        if (supports_actions ())
++          show_notification(_("Bluetooth device"),
++                            line, _("Check authorization"), 0,
++                            G_CALLBACK(notification_closed));
++        else
++          present_notification_dialogs ();
+ 
+ 	g_free(line);
+ 
+
+=== modified file 'applet/notify.c'
+--- old/applet/notify.c	2008-10-30 18:07:50 +0000
++++ new/applet/notify.c	2009-03-27 14:42:17 +0000
+@@ -38,6 +38,35 @@
+ {
+ }
+ 
++gboolean
++supports_actions ()
++{
++  static gboolean supports_actions = FALSE;
++  static gboolean have_checked = FALSE;
++
++  if (!have_checked) {
++    GList *caps = NULL;
++    GList *c;
++
++    have_checked = TRUE;
++
++    caps = notify_get_server_caps ();
++    if (caps != NULL) {
++      for (c = caps; c != NULL; c = c->next) {
++        if (strcmp ((char*)c->data, "actions") == 0) {
++          supports_actions = TRUE;
++          break;
++        }
++      }
++
++      g_list_foreach (caps, (GFunc)g_free, NULL);
++      g_list_free (caps);
++    }
++  }
++
++  return supports_actions;
++}
++
+ void show_notification(const gchar *summary, const gchar *message,
+ 			const gchar *action, gint timeout, GCallback handler)
+ {
+
+=== modified file 'applet/notify.h'
+--- old/applet/notify.h	2008-10-30 18:07:50 +0000
++++ new/applet/notify.h	2009-03-27 14:42:47 +0000
+@@ -25,6 +25,7 @@
+ GtkStatusIcon *init_notification(void);
+ void cleanup_notification(void);
+ 
++gboolean supports_actions();
+ void show_notification(const gchar *summary, const gchar *message,
+ 			const gchar *action, gint timeout, GCallback handler);
+ void close_notification(void);
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-06-14 12:47:47 UTC (rev 42441)
+++ PKGBUILD	2009-06-14 15:52:48 UTC (rev 42442)
@@ -2,18 +2,48 @@
 # Contributor: Roman Kyrylych <roman at archlinux.org>
 pkgname=bluez-gnome
 pkgver=1.8
-pkgrel=4
+pkgrel=5
 pkgdesc="Bluetooth PIN helper applications"
 url="http://www.bluez.org/"
 arch=('i686' 'x86_64')
 license=('GPL2' 'LGPL')
-depends=('hal' 'libnotify>=0.4.4' 'gconf>=2.18.0.1' 'obex-data-server'
-         'bluez>=4.18' 'desktop-file-utils' 'hicolor-icon-theme')
-makedepends=('perlxml')
+depends=('hal' 'libnotify>=0.4.5' 'obex-data-server'
+         'bluez>=4.39' 'desktop-file-utils' 'hicolor-icon-theme' 'gconf>=2.26.0-2')
+makedepends=('intltool')
 options=('!emptydirs')
-source=("http://www.kernel.org/pub/linux/bluetooth/$pkgname-$pkgver.tar.bz2")
+install=bluez-gnome.install
+source=(http://www.kernel.org/pub/linux/bluetooth/$pkgname-$pkgver.tar.bz2
+        02_MenusRevisited.patch
+        04_bluetooth-sendto-ods-svn.patch
+        05_bluetooth_sendto_dbus-snd.patch
+        06_preferences-horizontal-layout.patch
+        07_null_device_name.patch
+        08_XFCE.patch
+        09_visibility.patch
+        10_wizard-custom-pin.patch
+        11_bluez-notifications.patch)
+md5sums=('dd4ebe771d9f2ebd739e1185b767ce3e'
+         '15a598f7cb1ea52f92e6e4604bdd7aed'
+         'e465609e96c5bf128a922b1ac8048b95'
+         '2835942c65d7e60b8a862a29e4569655'
+         'bba8e404c8d02d9374b458d6e33c5856'
+         'df501957838b055145c50c5618b2356c'
+         'a9a1c32d257aad39aad06bbc0e4eb38f'
+         '38d24248f0ecef4c93acafb429a28058'
+         '50e5d1f48b1d24fff1daa6e85d3f4b24'
+         'ac4b9824c1d01fc7edf84da7d748e957')
+
 build() {
   cd "$srcdir/$pkgname-$pkgver"
+  patch -Np1 -i "${srcdir}/02_MenusRevisited.patch" || return 1
+  patch -Np1 -i "${srcdir}/04_bluetooth-sendto-ods-svn.patch" || return 1
+  patch -Np1 -i "${srcdir}/05_bluetooth_sendto_dbus-snd.patch" || return 1
+  patch -Np1 -i "${srcdir}/06_preferences-horizontal-layout.patch" || return 1
+  patch -Np1 -i "${srcdir}/07_null_device_name.patch" || return 1
+  patch -Np1 -i "${srcdir}/08_XFCE.patch" || return 1
+  patch -Np1 -i "${srcdir}/09_visibility.patch" || return 1
+  patch -Np1 -i "${srcdir}/10_wizard-custom-pin.patch" || return 1
+  patch -Np1 -i "${srcdir}/11_bluez-notifications.patch" || return 1
   ./configure --prefix=/usr \
               --sysconfdir=/etc \
               --localstatedir=/var \
@@ -22,10 +52,9 @@
               --disable-mime-update \
               --disable-icon-update || return 1
   make || return 1
-  make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="$pkgdir" install || return 1
-  install -d "$pkgdir/usr/share/gconf/schemas"
-  gconf-merge-schema "$pkgdir/usr/share/gconf/schemas/$pkgname.schemas" \
-                     "$pkgdir/etc/gconf/schemas/*.schemas"
+  make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="${pkgdir}" install || return 1
+  install -d "${pkgdir}/usr/share/gconf/schemas"
+  gconf-merge-schema "${pkgdir}/usr/share/gconf/schemas/${pkgname}.schemas" \
+    --domain bluetooth-manager ${pkgdir}/etc/gconf/schemas/*.schemas || return 1
   rm -f "$pkgdir/etc/gconf/schemas/*.schemas"
 }
-md5sums=('dd4ebe771d9f2ebd739e1185b767ce3e')

Modified: bluez-gnome.install
===================================================================
--- bluez-gnome.install	2009-06-14 12:47:47 UTC (rev 42441)
+++ bluez-gnome.install	2009-06-14 15:52:48 UTC (rev 42442)
@@ -1,24 +1,23 @@
 pkgname=bluez-gnome
 
 post_install() {
-  usr/sbin/gconfpkg --install ${pkgname}
   update-desktop-database -q
   gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+  update-mime-database usr/share/mime >/dev/null
+  usr/sbin/gconfpkg --install ${pkgname}
 }
 
-pre_upgrade() {
-  pre_remove $1
-}
-
 post_upgrade() {
-  post_install $1
+  post_install
 }
 
 pre_remove() {
   usr/sbin/gconfpkg --uninstall ${pkgname}
 }
 
+pre_upgrade() {
+  pre_remove
+}
 post_remove() {
-  update-desktop-database -q
-  gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+  post_install
 }




More information about the arch-commits mailing list