user-accounts: Avoid a warning on startup
As a user was not set on the password dialog yet. Also make sure that we do not try to update the password strength label before anyone has entered anything in the dialogue itself.
This commit is contained in:
parent
fa022622d2
commit
75fdd13a74
3 changed files with 9 additions and 1 deletions
|
@ -249,7 +249,7 @@
|
|||
<object class="GtkLabel" id="strength-indicator-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Fair</property>
|
||||
<property name="label"></property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
|
|
|
@ -289,6 +289,13 @@ update_sensitivity (UmPasswordDialog *um)
|
|||
password = gtk_entry_get_text (GTK_ENTRY (um->password_entry));
|
||||
verify = gtk_entry_get_text (GTK_ENTRY (um->verify_entry));
|
||||
old_password = gtk_entry_get_text (GTK_ENTRY (um->old_password_entry));
|
||||
|
||||
/* Don't update the password strength if we didn't enter anything */
|
||||
if (password && *password == '\0' &&
|
||||
verify && *verify == '\0' &&
|
||||
old_password && *old_password == '\0')
|
||||
return;
|
||||
|
||||
strength_level = update_password_strength (um);
|
||||
|
||||
if (strength_level < 1) {
|
||||
|
|
|
@ -1117,6 +1117,7 @@ on_permission_changed (GPermission *permission,
|
|||
gtk_notebook_set_current_page (GTK_NOTEBOOK (get_widget (d, "account-fingerprint-notebook")), 0);
|
||||
}
|
||||
|
||||
um_password_dialog_set_user (d->password_dialog, user);
|
||||
um_password_dialog_set_privileged (d->password_dialog, is_authorized);
|
||||
|
||||
g_object_unref (user);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue