[gnome-bluetooth] Display passkey for simple pairing



commit 9fdd02eb8b4022c381e8c5825acad83b7704e2b8
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jun 12 23:35:20 2009 +0100

    Display passkey for simple pairing
    
    Though we're still missing a way to confirm the key...

 wizard/main.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index 4068c83..5bba491 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -117,8 +117,25 @@ static gboolean confirm_callback(DBusGMethodInvocation *context,
 				 guint passkey,
 				 gpointer user_data)
 {
-	g_message ("got confirm callback");
-	g_message ("FIXME");
+	char *str, *label;
+
+	target_ssp = TRUE;
+
+	gtk_widget_show (label_passkey_help);
+	label = g_strdup_printf (_("Please confirm that the passkey displayed on '%s' matches this one"),
+				 target_name);
+	gtk_label_set_markup(GTK_LABEL(label_passkey_help), label);
+	g_free (label);
+
+	gtk_widget_show (label_passkey);
+	str = g_strdup_printf ("%d", passkey);
+	set_large_label (GTK_LABEL (label_passkey), str);
+	g_free (str);
+
+	//FIXME show the buttons,
+	//and call
+	//dbus_g_method_return(context, ""); if match
+	//dbus_g_method_return(context, error); if not (see applet)
 
 	return FALSE;
 }
@@ -129,6 +146,8 @@ static gboolean display_callback(DBusGMethodInvocation *context,
 {
 	gchar *text, *done, *code;
 
+	target_ssp = TRUE;
+
 	g_message ("got display callback");
 
 	code = g_strdup_printf("%d", passkey);
@@ -155,8 +174,6 @@ static gboolean display_callback(DBusGMethodInvocation *context,
 	g_free(done);
 	g_free(code);
 
-	target_ssp = TRUE;
-
 	dbus_g_method_return(context);
 
 	return TRUE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]