[svn] pinentry - r206 - in trunk: . gtk+-2

svn author marcus cvs at cvs.gnupg.org
Fri Jun 19 03:25:46 CEST 2009


Author: marcus
Date: 2009-06-19 03:25:45 +0200 (Fri, 19 Jun 2009)
New Revision: 206

Modified:
   trunk/ChangeLog
   trunk/gtk+-2/gtksecentry.c
Log:
2009-04-24  Guido Guenther <agx at sigxcpu.org>

	* gtk+-2/gtksecentry.c (gtk_secure_entry_class_init): Don't
	install "gtk-entry-select-on-focus" settings property since it
	clashes with the one from GtkEntry.
	(gtk_secure_entry_grab_focus): Create a temporary GtkEntry widget
	to read that value instead. Allows to have GtkEntry and
	GtkSecureEntry in the same process.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-06-19 00:09:52 UTC (rev 205)
+++ trunk/ChangeLog	2009-06-19 01:25:45 UTC (rev 206)
@@ -1,3 +1,12 @@
+2009-04-24  Guido Guenther <agx at sigxcpu.org>
+
+	* gtk+-2/gtksecentry.c (gtk_secure_entry_class_init): Don't
+	install "gtk-entry-select-on-focus" settings property since it
+	clashes with the one from GtkEntry.
+	(gtk_secure_entry_grab_focus): Create a temporary GtkEntry widget
+	to read that value instead. Allows to have GtkEntry and
+	GtkSecureEntry in the same process.
+
 2009-06-19  Marcus Brinkmann  <marcus at g10code.de>
 
 	Suggested by Simon McVittie:

Modified: trunk/gtk+-2/gtksecentry.c
===================================================================
--- trunk/gtk+-2/gtksecentry.c	2009-06-19 00:09:52 UTC (rev 205)
+++ trunk/gtk+-2/gtksecentry.c	2009-06-19 01:25:45 UTC (rev 206)
@@ -665,13 +665,6 @@
 				 GDK_CONTROL_MASK, "delete_from_cursor", 2,
 				 G_TYPE_ENUM, GTK_DELETE_WORD_ENDS,
 				 G_TYPE_INT, -1);
-
-    gtk_settings_install_property(g_param_spec_boolean
-				  ("gtk-entry-select-on-focus",
-				   _("Select on focus"),
-				   _
-				   ("Whether to select the contents of an entry when it is focused"),
-				   TRUE, G_PARAM_READWRITE));
 }
 
 static void
@@ -1349,14 +1342,18 @@
 static void
 gtk_secure_entry_grab_focus(GtkWidget * widget)
 {
+    GtkWidget *tmp;
     GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget);
     gboolean select_on_focus;
 
     GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT);
     GTK_WIDGET_CLASS(parent_class)->grab_focus(widget);
 
-    g_object_get(gtk_widget_get_settings(widget),
+    /* read current select on focus setting from GtkEntry */
+    tmp = gtk_entry_new ();
+    g_object_get(gtk_widget_get_settings(tmp),
 		 "gtk-entry-select-on-focus", &select_on_focus, NULL);
+    gtk_widget_destroy (tmp);
 
     if (select_on_focus && !entry->in_click)
 	gtk_editable_select_region(GTK_EDITABLE(widget), 0, -1);




More information about the Gnupg-commits mailing list