diff -Bbur bluez-gnome-1.8/wizard/main.c bluez-gnome-1.8-tz/wizard/main.c --- bluez-gnome-1.8/wizard/main.c 2008-10-04 14:32:56.000000000 -0500 +++ bluez-gnome-1.8-tz/wizard/main.c 2008-11-11 10:54:13.000000000 -0600 @@ -56,6 +56,34 @@ static GtkTreeSelection *search_selection = NULL; +static GtkWidget *pinentry, *pindialog; +static char usepincode[32]; +void clicked() +{ + char *text; + + text = gtk_entry_get_text( GTK_ENTRY(pinentry)); + 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(pinentry),target_pincode ); + button = gtk_button_new_with_label("Pair"); + gtk_signal_connect_object(GTK_OBJECT (button), "clicked", clicked , NULL); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG(pindialog)->action_area), button); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG(pindialog)->vbox), label); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG(pindialog)->vbox), pinentry); + gtk_widget_show_all (pindialog); + gtk_dialog_run( GTK_DIALOG(pindialog) ); +} + static gboolean pincode_callback(DBusGMethodInvocation *context, DBusGProxy *device, gpointer user_data) { @@ -72,12 +100,19 @@ target_type == BLUETOOTH_TYPE_HEADPHONE) pincode = "0000"; + + target_pincode = pincode; + + strcpy( usepincode, pincode ); + + run_pin_dialog(); + text = g_strdup_printf(_("Please enter the following PIN code: %s"), - pincode); + usepincode); gtk_label_set_markup(GTK_LABEL(label_passkey), text); g_free(text); - dbus_g_method_return(context, pincode); + dbus_g_method_return(context, usepincode); return TRUE; }