[gnome-control-center] User accounts: Get the invisible char to use from GTK+



commit 14e503fa2cf8776853e5d7e1be94258cb2015b85
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 23 21:46:37 2011 -0500

    User accounts: Get the invisible char to use from GTK+
    
    https://bugzilla.gnome.org/show_bug.cgi?id=643103

 panels/user-accounts/um-user-panel.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)
---
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 35b3de5..707e294 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -464,6 +464,32 @@ delete_user (GtkButton *button, UmUserPanelPrivate *d)
 }
 
 static const gchar *
+get_invisible_text (void)
+{
+   GtkWidget *entry;
+   gunichar invisible_char;
+   static gchar invisible_text[40];
+   gchar *p;
+   gint i;
+
+   entry = gtk_entry_new ();
+   invisible_char = gtk_entry_get_invisible_char (GTK_ENTRY (entry));
+   if (invisible_char == 0)
+     invisible_char = 0x2022;
+
+   g_object_ref_sink (entry);
+   g_object_unref (entry);
+
+   /* five bullets */
+   p = invisible_text;
+   for (i = 0; i < 5; i++)
+     p += g_unichar_to_utf8 (invisible_char, p);
+   *p = 0;
+
+   return invisible_text;
+}
+
+static const gchar *
 get_password_mode_text (UmUser *user)
 {
         const gchar *text;
@@ -474,8 +500,7 @@ get_password_mode_text (UmUser *user)
         else {
                 switch (um_user_get_password_mode (user)) {
                 case UM_PASSWORD_MODE_REGULAR:
-                        /* five bullets */
-                        text = "\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2";
+                        text = get_invisible_text ();
                         break;
                 case UM_PASSWORD_MODE_SET_AT_LOGIN:
                         text = C_("Password mode", "To be set at next login");



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