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

Re: gtkentry_password char



В Птн, 05/01/2007 в 00:32 +0100, Sven Arvidsson пишет:
> On Fri, 2007-01-05 at 02:07 +0300, Виталий Ищенко wrote:
> > Maybe use smth different, not just simple Black Circle :)
> > My suggestions:
> > 	✘ - U+2718 HEAVY BALLOT X         (✘✘✘✘✘✘✘✘)
> > 	✖ - U+2716 HEAVY MULTIPLICATION X (✖✖✖✖✖✖✖✖)
> > 	✱ - U+2713 HEAVY ASTERISK         (✱✱✱✱✱✱✱✱)
> > And if you think, that circle is better, better use medium black circle.
> > It has better spacing.
> > 	⚫ - U+26AB MEDIUM BLACK CIRCLE    (⚫⚫⚫⚫⚫⚫⚫⚫)
> 
> Black circle, Unicode 25CF seems to be the most popular choice. AFAIK
> the programs already overriding this, Seahorse, Screensaver etc. uses
> this and other distributions, Ubuntu and Fedora for example. (I think
> OpenSuSe uses small bullet, 2022).

Ok i've seen, that gnome-screensaver uses 25CF as default, but only if
dtk default is '*'
So I created patches for gnome-system-tools, libgksuui1.0, libgksu
(2.0.3), libgksu , seahorse (should be looked at more carefully.
Seahorse creates it's own widget, and I don't know better way to
discover default GtkEntry invisible char, than creating GtkEntry with
gtk_entry_new() and unreferencing it later)

I think that 3 first patches (gksu & g-s-t) is safe to apply, they will
simply use the default, defined during gtk compile

If somebody knows another apps which override default invisible char,
send it here :)

P.S. g-s-t forces '*' as default (in glade files)
> 
> Upstream discussion for this:
> http://bugzilla.gnome.org/show_bug.cgi?id=83935
> 

http://bugzilla.gnome.org/show_bug.cgi?id=307304
better place to look at, it makes sense
diff -u gnome-system-tools-2.14.0.old/interfaces/boot.glade.in gnome-system-tools-2.14.0/interfaces/boot.glade.in
--- gnome-system-tools-2.14.0.old/interfaces/boot.glade.in	2006-01-31 01:40:32.000000000 +0300
+++ gnome-system-tools-2.14.0/interfaces/boot.glade.in	2007-01-05 17:31:22.000000000 +0300
@@ -465,7 +465,6 @@
 	      <property name="max_length">0</property>
 	      <property name="text" translatable="yes"></property>
 	      <property name="has_frame">True</property>
-	      <property name="invisible_char">*</property>
 	      <property name="activates_default">False</property>
 	    </widget>
 	    <packing>
@@ -604,7 +603,6 @@
 	      <property name="max_length">0</property>
 	      <property name="text" translatable="yes"></property>
 	      <property name="has_frame">True</property>
-	      <property name="invisible_char">*</property>
 	      <property name="activates_default">False</property>
 	    </widget>
 	    <packing>
@@ -1115,7 +1113,6 @@
 	      <property name="max_length">0</property>
 	      <property name="text" translatable="yes"></property>
 	      <property name="has_frame">True</property>
-	      <property name="invisible_char">*</property>
 	      <property name="activates_default">False</property>
 	    </widget>
 	    <packing>
@@ -1136,7 +1133,6 @@
 	      <property name="max_length">0</property>
 	      <property name="text" translatable="yes"></property>
 	      <property name="has_frame">True</property>
-	      <property name="invisible_char">*</property>
 	      <property name="activates_default">False</property>
 	    </widget>
 	    <packing>
@@ -1621,7 +1617,6 @@
 	      <property name="max_length">0</property>
 	      <property name="text" translatable="yes"></property>
 	      <property name="has_frame">True</property>
-	      <property name="invisible_char">*</property>
 	      <property name="activates_default">False</property>
 	    </widget>
 	    <packing>
diff -u gnome-system-tools-2.14.0.old/interfaces/common.glade.in gnome-system-tools-2.14.0/interfaces/common.glade.in
--- gnome-system-tools-2.14.0.old/interfaces/common.glade.in	2006-01-31 01:40:32.000000000 +0300
+++ gnome-system-tools-2.14.0/interfaces/common.glade.in	2007-01-05 17:32:12.000000000 +0300
@@ -616,7 +616,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">True</property>
 		    </widget>
 		    <packing>
diff -u gnome-system-tools-2.14.0.old/interfaces/disks.glade.in gnome-system-tools-2.14.0/interfaces/disks.glade.in
--- gnome-system-tools-2.14.0.old/interfaces/disks.glade.in	2005-12-07 20:06:45.000000000 +0300
+++ gnome-system-tools-2.14.0/interfaces/disks.glade.in	2007-01-05 17:32:39.000000000 +0300
@@ -1769,7 +1769,6 @@
 				  <property name="max_length">0</property>
 				  <property name="text" translatable="yes"></property>
 				  <property name="has_frame">True</property>
-				  <property name="invisible_char">*</property>
 				  <property name="activates_default">False</property>
 				</widget>
 				<packing>
@@ -2477,7 +2476,6 @@
 				      <property name="max_length">0</property>
 				      <property name="text" translatable="yes"></property>
 				      <property name="has_frame">True</property>
-				      <property name="invisible_char">*</property>
 				      <property name="activates_default">False</property>
 				    </widget>
 				    <packing>
diff -u gnome-system-tools-2.14.0.old/interfaces/network.glade.in gnome-system-tools-2.14.0/interfaces/network.glade.in
--- gnome-system-tools-2.14.0.old/interfaces/network.glade.in	2006-01-31 01:40:32.000000000 +0300
+++ gnome-system-tools-2.14.0/interfaces/network.glade.in	2007-01-05 17:33:32.000000000 +0300
@@ -482,7 +482,6 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -503,7 +502,6 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -1104,7 +1102,6 @@
 	      <property name="max_length">0</property>
 	      <property name="text" translatable="yes"></property>
 	      <property name="has_frame">True</property>
-	      <property name="invisible_char">*</property>
 	      <property name="activates_default">True</property>
 	    </widget>
 	    <packing>
@@ -1471,7 +1468,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1718,7 +1714,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1739,7 +1734,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1760,7 +1754,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1921,7 +1914,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1942,7 +1934,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -2266,7 +2257,6 @@
 				  <property name="max_length">0</property>
 				  <property name="text" translatable="yes"></property>
 				  <property name="has_frame">True</property>
-				  <property name="invisible_char">*</property>
 				  <property name="activates_default">False</property>
 				</widget>
 				<packing>
@@ -2287,7 +2277,6 @@
 				  <property name="max_length">0</property>
 				  <property name="text" translatable="yes"></property>
 				  <property name="has_frame">True</property>
-				  <property name="invisible_char">*</property>
 				  <property name="activates_default">False</property>
 				</widget>
 				<packing>
@@ -2429,7 +2418,6 @@
 				  <property name="max_length">0</property>
 				  <property name="text" translatable="yes"></property>
 				  <property name="has_frame">True</property>
-				  <property name="invisible_char">*</property>
 				  <property name="activates_default">False</property>
 				</widget>
 				<packing>
@@ -2450,7 +2438,6 @@
 				  <property name="max_length">0</property>
 				  <property name="text" translatable="yes"></property>
 				  <property name="has_frame">True</property>
-				  <property name="invisible_char">*</property>
 				  <property name="activates_default">False</property>
 				</widget>
 				<packing>
@@ -3085,7 +3072,6 @@
 		  <property name="max_length">0</property>
 		  <property name="text" translatable="yes"></property>
 		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
 		  <property name="activates_default">False</property>
 		</widget>
 		<packing>
diff -u gnome-system-tools-2.14.0.old/interfaces/shares.glade.in gnome-system-tools-2.14.0/interfaces/shares.glade.in
--- gnome-system-tools-2.14.0.old/interfaces/shares.glade.in	2005-08-08 22:38:02.000000000 +0400
+++ gnome-system-tools-2.14.0/interfaces/shares.glade.in	2007-01-05 17:33:50.000000000 +0300
@@ -488,7 +488,6 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -537,7 +536,6 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -1090,7 +1088,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1146,7 +1143,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1237,7 +1233,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1258,7 +1253,6 @@
 			      <property name="max_length">0</property>
 			      <property name="text" translatable="yes"></property>
 			      <property name="has_frame">True</property>
-			      <property name="invisible_char">*</property>
 			      <property name="activates_default">False</property>
 			    </widget>
 			    <packing>
@@ -1549,7 +1543,6 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -1570,7 +1563,6 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -1676,7 +1668,6 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
diff -u gnome-system-tools-2.14.0.old/interfaces/time.glade.in gnome-system-tools-2.14.0/interfaces/time.glade.in
--- gnome-system-tools-2.14.0.old/interfaces/time.glade.in	2006-01-31 01:40:32.000000000 +0300
+++ gnome-system-tools-2.14.0/interfaces/time.glade.in	2007-01-05 17:32:04.000000000 +0300
@@ -878,7 +878,6 @@
 		  <property name="max_length">0</property>
 		  <property name="text" translatable="yes"></property>
 		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
 		  <property name="activates_default">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">NTP server</atkproperty>
diff -u gnome-system-tools-2.14.0.old/interfaces/users.glade.in gnome-system-tools-2.14.0/interfaces/users.glade.in
--- gnome-system-tools-2.14.0.old/interfaces/users.glade.in	2006-01-12 01:44:19.000000000 +0300
+++ gnome-system-tools-2.14.0/interfaces/users.glade.in	2007-01-05 17:31:54.000000000 +0300
@@ -866,7 +866,6 @@
 		  <property name="max_length">0</property>
 		  <property name="text" translatable="yes"></property>
 		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
 		  <property name="activates_default">False</property>
 		</widget>
 		<packing>
@@ -1405,7 +1404,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -1426,7 +1424,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -1578,7 +1575,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -1599,7 +1595,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -1620,7 +1615,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -1668,7 +1662,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -1762,7 +1755,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -1783,7 +1775,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -1839,7 +1830,6 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -2520,7 +2510,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -3143,7 +3132,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -3164,7 +3152,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
@@ -3371,7 +3358,6 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		    </widget>
 		    <packing>
--- libgksuui1.0-1.0.7.old/libgksuui/gksuui-dialog.c	2005-07-21 00:11:15.000000000 +0400
+++ libgksuui1.0-1.0.7/libgksuui/gksuui-dialog.c	2007-01-05 14:21:52.000000000 +0300
@@ -156,7 +156,8 @@
 			    G_CALLBACK(gtk_button_clicked), 
 			    gksuui_dialog->ok_button);
   gtk_entry_set_visibility(GTK_ENTRY(gksuui_dialog->entry), FALSE);
-  gtk_entry_set_invisible_char(GTK_ENTRY(gksuui_dialog->entry), 0x25cf); 
+  if ('*' == gtk_entry_get_invisible_char(GTK_ENTRY(gksuui_dialog->entry)))
+    gtk_entry_set_invisible_char(GTK_ENTRY(gksuui_dialog->entry), 0x25cf); 
   gtk_box_pack_start (GTK_BOX (hbox), gksuui_dialog->entry, 
 		      TRUE, TRUE, 0);
   gtk_widget_show (gksuui_dialog->entry);
--- libgksu-2.0.3.old/libgksuui/gksuui-dialog.c	2006-10-15 07:32:10.000000000 +0400
+++ libgksu-2.0.3/libgksuui/gksuui-dialog.c	2007-01-05 14:25:49.000000000 +0300
@@ -365,7 +365,8 @@
 			    G_CALLBACK(gtk_button_clicked),
 			    gksuui_dialog->ok_button);
   gtk_entry_set_visibility(GTK_ENTRY(gksuui_dialog->entry), FALSE);
-  gtk_entry_set_invisible_char(GTK_ENTRY(gksuui_dialog->entry), 0x25cf);
+  if ('*' == gtk_entry_get_invisible_char(GTK_ENTRY(gksuui_dialog->entry)))
+    gtk_entry_set_invisible_char(GTK_ENTRY(gksuui_dialog->entry), 0x25cf);
   gtk_box_pack_start (GTK_BOX (hbox), gksuui_dialog->entry,
 		      TRUE, TRUE, 0);
   gtk_widget_show (gksuui_dialog->entry);
--- seahorse-0.9.7.old/libseahorse/seahorse-secure-entry.c	2006-09-16 20:19:16.000000000 +0400
+++ seahorse-0.9.7/libseahorse/seahorse-secure-entry.c	2007-01-05 17:13:01.000000000 +0300
@@ -498,6 +498,7 @@
 seahorse_secure_entry_init (SeahorseSecureEntry *entry)
 {
     GtkStyle *style;
+    GtkEntry *gtk_entry;
     
     GTK_WIDGET_SET_FLAGS (entry, GTK_CAN_FOCUS);
 
@@ -511,7 +512,18 @@
     entry->text[0] = '\0';
 
     entry->visibility = FALSE;
-    entry->invisible_char = 0x25cf;
+    /**
+     * FIXME: It is better to get default
+     * invisible char from GtkEntry
+     */
+    gtk_entry = gtk_entry_new ();
+    if ('*' == gtk_entry_get_invisible_char (GTK_ENTRY (gtk_entry)))
+        entry->invisible_char = 0x25cf;
+    else
+        entry->invisible_char = gtk_entry_get_invisible_char (GTK_ENTRY (gtk_entry));
+    g_object_ref_sink((gpointer)gtk_entry);
+    g_object_unref((gpointer)gtk_entry);
+    //g_free(gtk_entry);
     entry->width_chars = -1;
     entry->is_cell_renderer = FALSE;
     entry->editing_canceled = FALSE;

Reply to: