[gnome-boxes/gnome-3-4] Use gtk+ password character in Summary



commit 808b4dcbed8c7c527236f0f2ee5575b7ab0f50dc
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Thu May 31 12:00:32 2012 +0200

    Use gtk+ password character in Summary
    
    Currently, we're using '*' to hide the password on the Summary page.
    This does not match the character used by gtk+ for passwords. Use
    the GtkEntry::invisible_char property as the password character for
    more consistency.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677177

 src/unattended-installer.vala |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index aba7051..6f17c58 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -21,8 +21,14 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
 
     public string hidden_password {
         owned get {
-            return password_entry.text.length > 0 ?
-                   string.nfill (password_entry.text_length, '*') : _("no password");
+            if (password_entry.text.length > 0) {
+                var str = "";
+                for (var i = 0; i < password_entry.text_length; i++)
+                    str += password_entry.get_invisible_char ().to_string ();
+
+                return str;
+            } else
+                return _("no password");
         }
     }
 



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