[gnome-control-center] online-accounts: Update the UI if IsLocked changes



commit 182cac1ea35e95ed23de0605cca1c1abdc8d2fcb
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Dec 15 19:08:47 2016 +0100

    online-accounts: Update the UI if IsLocked changes
    
    We want to check the IsLocked property whenever we call
    show_page_account. ie. when we show an account for the first time, and
    also when the displayed account emits account-changed. Hence it is
    better to have them together.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774222

 panels/online-accounts/cc-online-accounts-panel.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c 
b/panels/online-accounts/cc-online-accounts-panel.c
index 43fb559..de6dceb 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -349,6 +349,7 @@ show_page_account (CcGoaPanel  *panel,
   GList *l;
   GoaProvider *provider;
   GoaAccount *account;
+  gboolean is_locked;
   const gchar *provider_name;
   const gchar *provider_type;
   gchar *title;
@@ -359,6 +360,9 @@ show_page_account (CcGoaPanel  *panel,
   gtk_widget_set_sensitive (panel->accounts_tree_box, TRUE);
   gtk_widget_hide (panel->accounts_tree_label);
 
+  is_locked = goa_account_get_is_locked (goa_object_peek_account (object));
+  gtk_widget_set_sensitive (panel->toolbar_remove_button, !is_locked);
+
   /* Out with the old */
   children = gtk_container_get_children (GTK_CONTAINER (panel->accounts_vbox));
   for (l = children; l != NULL; l = l->next)
@@ -431,14 +435,9 @@ on_listbox_selection_changed (CcGoaPanel    *self,
   if (selected_row != NULL)
     {
       GoaObject *object;
-      gboolean is_locked;
 
       object = g_object_get_data (G_OBJECT (selected_row), "goa-object");
-      is_locked = goa_account_get_is_locked (goa_object_peek_account (object));
-
       show_page_account (self, object);
-
-      gtk_widget_set_sensitive (self->toolbar_remove_button, !is_locked);
     }
   else
     {


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