CC-ed from the relevant bug discussion. This is my first GTK program
(at least the original modal dialog), so it is probably horrid, but
solves the problem. I don't know how to integrate it with the wizard
gtk objects (it would require either a new PIN selection page, or
something in the existing page adding a text entry to the label and
something to pause it until something was clicked). It also needs
checking and verification/validation added. If it was in PyGtk I'd do
better.
On Tue, Nov 11, 2008 at 9:11 AM, tz <email address hidden> wrote:
> I wrote a followup - a web page for every owner of a bluetooth device
> that needs a special PIN that would submit it as a new bug report is
> possible...
>
> Perhaps Ubuntu can write its own patch - it looks simple enough but I
> would need time to add the panel (I've only done Gtk in Python).
>
> The short answer is it cannot be hardcoded which is why every other
> implementation (e.g. my Nokia tablet, or even my phone) doesn't do so.
> They typicall present something random but editable.
>
> On Tue, Nov 11, 2008 at 8:23 AM, spaetz <email address hidden> wrote:
>> I must say I find the upstream reaction rather less helpful and optimal.
>> (http://bugzilla.gnome.org/show_bug.cgi?id=560315#c5)
>>
>> bluez-gnome seems to intent to special case each non-keyboard device in
>> their source code rather than just allowing people to enter a fixed PIN
>> in the wizard. Hardcoding the stuff is bound to lag behind existing
>> devices and seems a rather bloaty solution to me. Most of the time
>> people would know best whether to use 1234 or 0000 or somesuch.
>> Whatever.
>>
>> As a consequence, I stop caring about upstream and work around this with
>> a custom shell script.
>>
>> --
>> bluetooth-wizard unable to pair to fixed pin devices
>> https://bugs.launchpad.net/bugs/284994
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>
CC-ed from the relevant bug discussion. This is my first GTK program validation added. If it was in PyGtk I'd do
(at least the original modal dialog), so it is probably horrid, but
solves the problem. I don't know how to integrate it with the wizard
gtk objects (it would require either a new PIN selection page, or
something in the existing page adding a text entry to the label and
something to pause it until something was clicked). It also needs
checking and verification/
better.
diff -Bbur bluez-gnome- 1.8/wizard/ main.c bluez-gnome- 1.8-tz/ wizard/ main.c 1.8/wizard/ main.c 2008-10-04 14:32:56.000000000 -0500 1.8-tz/ wizard/ main.c 2008-11-11 10:54:13.000000000 -0600
--- bluez-gnome-
+++ bluez-gnome-
@@ -56,6 +56,34 @@
static GtkTreeSelection *search_selection = NULL;
+static GtkWidget *pinentry, *pindialog; pinentry) ); pinentry) ,target_ pincode ); new_with_ label(" Pair"); connect_ object( GTK_OBJECT (button), "clicked", clicked , NULL); pindialog) ->action_ area), button); pindialog) ->vbox) , label); pindialog) ->vbox) , pinentry); pindialog) ); callback( DBusGMethodInvo cation *context, TYPE_HEADPHONE)
+static char usepincode[32];
+void clicked()
+{
+ char *text;
+
+ text = gtk_entry_get_text( GTK_ENTRY(
+ strcpy( usepincode, text );
+ gtk_widget_destroy( pindialog );
+}
+
+static void run_pin_dialog()
+{
+ GtkWidget *label, *button;
+
+ pindialog = gtk_dialog_new();
+ label = gtk_label_new ("Passkey for Pairing");
+ pinentry = gtk_entry_new ();
+ gtk_entry_set_text( GTK_ENTRY(
+ button = gtk_button_
+ gtk_signal_
+ gtk_container_add (GTK_CONTAINER
(GTK_DIALOG(
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG(
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG(
+ gtk_widget_show_all (pindialog);
+ gtk_dialog_run( GTK_DIALOG(
+}
+
static gboolean pincode_
DBusGProxy *device, gpointer user_data)
{
@@ -72,12 +100,19 @@
target_type == BLUETOOTH_
pincode = "0000";
+ printf( _("Please enter the following PIN code: %s"), set_markup( GTK_LABEL( label_passkey) , text);
+ target_pincode = pincode;
+
+ strcpy( usepincode, pincode );
+
+ run_pin_dialog();
+
text = g_strdup_
- pincode);
+ usepincode);
gtk_label_
g_free(text);
- dbus_g_ method_ return( context, pincode); method_ return( context, usepincode);
+ dbus_g_
return TRUE;
}
On Tue, Nov 11, 2008 at 9:11 AM, tz <email address hidden> wrote: bugzilla. gnome.org/ show_bug. cgi?id= 560315# c5) /bugs.launchpad .net/bugs/ 284994
> I wrote a followup - a web page for every owner of a bluetooth device
> that needs a special PIN that would submit it as a new bug report is
> possible...
>
> Perhaps Ubuntu can write its own patch - it looks simple enough but I
> would need time to add the panel (I've only done Gtk in Python).
>
> The short answer is it cannot be hardcoded which is why every other
> implementation (e.g. my Nokia tablet, or even my phone) doesn't do so.
> They typicall present something random but editable.
>
> On Tue, Nov 11, 2008 at 8:23 AM, spaetz <email address hidden> wrote:
>> I must say I find the upstream reaction rather less helpful and optimal.
>> (http://
>>
>> bluez-gnome seems to intent to special case each non-keyboard device in
>> their source code rather than just allowing people to enter a fixed PIN
>> in the wizard. Hardcoding the stuff is bound to lag behind existing
>> devices and seems a rather bloaty solution to me. Most of the time
>> people would know best whether to use 1234 or 0000 or somesuch.
>> Whatever.
>>
>> As a consequence, I stop caring about upstream and work around this with
>> a custom shell script.
>>
>> --
>> bluetooth-wizard unable to pair to fixed pin devices
>> https:/
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>