[gnome-control-center] user-accounts: Use GtkEntry instead of CcEditableEntry
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: Use GtkEntry instead of CcEditableEntry
- Date: Mon, 1 Aug 2016 07:31:35 +0000 (UTC)
commit 1039642d9370f7194651f528322536807131fa49
Author: Felipe Borges <felipeborges gnome org>
Date: Wed Jul 20 11:26:56 2016 +0200
user-accounts: Use GtkEntry instead of CcEditableEntry
https://bugzilla.gnome.org/show_bug.cgi?id=767065
panels/user-accounts/data/user-accounts-dialog.ui | 6 ++----
panels/user-accounts/um-user-panel.c | 21 +++++++++++++++------
2 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/panels/user-accounts/data/user-accounts-dialog.ui
b/panels/user-accounts/data/user-accounts-dialog.ui
index e4c4dcd..bbc0189 100644
--- a/panels/user-accounts/data/user-accounts-dialog.ui
+++ b/panels/user-accounts/data/user-accounts-dialog.ui
@@ -190,13 +190,11 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
- <object class="CcEditableEntry" id="full-name-entry">
+ <object class="GtkEntry" id="full-name-entry">
<property name="visible">True</property>
- <property name="scale">1.2</property>
- <property name="weight">700</property>
<property name="width-chars">30</property>
<property name="max-width-chars">30</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
+ <property name="valign">GTK_ALIGN_CENTER</property>
</object>
<packing>
<property name="fill">True</property>
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 8509fda..f9c322c 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -889,7 +889,7 @@ show_user (ActUser *user, CcUserPanelPrivate *d)
um_photo_dialog_set_user (d->photo_dialog, user);
widget = get_widget (d, "full-name-entry");
- cc_editable_entry_set_text (CC_EDITABLE_ENTRY (widget), act_user_get_real_name (user));
+ gtk_entry_set_text (GTK_ENTRY (widget), act_user_get_real_name (user));
gtk_widget_set_tooltip_text (widget, act_user_get_user_name (user));
widget = get_widget (d, act_user_get_account_type (user) ? "account-type-admin" :
"account-type-standard");
@@ -1008,7 +1008,7 @@ change_name_done (GtkWidget *entry,
user = get_selected_user (d);
- text = cc_editable_entry_get_text (CC_EDITABLE_ENTRY (entry));
+ text = gtk_entry_get_text (GTK_ENTRY (entry));
if (g_strcmp0 (text, act_user_get_real_name (user)) != 0 &&
is_valid_name (text)) {
act_user_set_real_name (user, text);
@@ -1018,6 +1018,14 @@ change_name_done (GtkWidget *entry,
}
static void
+change_name_focus_out (GtkWidget *entry,
+ GdkEvent *event,
+ CcUserPanelPrivate *d)
+{
+ change_name_done (entry, d);
+}
+
+static void
account_type_changed (GtkToggleButton *button,
CcUserPanelPrivate *d)
{
@@ -1438,15 +1446,15 @@ on_permission_changed (GPermission *permission,
/* The full name entry: insensitive if remote or not authorized and not self */
widget = get_widget (d, "full-name-entry");
if (!act_user_is_local_account (user)) {
- cc_editable_entry_set_editable (CC_EDITABLE_ENTRY (widget), FALSE);
+ gtk_widget_set_sensitive (widget, FALSE);
remove_unlock_tooltip (widget);
} else if (is_authorized || self_selected) {
- cc_editable_entry_set_editable (CC_EDITABLE_ENTRY (widget), TRUE);
+ gtk_widget_set_sensitive (widget, TRUE);
remove_unlock_tooltip (widget);
} else {
- cc_editable_entry_set_editable (CC_EDITABLE_ENTRY (widget), FALSE);
+ gtk_widget_set_sensitive (widget, FALSE);
add_unlock_tooltip (widget);
}
@@ -1652,7 +1660,8 @@ setup_main_window (CcUserPanel *self)
add_unlock_tooltip (button);
button = get_widget (d, "full-name-entry");
- g_signal_connect (button, "editing-done", G_CALLBACK (change_name_done), d);
+ g_signal_connect (button, "activate", G_CALLBACK (change_name_done), d);
+ g_signal_connect (button, "focus-out-event", G_CALLBACK (change_name_focus_out), d);
button = get_widget (d, "account-type-standard");
g_signal_connect (button, "toggled", G_CALLBACK (account_type_changed), d);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]