[gnome-control-center/gnome-3-8] user-accounts: username generation fix



commit fc82561cb9ec8de3f986b90dd026683fae3cefb8
Author: Ondrej Holy <oholy redhat com>
Date:   Tue Jul 23 16:34:44 2013 +0200

    user-accounts: username generation fix
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703748

 panels/user-accounts/um-account-dialog.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/panels/user-accounts/um-account-dialog.c b/panels/user-accounts/um-account-dialog.c
index 57ff77b..44dd178 100644
--- a/panels/user-accounts/um-account-dialog.c
+++ b/panels/user-accounts/um-account-dialog.c
@@ -274,13 +274,19 @@ on_name_changed (GtkEditable *editable,
         UmAccountDialog *self = UM_ACCOUNT_DIALOG (user_data);
         GtkTreeModel *model;
         const char *name;
+        GtkWidget *entry;
 
         model = gtk_combo_box_get_model (GTK_COMBO_BOX (self->local_username));
         gtk_list_store_clear (GTK_LIST_STORE (model));
 
         name = gtk_entry_get_text (GTK_ENTRY (editable));
-        generate_username_choices (name, GTK_LIST_STORE (model));
-        gtk_combo_box_set_active (GTK_COMBO_BOX (self->local_username), 0);
+        if (strlen (name) == 0) {
+                entry = gtk_bin_get_child (GTK_BIN (self->local_username));
+                gtk_entry_set_text (GTK_ENTRY (entry), "");
+        } else {
+                generate_username_choices (name, GTK_LIST_STORE (model));
+                gtk_combo_box_set_active (GTK_COMBO_BOX (self->local_username), 0);
+        }
 
         dialog_validate (self);
 }


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