Commit 4fa6852c authored by Felipe Borges's avatar Felipe Borges
Browse files

online-accounts: Present all supported providers at once

Instead of having the "more" button which reveals more items to the
providers list.

We still list branded providers above non-branded providers in the

Fixes #1072
parent 983a44bf
Pipeline #273065 failed with stages
in 4 minutes and 4 seconds
......@@ -43,7 +43,6 @@ struct _CcGoaPanel
GtkDialog *edit_account_dialog;
GtkHeaderBar *edit_account_headerbar;
GtkBox *editor_box;
GtkListBoxRow *more_providers_row;
GtkBox *new_account_vbox;
GtkLabel *notification_label;
GtkRevealer *notification_revealer;
......@@ -127,7 +126,6 @@ add_provider_row (CcGoaPanel *self,
GoaProvider *provider)
GIcon *icon;
GoaProviderFeatures features;
GtkWidget *image;
GtkWidget *label;
GtkWidget *row;
......@@ -170,12 +168,7 @@ add_provider_row (CcGoaPanel *self,
gtk_label_set_markup (GTK_LABEL (label), markup);
gtk_container_add (GTK_CONTAINER (row_grid), label);
/* Check if the row should be shown initially */
features = goa_provider_get_provider_features (provider);
if ((features & GOA_PROVIDER_FEATURE_BRANDED) != 0)
gtk_widget_show (row);
gtk_widget_show (row);
gtk_container_add (GTK_CONTAINER (self->providers_listbox), row);
g_free (markup);
......@@ -189,16 +182,8 @@ sort_providers_func (GtkListBoxRow *a,
gpointer user_data)
GoaProvider *a_provider, *b_provider;
CcGoaPanel *self;
gboolean a_branded, b_branded;
self = user_data;
if (a == self->more_providers_row)
return 1;
else if (b == self->more_providers_row)
return -1;
a_provider = g_object_get_data (G_OBJECT (a), "goa-provider");
b_provider = g_object_get_data (G_OBJECT (b), "goa-provider");
......@@ -216,29 +201,6 @@ sort_providers_func (GtkListBoxRow *a,
return gtk_list_box_row_get_index (b) - gtk_list_box_row_get_index (a);
static void
show_non_branded_providers (CcGoaPanel *self)
GList *children, *l;
children = gtk_container_get_children (GTK_CONTAINER (self->providers_listbox));
for (l = children; l != NULL; l = l->next)
GoaProvider *provider = g_object_get_data (l->data, "goa-provider");
if (!provider)
if ((goa_provider_get_provider_features (provider) & GOA_PROVIDER_FEATURE_BRANDED) == 0)
gtk_widget_show (l->data);
gtk_widget_hide (GTK_WIDGET (self->more_providers_row));
g_list_free (children);
static void
add_account (CcGoaPanel *self,
GoaProvider *provider)
......@@ -277,13 +239,6 @@ on_provider_row_activated (CcGoaPanel *self,
GoaProvider *provider;
/* Show More row */
if (activated_row == self->more_providers_row)
show_non_branded_providers (self);
provider = g_object_get_data (G_OBJECT (activated_row), "goa-provider");
add_account (self, provider);
......@@ -542,7 +497,6 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, edit_account_dialog);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, edit_account_headerbar);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, editor_box);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, more_providers_row);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, new_account_vbox);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, notification_label);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, notification_revealer);
......@@ -153,21 +153,6 @@
<relation target="providers_label" type="labelled-by"/>
<object class="GtkListBoxRow" id="more_providers_row">
<property name="visible">True</property>
<property name="can_focus">True</property>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="margin">22</property>
<property name="icon-name">view-more-symbolic</property>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment