[gnome-control-center] online-accounts: Hide remove button when account is locked
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] online-accounts: Hide remove button when account is locked
- Date: Mon, 13 Feb 2017 14:15:35 +0000 (UTC)
commit a6858fff62b114f9b17de3f3e3102ecf3be73da5
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 1894735..f1580e9 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -51,6 +51,7 @@ struct _CcGoaPanel
GtkWidget *notification_label;
GtkWidget *notification_revealer;
GtkWidget *providers_listbox;
+ GtkWidget *remove_account_button;
GtkWidget *stack;
GtkWidget *accounts_vbox;
@@ -425,6 +426,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);
@@ -450,6 +452,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;
@@ -469,6 +472,10 @@ show_page_account (CcGoaPanel *panel,
g_list_free (children);
account = goa_object_peek_account (object);
+
+ is_locked = goa_account_get_is_locked (account);
+ gtk_widget_set_visible (panel->remove_account_button, !is_locked);
+
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]