[gnome-control-center/wip/gbsneto/new-goa-panel: 2/23] online-accounts: use a listbox instead of a treeview
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/gbsneto/new-goa-panel: 2/23] online-accounts: use a listbox instead of a treeview
- Date: Thu, 10 Nov 2016 19:32:04 +0000 (UTC)
commit dfa04c696adbcecc24a7e3a830c63294e97e796f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Nov 9 14:43:41 2016 -0200
online-accounts: use a listbox instead of a treeview
As part of the port to the redesigned Online Accounts panel,
the main widget to be displayed is a GtkListBox, so we can have
finer control of the UI elements and eventually be able to put
real widgets instead of using cell renderers.
This commit, then, makes the Online Account panel use a listbox
widget in the sidebar. The behavior of the panel was not changed.
Since its using a listbox now, we can drop the custom GoaPanelAccountsModel
class.
https://bugzilla.gnome.org/show_bug.cgi?id=774222
panels/online-accounts/Makefile.am | 2 -
panels/online-accounts/cc-online-accounts-model.c | 435 --------------------
panels/online-accounts/cc-online-accounts-model.h | 56 ---
panels/online-accounts/cc-online-accounts-panel.c | 445 +++++++++++----------
panels/online-accounts/online-accounts.ui | 14 +-
5 files changed, 240 insertions(+), 712 deletions(-)
---
diff --git a/panels/online-accounts/Makefile.am b/panels/online-accounts/Makefile.am
index e357172..4ae1ab8 100644
--- a/panels/online-accounts/Makefile.am
+++ b/panels/online-accounts/Makefile.am
@@ -19,8 +19,6 @@ libonline_accounts_la_SOURCES = \
$(BUILT_SOURCES) \
cc-online-accounts-add-account-dialog.c \
cc-online-accounts-add-account-dialog.h \
- cc-online-accounts-model.c \
- cc-online-accounts-model.h \
cc-online-accounts-panel.c \
cc-online-accounts-panel.h
diff --git a/panels/online-accounts/cc-online-accounts-panel.c
b/panels/online-accounts/cc-online-accounts-panel.c
index 502ef94..72e420c 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -32,7 +32,6 @@
#include "cc-online-accounts-panel.h"
#include "cc-online-accounts-add-account-dialog.h"
-#include "cc-online-accounts-model.h"
#include "cc-online-accounts-resources.h"
struct _CcGoaPanel
@@ -41,8 +40,7 @@ struct _CcGoaPanel
GoaClient *client;
- GoaPanelAccountsModel *accounts_model;
-
+ GtkWidget *accounts_listbox;
GtkWidget *accounts_notebook;
GtkWidget *accounts_tree_box;
GtkWidget *accounts_tree_label;
@@ -50,20 +48,12 @@ struct _CcGoaPanel
GtkWidget *toolbar;
GtkWidget *toolbar_add_button;
GtkWidget *toolbar_remove_button;
- GtkWidget *accounts_treeview;
GtkWidget *accounts_vbox;
};
-static void on_model_row_deleted (GtkTreeModel *tree_model,
- GtkTreePath *path,
- gpointer user_data);
-static void on_model_row_inserted (GtkTreeModel *tree_model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data);
-
-static void on_tree_view_selection_changed (GtkTreeSelection *selection,
- gpointer user_data);
+static void on_listbox_selection_changed (GtkListBox *listbox,
+ GtkListBoxRow *selected_row,
+ CcGoaPanel *self);
static void on_toolbar_add_button_clicked (GtkToolButton *button,
gpointer user_data);
@@ -73,12 +63,22 @@ static void on_toolbar_remove_button_clicked (GtkToolButton *button,
static void on_add_button_clicked (GtkButton *button,
gpointer user_data);
+static void fill_accounts_listbox (CcGoaPanel *self);
+
+static void on_account_added (GoaClient *client,
+ GoaObject *object,
+ gpointer user_data);
+
static void on_account_changed (GoaClient *client,
GoaObject *object,
gpointer user_data);
-static gboolean select_account_by_id (CcGoaPanel *panel,
- const gchar *account_id);
+static void on_account_removed (GoaClient *client,
+ GoaObject *object,
+ gpointer user_data);
+
+static void select_account_by_id (CcGoaPanel *panel,
+ const gchar *account_id);
static void add_account (CcGoaPanel *panel,
GoaProvider *provider,
GVariant *preseed);
@@ -90,6 +90,23 @@ enum {
PROP_PARAMETERS
};
+static gint
+sort_func (GtkListBoxRow *a,
+ GtkListBoxRow *b,
+ gpointer user_data)
+{
+ GoaObject *a_obj, *b_obj;
+ GoaAccount *a_account, *b_account;
+
+ a_obj = g_object_get_data (G_OBJECT (a), "goa-object");
+ a_account = goa_object_peek_account (a_obj);
+
+ b_obj = g_object_get_data (G_OBJECT (b), "goa-object");
+ b_account = goa_object_peek_account (b_obj);
+
+ return g_strcmp0 (goa_account_get_id (a_account), goa_account_get_id (b_account));
+}
+
static void
command_add (CcGoaPanel *panel,
GVariant *parameters)
@@ -185,7 +202,6 @@ cc_goa_panel_finalize (GObject *object)
{
CcGoaPanel *panel = CC_GOA_PANEL (object);
- g_clear_object (&panel->accounts_model);
g_clear_object (&panel->client);
G_OBJECT_CLASS (cc_goa_panel_parent_class)->finalize (object);
@@ -195,15 +211,17 @@ static void
cc_goa_panel_init (CcGoaPanel *panel)
{
GError *error;
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
- GtkTreeIter iter;
GNetworkMonitor *monitor;
g_resources_register (cc_online_accounts_get_resource ());
gtk_widget_init_template (GTK_WIDGET (panel));
+ gtk_list_box_set_sort_func (GTK_LIST_BOX (panel->accounts_listbox),
+ sort_func,
+ panel,
+ NULL);
+
monitor = g_network_monitor_get_default();
g_object_bind_property (monitor, "network-available",
@@ -218,11 +236,6 @@ cc_goa_panel_init (CcGoaPanel *panel)
G_CALLBACK (on_toolbar_remove_button_clicked),
panel);
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (panel->accounts_treeview)),
- "changed",
- G_CALLBACK (on_tree_view_selection_changed),
- panel);
-
g_object_bind_property (monitor, "network-available",
panel->add_account_button, "sensitive",
G_BINDING_SYNC_CREATE);
@@ -240,61 +253,25 @@ cc_goa_panel_init (CcGoaPanel *panel)
error->message, g_quark_to_string (error->domain), error->code);
gtk_widget_set_sensitive (GTK_WIDGET (panel), FALSE);
g_error_free (error);
- goto out;
+ return;
}
+
+ g_signal_connect (panel->client,
+ "account-added",
+ G_CALLBACK (on_account_added),
+ panel);
+
g_signal_connect (panel->client,
"account-changed",
G_CALLBACK (on_account_changed),
panel);
- panel->accounts_model = goa_panel_accounts_model_new (panel->client);
- gtk_tree_view_set_model (GTK_TREE_VIEW (panel->accounts_treeview), GTK_TREE_MODEL (panel->accounts_model));
- g_signal_connect (panel->accounts_model, "row-deleted", G_CALLBACK (on_model_row_deleted), panel);
- g_signal_connect (panel->accounts_model, "row-inserted", G_CALLBACK (on_model_row_inserted), panel);
-
- column = gtk_tree_view_column_new ();
- gtk_tree_view_append_column (GTK_TREE_VIEW (panel->accounts_treeview), column);
-
- renderer = gtk_cell_renderer_pixbuf_new ();
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- g_object_set (G_OBJECT (renderer),
- "follow-state", TRUE,
- "stock-size", GTK_ICON_SIZE_DIALOG,
- NULL);
- gtk_tree_view_column_set_attributes (column,
- renderer,
- "gicon", GOA_PANEL_ACCOUNTS_MODEL_COLUMN_ICON,
- NULL);
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, renderer, TRUE);
- g_object_set (G_OBJECT (renderer),
- "ellipsize", PANGO_ELLIPSIZE_END,
- "ellipsize-set", TRUE,
- NULL);
- gtk_tree_view_column_set_attributes (column,
- renderer,
- "markup", GOA_PANEL_ACCOUNTS_MODEL_COLUMN_MARKUP,
- NULL);
-
- renderer = gtk_cell_renderer_pixbuf_new ();
- gtk_tree_view_column_pack_end (column, renderer, FALSE);
- g_object_set (G_OBJECT (renderer),
- "icon-name", "dialog-warning-symbolic",
- NULL);
- gtk_tree_view_column_set_attributes (column,
- renderer,
- "visible", GOA_PANEL_ACCOUNTS_MODEL_COLUMN_ATTENTION_NEEDED,
- NULL);
-
- /* Select the first row, if any */
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (panel->accounts_model),
- &iter))
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (GTK_TREE_VIEW (panel->accounts_treeview)),
- &iter);
-
- out:
- gtk_widget_show_all (GTK_WIDGET (panel));
+ g_signal_connect (panel->client,
+ "account-removed",
+ G_CALLBACK (on_account_removed),
+ panel);
+
+ fill_accounts_listbox (panel);
}
static const char *
@@ -319,8 +296,8 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/control-center/online-accounts/online-accounts.ui");
+ gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_listbox);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_notebook);
- gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_treeview);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_tree_box);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_tree_label);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, accounts_vbox);
@@ -328,6 +305,8 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, toolbar);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, toolbar_add_button);
gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, toolbar_remove_button);
+
+ gtk_widget_class_bind_template_callback (widget_class, on_listbox_selection_changed);
}
/* ---------------------------------------------------------------------------------------------------- */
@@ -391,142 +370,207 @@ show_page_account (CcGoaPanel *panel,
/* ---------------------------------------------------------------------------------------------------- */
-static gboolean
-select_account_by_id (CcGoaPanel *panel,
+static void
+select_account_by_id (CcGoaPanel *panel,
const gchar *account_id)
{
- GoaObject *goa_object = NULL;
- GtkTreeIter iter;
- gboolean iter_set = FALSE;
+ GtkListBoxRow *account_row;
+ GList *children, *l;
- goa_object = goa_client_lookup_by_id (panel->client, account_id);
- if (goa_object != NULL)
- {
- iter_set = goa_panel_accounts_model_get_iter_for_object (panel->accounts_model,
- goa_object,
- &iter);
- g_object_unref (goa_object);
- }
+ account_row = NULL;
+ children = gtk_container_get_children (GTK_CONTAINER (panel->accounts_listbox));
- if (iter_set)
+ for (l = children; l != NULL; l = l->next)
{
- GtkTreePath *path;
- GtkTreeView *tree_view;
- GtkTreeSelection *selection;
-
- tree_view = GTK_TREE_VIEW (panel->accounts_treeview);
- selection = gtk_tree_view_get_selection (tree_view);
- gtk_tree_selection_select_iter (selection, &iter);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (panel->accounts_model), &iter);
- gtk_tree_view_scroll_to_cell (tree_view, path, NULL, FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
+ GoaAccount *account;
+ GoaObject *row_object;
+
+ row_object = g_object_get_data (l->data, "goa-object");
+ account = goa_object_peek_account (row_object);
+
+ if (g_strcmp0 (goa_account_get_id (account), account_id) == 0)
+ {
+ account_row = l->data;
+ break;
+ }
}
- return iter_set;
+ gtk_list_box_select_row (GTK_LIST_BOX (panel->accounts_listbox), account_row);
+
+ g_list_free (children);
}
static void
-on_tree_view_selection_changed (GtkTreeSelection *selection,
- gpointer user_data)
+on_listbox_selection_changed (GtkListBox *listbox,
+ GtkListBoxRow *selected_row,
+ CcGoaPanel *self)
{
- CcGoaPanel *panel = CC_GOA_PANEL (user_data);
- GtkTreeIter iter;
-
- if (gtk_tree_selection_get_selected (selection, NULL, &iter))
+ if (selected_row)
{
GoaObject *object;
gboolean is_locked;
- gtk_tree_model_get (GTK_TREE_MODEL (panel->accounts_model),
- &iter,
- GOA_PANEL_ACCOUNTS_MODEL_COLUMN_OBJECT, &object,
- -1);
- show_page_account (panel, object);
-
+ object = g_object_get_data (G_OBJECT (selected_row), "goa-object");
is_locked = goa_account_get_is_locked (goa_object_peek_account (object));
- gtk_widget_set_sensitive (panel->toolbar_remove_button, !is_locked);
- g_object_unref (object);
+ show_page_account (self, object);
+
+ gtk_widget_set_sensitive (self->toolbar_remove_button, !is_locked);
}
else
{
- show_page_nothing_selected (panel);
+ show_page_nothing_selected (self);
}
}
static void
-on_account_changed (GoaClient *client,
- GoaObject *object,
- gpointer user_data)
+fill_accounts_listbox (CcGoaPanel *self)
{
- CcGoaPanel *panel = CC_GOA_PANEL (user_data);
- GtkTreeIter iter;
+ GtkListBox *listbox;
+ GList *accounts, *l;
- if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW
(panel->accounts_treeview)),
- NULL,
- &iter))
- {
- GoaObject *selected_object;
- gtk_tree_model_get (GTK_TREE_MODEL (panel->accounts_model),
- &iter,
- GOA_PANEL_ACCOUNTS_MODEL_COLUMN_OBJECT, &selected_object,
- -1);
- if (selected_object == object)
- show_page_account (panel, selected_object);
- g_object_unref (selected_object);
- }
-}
+ listbox = GTK_LIST_BOX (self->accounts_listbox);
+ accounts = goa_client_get_accounts (self->client);
-/* ---------------------------------------------------------------------------------------------------- */
+ for (l = accounts; l != NULL; l = l->next)
+ on_account_added (self->client, l->data, self);
-static void
-on_model_row_changed (GtkTreeModel *tree_model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data)
-{
- GtkTreeSelection *selection = GTK_TREE_SELECTION (user_data);
+ /* Select the first row */
+ gtk_list_box_select_row (listbox, gtk_list_box_get_row_at_index (listbox, 0));
- gtk_tree_selection_select_iter (selection, iter);
- g_signal_handlers_disconnect_by_func (tree_model, G_CALLBACK (on_model_row_changed), user_data);
+ g_list_free_full (accounts, g_object_unref);
}
static void
-on_model_row_deleted (GtkTreeModel *tree_model,
- GtkTreePath *path,
- gpointer user_data)
+on_account_added (GoaClient *client,
+ GoaObject *object,
+ gpointer user_data)
{
- CcGoaPanel *panel = CC_GOA_PANEL (user_data);
- GtkTreeIter iter;
- GtkTreeSelection *selection;
+ CcGoaPanel *self = user_data;
+ GtkWidget *row, *icon, *label, *box;
+ GoaAccount *account;
+ GError *error;
+ GIcon *gicon;
+ gchar* title = NULL;
+
+ account = goa_object_peek_account (object);
+
+ /* The main grid */
+ box = g_object_new (GTK_TYPE_BOX,
+ "spacing", 6,
+ "margin", 6,
+ NULL);
+ gtk_widget_show (box);
- if (!gtk_tree_model_get_iter (tree_model, &iter, path))
+ /* The provider icon */
+ error = NULL;
+ gicon = g_icon_new_for_string (goa_account_get_provider_icon (account), &error);
+
+ if (error)
{
- if (!gtk_tree_path_prev (path))
- return;
+ g_warning ("Error creating GIcon for account: %s (%s, %d)",
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
+
+ g_clear_error (&error);
}
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (panel->accounts_treeview));
- gtk_tree_selection_select_path (selection, path);
+ icon = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_DND);
+ gtk_widget_show (icon);
+
+ gtk_container_add (GTK_CONTAINER (box), icon);
+
+ /* The name of the provider */
+ title = g_strdup_printf ("<b>%s</b>\n<small>%s</small>",
+ goa_account_get_provider_name (account),
+ goa_account_get_presentation_identity (account));
+
+ label = g_object_new (GTK_TYPE_LABEL,
+ "label", title,
+ "xalign", 0.0,
+ "use-markup", TRUE,
+ "hexpand", TRUE,
+ NULL);
+ gtk_widget_show (label);
+
+ gtk_container_add (GTK_CONTAINER (box), label);
+
+ /* "Needs attention" icon */
+ icon = gtk_image_new_from_icon_name ("dialog-warning-symbolic", GTK_ICON_SIZE_BUTTON);
+ gtk_style_context_add_class (gtk_widget_get_style_context (icon), "dim-label");
+
+ g_object_bind_property (goa_object_peek_account (object),
+ "attention-needed",
+ icon,
+ "visible",
+ G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
+
+ gtk_container_add (GTK_CONTAINER (box), icon);
+
+ /* The row */
+ row = gtk_list_box_row_new ();
+ gtk_widget_show (row);
+
+ g_object_set_data (G_OBJECT (row), "goa-object", object);
+
+ gtk_container_add (GTK_CONTAINER (row), box);
+
+ /* Add to the listbox */
+ gtk_container_add (GTK_CONTAINER (self->accounts_listbox), row);
+
+ g_clear_pointer (&title, g_free);
+ g_clear_object (&gicon);
}
static void
-on_model_row_inserted (GtkTreeModel *tree_model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data)
+on_account_changed (GoaClient *client,
+ GoaObject *object,
+ gpointer user_data)
{
CcGoaPanel *panel = CC_GOA_PANEL (user_data);
- GtkTreeSelection *selection;
+ GtkListBoxRow *selected_row;
+ GoaObject *selected_object;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (panel->accounts_treeview));
- if (gtk_tree_selection_get_selected (selection, NULL, NULL))
+ selected_row = gtk_list_box_get_selected_row (GTK_LIST_BOX (panel->accounts_listbox));
+
+ if (!selected_row)
return;
- /* An empty row has been inserted and is going to be filled in, so
- * we expect selection to stay valid.
- */
- g_signal_connect (tree_model, "row-changed", G_CALLBACK (on_model_row_changed), selection);
+ selected_object = g_object_get_data (G_OBJECT (selected_row), "goa-object");
+
+ if (selected_object == object)
+ show_page_account (panel, selected_object);
+}
+
+static void
+on_account_removed (GoaClient *client,
+ GoaObject *object,
+ gpointer user_data)
+{
+ CcGoaPanel *self = user_data;
+ GList *children, *l, *prev;
+
+ children = gtk_container_get_children (GTK_CONTAINER (self->accounts_listbox));
+ prev = NULL;
+
+ for (l = children; l != NULL; l = l->next)
+ {
+ GoaObject *row_object;
+
+ row_object = GOA_OBJECT (g_object_get_data (l->data, "goa-object"));
+
+ if (row_object == object)
+ {
+ gtk_list_box_select_row (GTK_LIST_BOX (self->accounts_listbox), prev ? prev->data : NULL);
+ gtk_widget_destroy (l->data);
+ break;
+ }
+
+ prev = l;
+ }
+
+ g_list_free (children);
}
/* ---------------------------------------------------------------------------------------------------- */
@@ -584,16 +628,8 @@ get_all_providers_cb (GObject *source,
if (object != NULL)
{
- GtkTreeIter iter;
- /* navigate to newly created object */
- if (goa_panel_accounts_model_get_iter_for_object (data->panel->accounts_model,
- object,
- &iter))
- {
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (GTK_TREE_VIEW
(data->panel->accounts_treeview)),
- &iter);
- }
- g_object_unref (object);
+ GoaAccount *account = goa_object_peek_account (object);
+ select_account_by_id (data->panel, goa_account_get_id (account));
}
if (error != NULL)
@@ -681,41 +717,32 @@ on_toolbar_remove_button_clicked (GtkToolButton *button,
gpointer user_data)
{
CcGoaPanel *panel = CC_GOA_PANEL (user_data);
- GtkTreeIter iter;
+ GtkListBoxRow *selected_row;
+ GoaObject *object;
+ GtkWidget *dialog;
+ gint response;
+
+ selected_row = gtk_list_box_get_selected_row (GTK_LIST_BOX (panel->accounts_listbox));
+ object = g_object_get_data (G_OBJECT (selected_row), "goa-object");
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (cc_shell_get_toplevel (cc_panel_get_shell (CC_PANEL
(panel)))),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_CANCEL,
+ _("Are you sure you want to remove the account?"));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("This will not remove the account on the server."));
+ gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Remove"), GTK_RESPONSE_OK);
+ gtk_widget_show_all (dialog);
+ response = gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
- if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW
(panel->accounts_treeview)),
- NULL,
- &iter))
+ if (response == GTK_RESPONSE_OK)
{
- GoaObject *object;
- GtkWidget *dialog;
- gint response;
-
- gtk_tree_model_get (GTK_TREE_MODEL (panel->accounts_model),
- &iter,
- GOA_PANEL_ACCOUNTS_MODEL_COLUMN_OBJECT, &object,
- -1);
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (cc_shell_get_toplevel (cc_panel_get_shell (CC_PANEL
(panel)))),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_CANCEL,
- _("Are you sure you want to remove the account?"));
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- _("This will not remove the account on the server."));
- gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Remove"), GTK_RESPONSE_OK);
- gtk_widget_show_all (dialog);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_OK)
- {
- goa_account_call_remove (goa_object_peek_account (object),
- NULL, /* GCancellable */
- (GAsyncReadyCallback) remove_account_cb,
- g_object_ref (panel));
- }
- g_object_unref (object);
+ goa_account_call_remove (goa_object_peek_account (object),
+ NULL, /* GCancellable */
+ (GAsyncReadyCallback) remove_account_cb,
+ g_object_ref (panel));
}
}
diff --git a/panels/online-accounts/online-accounts.ui b/panels/online-accounts/online-accounts.ui
index add2a99..4e352a1 100644
--- a/panels/online-accounts/online-accounts.ui
+++ b/panels/online-accounts/online-accounts.ui
@@ -31,18 +31,12 @@
<property name="shadow_type">in</property>
<property name="min_content_height">300</property>
<child>
- <object class="GtkTreeView" id="accounts_treeview">
- <property name="width_request">278</property>
+ <object class="GtkListBox" id="accounts_listbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="show_expanders">False</property>
- <property name="level_indentation">12</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection">
- <property name="mode">browse</property>
- </object>
- </child>
+ <property name="vexpand">True</property>
+ <property name="selection_mode">browse</property>
+ <signal name="row-selected" handler="on_listbox_selection_changed"
object="CcGoaPanel" swapped="no" />
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]