[gnome-control-center/wip/oholy/disable-verify-password-entry: 62/64] Revert "user-accounts: Don't disable the verify password entry"



commit 4805b9cfb79fed11dba695c7991c022fa1991b83
Author: Ondrej Holy <oholy redhat com>
Date:   Wed Apr 11 10:05:30 2018 +0200

    Revert "user-accounts: Don't disable the verify password entry"
    
    This reverts commit 7b3746af23f6933c0a930822b55dea6d96df3cbd.
    
    This is needed to make obvious that password is not yet strong
    enough.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/38

 panels/user-accounts/um-account-dialog.c  | 6 ++++++
 panels/user-accounts/um-password-dialog.c | 6 ++++++
 2 files changed, 12 insertions(+)
---
diff --git a/panels/user-accounts/um-account-dialog.c b/panels/user-accounts/um-account-dialog.c
index 91ac55a7a..896c3db35 100644
--- a/panels/user-accounts/um-account-dialog.c
+++ b/panels/user-accounts/um-account-dialog.c
@@ -271,6 +271,7 @@ update_password_strength (UmAccountDialog *self)
         const gchar *password;
         const gchar *username;
         const gchar *hint;
+        const gchar *verify;
         gint strength_level;
 
         password = gtk_entry_get_text (GTK_ENTRY (self->local_password));
@@ -289,6 +290,11 @@ update_password_strength (UmAccountDialog *self)
                 clear_entry_validation_error (GTK_ENTRY (self->local_password));
         }
 
+        verify = gtk_entry_get_text (GTK_ENTRY (self->local_verify));
+        if (strlen (verify) == 0) {
+                gtk_widget_set_sensitive (self->local_verify, strength_level > 1);
+        }
+
         return strength_level;
 }
 
diff --git a/panels/user-accounts/um-password-dialog.c b/panels/user-accounts/um-password-dialog.c
index 0a142eda2..b3c8e8b54 100644
--- a/panels/user-accounts/um-password-dialog.c
+++ b/panels/user-accounts/um-password-dialog.c
@@ -69,6 +69,7 @@ update_password_strength (UmPasswordDialog *um)
         const gchar *username;
         gint strength_level;
         const gchar *hint;
+        const gchar *verify;
 
         if (um->user == NULL) {
                 return 0;
@@ -92,6 +93,11 @@ update_password_strength (UmPasswordDialog *um)
                 clear_entry_validation_error (GTK_ENTRY (um->password_entry));
         }
 
+        verify = gtk_entry_get_text (GTK_ENTRY (um->verify_entry));
+        if (strlen (verify) == 0) {
+                gtk_widget_set_sensitive (um->verify_entry, strength_level > 1);
+        }
+
         return strength_level;
 }
 


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