#include <glib/gi18n.h>
#include "modest-account-view.h"
-/* include other impl specific header files */
+#include <gtk/gtkcellrenderertoggle.h>
+#include <gtk/gtkcellrenderertext.h>
+#include <gtk/gtktreeselection.h>
+#include <gtk/gtkliststore.h>
/* 'private'/'protected' functions */
static void modest_account_view_class_init (ModestAccountViewClass *klass);
gobject_class->finalize = modest_account_view_finalize;
g_type_class_add_private (gobject_class, sizeof(ModestAccountViewPrivate));
-
- /* signal definitions go here, e.g.: */
-/* signals[MY_SIGNAL_1] = */
-/* g_signal_new ("my_signal_1",....); */
-/* signals[MY_SIGNAL_2] = */
-/* g_signal_new ("my_signal_2",....); */
-/* etc. */
}
static void
while (cursor) {
gchar *proto = NULL;
- gchar *store, *account_name;
+ gchar *store, *account_name, *display_name;
gboolean enabled;
account_name = (gchar*)cursor->data;
- store = modest_account_mgr_get_string (account_mgr,
+ display_name = modest_account_mgr_get_string (account_mgr,
account_name,
- MODEST_ACCOUNT_STORE_ACCOUNT,
+ MODEST_ACCOUNT_DISPLAY_NAME,
FALSE, NULL);
+ /* don't display accounts without stores */
if (store) {
-
- proto = modest_account_mgr_get_string (account_mgr,
- store,
- MODEST_ACCOUNT_PROTO,
- TRUE, NULL);
- g_free(store);
- }
-
- enabled = modest_account_mgr_account_get_enabled (account_mgr, account_name);
- gtk_list_store_insert_with_values (
- model, NULL, 0,
- ENABLED_COLUMN, enabled,
- NAME_COLUMN, account_name,
- PROTO_COLUMN, proto,
- -1);
+ store = modest_account_mgr_get_string (account_mgr,
+ account_name,
+ MODEST_ACCOUNT_STORE_ACCOUNT,
+ FALSE, NULL);
+ if (store) {
+ proto = modest_account_mgr_get_string (account_mgr,
+ store,
+ MODEST_ACCOUNT_PROTO,
+ TRUE, NULL);
+ g_free(store);
+ }
+ enabled = modest_account_mgr_account_get_enabled (account_mgr, account_name);
+ gtk_list_store_insert_with_values (
+ model, NULL, 0,
+ ENABLED_COLUMN, enabled,
+ NAME_COLUMN, display_name,
+ PROTO_COLUMN, proto,
+ -1);
+ }
+ g_free (display_name);
g_free (account_name);
g_free (proto);
g_free (account_name);
}
-
static void
init_view (ModestAccountView *self)
{
ModestAccountViewPrivate *priv;
- GtkTreeSelection *sel;
GtkCellRenderer *renderer;
GtkListStore *model;
gtk_cell_renderer_text_new (),
"text", PROTO_COLUMN, NULL));
- sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(self));
-
priv->sig1 = g_signal_connect (G_OBJECT(priv->account_mgr),
"account_removed",
G_CALLBACK(on_account_removed), self);