[gnome-control-center] user-accounts: Move default widget visibility and sensitivity into .ui file



commit a4b76204ffbeaf6b61d258a93ed26538b8853056
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Nov 7 14:15:27 2018 +1300

    user-accounts: Move default widget visibility and sensitivity into .ui file

 panels/user-accounts/cc-add-user-dialog.c  | 9 ---------
 panels/user-accounts/cc-add-user-dialog.ui | 6 +++++-
 2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/panels/user-accounts/cc-add-user-dialog.c b/panels/user-accounts/cc-add-user-dialog.c
index 99107d180..8869694e7 100644
--- a/panels/user-accounts/cc-add-user-dialog.c
+++ b/panels/user-accounts/cc-add-user-dialog.c
@@ -579,22 +579,16 @@ local_init (CcAddUserDialog *self)
 
         self->local_password_mode = ACT_USER_PASSWORD_MODE_SET_AT_LOGIN;
 
-        gtk_widget_set_sensitive (GTK_WIDGET (self->local_password), FALSE);
         g_signal_connect (self->local_password, "notify::text", G_CALLBACK (on_password_changed), self);
         g_signal_connect_after (self->local_password, "focus-out-event", G_CALLBACK (on_password_focus_out), 
self);
         g_signal_connect (self->local_password, "key-press-event", G_CALLBACK (on_password_key_press_cb), 
self);
         g_signal_connect_swapped (self->local_password, "activate", G_CALLBACK (dialog_validate), self);
         g_signal_connect (self->local_password, "icon-press", G_CALLBACK (on_generate), self);
 
-        gtk_widget_set_sensitive (GTK_WIDGET (self->local_verify), FALSE);
         g_signal_connect (self->local_verify, "notify::text", G_CALLBACK (on_password_changed), self);
         g_signal_connect_after (self->local_verify, "focus-out-event", G_CALLBACK (on_password_focus_out), 
self);
         g_signal_connect_swapped (self->local_verify, "activate", G_CALLBACK (dialog_validate), self);
 
-        gtk_widget_set_sensitive (GTK_WIDGET (self->local_strength_indicator), FALSE);
-
-        gtk_widget_set_sensitive (GTK_WIDGET (self->local_hint), FALSE);
-
         dialog_validate (self);
         update_password_strength (self);
 }
@@ -1346,9 +1340,6 @@ enterprise_init (CcAddUserDialog *self)
 
         g_signal_connect (self->enterprise_password, "changed", G_CALLBACK (on_entry_changed), self);
 
-        /* Initially we hide the 'Enterprise Login' stuff */
-        gtk_widget_hide (GTK_WIDGET (self->enterprise_button));
-
         self->realmd_watch = g_bus_watch_name (G_BUS_TYPE_SYSTEM, "org.freedesktop.realmd",
                                                G_BUS_NAME_WATCHER_FLAGS_AUTO_START,
                                                on_realmd_appeared, on_realmd_disappeared,
diff --git a/panels/user-accounts/cc-add-user-dialog.ui b/panels/user-accounts/cc-add-user-dialog.ui
index 0ae4d07dc..f00d3fa16 100644
--- a/panels/user-accounts/cc-add-user-dialog.ui
+++ b/panels/user-accounts/cc-add-user-dialog.ui
@@ -315,6 +315,7 @@
                 <child>
                   <object class="GtkEntry" id="local_password">
                     <property name="visible">True</property>
+                    <property name="sensitive">False</property>
                     <property name="can_focus">True</property>
                     <property name="has_tooltip">True</property>
                     <property name="visibility">False</property>
@@ -334,6 +335,7 @@
                 <child>
                   <object class="GtkLevelBar" id="local_strength_indicator">
                     <property name="visible">True</property>
+                    <property name="sensitive">False</property>
                     <property name="mode">discrete</property>
                     <property name="max-value">5</property>
                     <property name="hexpand">True</property>
@@ -355,6 +357,7 @@
                 <child>
                   <object class="GtkLabel" id="local_hint">
                     <property name="visible">True</property>
+                    <property name="sensitive">False</property>
                     <property name="can_focus">False</property>
                     <property name="yalign">0</property>
                     <property name="xalign">0</property>
@@ -402,6 +405,7 @@
                 <child>
                   <object class="GtkEntry" id="local_verify">
                     <property name="visible">True</property>
+                    <property name="sensitive">False</property>
                     <property name="can_focus">True</property>
                     <property name="visibility">False</property>
                     <property name="invisible_char">●</property>
@@ -759,7 +763,7 @@
             <child>
               <object class="GtkToggleButton" id="enterprise_button">
                 <property name="label" translatable="yes">_Enterprise Login</property>
-                <property name="visible">True</property>
+                <property name="visible">False</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_underline">True</property>


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