gchar *local_account_name;
gchar *visible_account_id;
ModestFolderViewStyle style;
+
+ gboolean reselect; /* we use this to force a reselection of the INBOX */
};
#define MODEST_FOLDER_VIEW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), \
priv->clipboard = modest_runtime_get_email_clipboard ();
priv->hidding_ids = NULL;
priv->n_selected = 0;
+ priv->reselect = FALSE;
/* Build treeview */
add_columns (GTK_WIDGET (obj));
title != NULL);
}
+static gboolean
+modest_folder_view_on_map (ModestFolderView *self,
+ GdkEventExpose *event,
+ gpointer data)
+{
+ ModestFolderViewPrivate *priv;
+
+ priv = MODEST_FOLDER_VIEW_GET_PRIVATE (self);
+
+ /* This won't happen often */
+ if (G_UNLIKELY (priv->reselect)) {
+ /* Select the first inbox or the local account if not found */
+ modest_folder_view_select_first_inbox_or_local (self);
+ priv->reselect = FALSE;
+ }
+ return FALSE;
+}
+
GtkWidget*
modest_folder_view_new (TnyFolderStoreQuery *query)
{
priv->changed_signal = g_signal_connect (sel, "changed",
G_CALLBACK (on_selection_changed), self);
+ g_signal_connect (self, "expose-event", G_CALLBACK (modest_folder_view_on_map), NULL);
+
return GTK_WIDGET(self);
}
gtk_tree_view_set_model (GTK_TREE_VIEW(self), filter_model);
/* gtk_tree_view_set_model (GTK_TREE_VIEW(self), */
/* (filter_model) ? filter_model : sortable); */
- expand_root_items (self); /* expand all account folders */
-
+
g_object_unref (model);
-
g_object_unref (filter_model);
/* if (filter_model) */
/* g_object_unref (filter_model); */
g_object_unref (sortable);
- /* Select the first inbox or the local account if not found */
- modest_folder_view_select_first_inbox_or_local (self);
+ /* Force a reselection of the INBOX next time the widget is shown */
+ priv->reselect = TRUE;
return TRUE;
}