[gnome-control-center/wip/gbsneto/new-goa-panel: 70/76] online-accounts: hide remove button when account is locked



commit 3c1905349494adc4306831ea1e64167a0b332370
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Nov 10 13:34:56 2016 -0200

    online-accounts: hide remove button when account is locked
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774222

 panels/online-accounts/cc-online-accounts-panel.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c 
b/panels/online-accounts/cc-online-accounts-panel.c
index 3577da3..9cc5408 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -53,6 +53,7 @@ struct _CcGoaPanel
   GtkWidget *notification_label;
   GtkWidget *notification_revealer;
   GtkWidget *providers_listbox;
+  GtkWidget *remove_account_button;
   GtkWidget *stack;
   GtkWidget *accounts_vbox;
 
@@ -441,6 +442,7 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, notification_label);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, notification_revealer);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, providers_listbox);
+  gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, remove_account_button);
   gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, stack);
 
   gtk_widget_class_bind_template_callback (widget_class, on_edit_account_dialog_delete_event);
@@ -467,6 +469,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;
@@ -488,6 +491,10 @@ show_page_account (CcGoaPanel  *panel,
     gtk_container_remove (GTK_CONTAINER (panel->accounts_vbox), GTK_WIDGET (l->data));
   g_list_free (children);
 
+  /* Hide the Remove button for locked accounts */
+  is_locked = goa_account_get_is_locked (goa_object_peek_account (object));
+  gtk_widget_set_visible (panel->remove_account_button, !is_locked);
+
   account = goa_object_peek_account (object);
   provider_type = goa_account_get_provider_type (account);
   provider = goa_provider_get_for_provider_type (provider_type);


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