[maemo-commits] [maemo-commits] r15324 - in projects/haf/trunk/hildon-1: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Mar 27 14:21:50 EET 2008
Author: mitch
Date: 2008-03-27 14:21:47 +0200 (Thu, 27 Mar 2008)
New Revision: 15324

Modified:
   projects/haf/trunk/hildon-1/ChangeLog
   projects/haf/trunk/hildon-1/src/hildon-code-dialog.c
Log:
2008-03-27  Michael Natterer  <mitch at imendio.com>

	Fixes: NB#81696: The passcode is not overwritten even after
	selecting

	* src/hildon-code-dialog.c
	(hildon_code_dialog_button_clicked)
	(hildon_code_dialog_im_commit): don't use gtk_entry_append_text()
	because that doesn't overwrite selected text. Instead, emit the
	"commit" signal on the entry's im_context so the entry's normal
	insert logic is triggered. Set the cursor to the end of the entry
	after each insert operation so that we *only* insert in the middle
	of the text if something was selected.



Modified: projects/haf/trunk/hildon-1/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-1/ChangeLog	2008-03-27 10:52:14 UTC (rev 15323)
+++ projects/haf/trunk/hildon-1/ChangeLog	2008-03-27 12:21:47 UTC (rev 15324)
@@ -1,5 +1,19 @@
 2008-03-27  Michael Natterer  <mitch at imendio.com>
 
+	Fixes: NB#81696: The passcode is not overwritten even after
+	selecting
+
+	* src/hildon-code-dialog.c
+	(hildon_code_dialog_button_clicked)
+	(hildon_code_dialog_im_commit): don't use gtk_entry_append_text()
+	because that doesn't overwrite selected text. Instead, emit the
+	"commit" signal on the entry's im_context so the entry's normal
+	insert logic is triggered. Set the cursor to the end of the entry
+	after each insert operation so that we *only* insert in the middle
+	of the text if something was selected.
+
+2008-03-27  Michael Natterer  <mitch at imendio.com>
+
 	Enable fixing: NB#79916 and NB#79918: The help topic for Color
 	selector cannot be opened
 

Modified: projects/haf/trunk/hildon-1/src/hildon-code-dialog.c
===================================================================
--- projects/haf/trunk/hildon-1/src/hildon-code-dialog.c	2008-03-27 10:52:14 UTC (rev 15323)
+++ projects/haf/trunk/hildon-1/src/hildon-code-dialog.c	2008-03-27 12:21:47 UTC (rev 15324)
@@ -450,7 +450,14 @@
 
     if (number && *number )
     {
-        gtk_entry_append_text (GTK_ENTRY (priv->entry), number);
+        gtk_editable_set_editable (GTK_EDITABLE (priv->entry), TRUE);
+
+        g_signal_emit_by_name (GTK_ENTRY (priv->entry)->im_context, "commit",
+                               number);
+
+        gtk_editable_set_editable (GTK_EDITABLE (priv->entry), FALSE);
+
+        gtk_editable_set_position (GTK_EDITABLE (priv->entry), -1);
     }
     else
     {
@@ -473,7 +480,14 @@
 
     if (g_ascii_isdigit(*utf8))
     {
-        gtk_entry_append_text (GTK_ENTRY (priv->entry), utf8);
+        gtk_editable_set_editable (GTK_EDITABLE (priv->entry), TRUE);
+
+        g_signal_emit_by_name (GTK_ENTRY (priv->entry)->im_context, "commit",
+                               utf8);
+
+        gtk_editable_set_editable (GTK_EDITABLE (priv->entry), FALSE);
+
+        gtk_editable_set_position (GTK_EDITABLE (priv->entry), -1);
     }
 }
 


More information about the maemo-commits mailing list