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
This commit is contained in:
parent
1a427a8ac3
commit
182cac1ea3
1 changed files with 4 additions and 5 deletions
|
@ -349,6 +349,7 @@ show_page_account (CcGoaPanel *panel,
|
||||||
GList *l;
|
GList *l;
|
||||||
GoaProvider *provider;
|
GoaProvider *provider;
|
||||||
GoaAccount *account;
|
GoaAccount *account;
|
||||||
|
gboolean is_locked;
|
||||||
const gchar *provider_name;
|
const gchar *provider_name;
|
||||||
const gchar *provider_type;
|
const gchar *provider_type;
|
||||||
gchar *title;
|
gchar *title;
|
||||||
|
@ -359,6 +360,9 @@ show_page_account (CcGoaPanel *panel,
|
||||||
gtk_widget_set_sensitive (panel->accounts_tree_box, TRUE);
|
gtk_widget_set_sensitive (panel->accounts_tree_box, TRUE);
|
||||||
gtk_widget_hide (panel->accounts_tree_label);
|
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 */
|
/* Out with the old */
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (panel->accounts_vbox));
|
children = gtk_container_get_children (GTK_CONTAINER (panel->accounts_vbox));
|
||||||
for (l = children; l != NULL; l = l->next)
|
for (l = children; l != NULL; l = l->next)
|
||||||
|
@ -431,14 +435,9 @@ on_listbox_selection_changed (CcGoaPanel *self,
|
||||||
if (selected_row != NULL)
|
if (selected_row != NULL)
|
||||||
{
|
{
|
||||||
GoaObject *object;
|
GoaObject *object;
|
||||||
gboolean is_locked;
|
|
||||||
|
|
||||||
object = g_object_get_data (G_OBJECT (selected_row), "goa-object");
|
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);
|
show_page_account (self, object);
|
||||||
|
|
||||||
gtk_widget_set_sensitive (self->toolbar_remove_button, !is_locked);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue