Re: Update on gmime in balsa
- From: Magick <magick Linux-Fan com>
- To: balsa-list gnome org
- Subject: Re: Update on gmime in balsa
- Date: Wed, 3 Sep 2003 11:43:05 +0200
Hi,
I forgot 3 things, first here is the attachment, the gmime patch is
against 2.0.14, and i should mention that the code in libbalsa/imap is
from libimap posted some time ago on this list, plus fixes and code from
me.
Bart
--
When a guy says "the last thing I'd wanna do is hurt you" it just means
he's gotta do other things first.
Fingerprint = CD4D 5601 287D F075 6F96 6157 99F9 E56A 4B08 6D06
--- src/balsa-index.c-old 2003-08-30 01:45:00.000000000 +0200
+++ src/balsa-index.c 2003-08-30 19:40:54.000000000 +0200
@@ -310,6 +310,62 @@
return TRUE;
}
+void
+bndx_size_column_set_attrs (GtkTreeViewColumn *tree_column,
+ GtkCellRenderer *cell,
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ gpointer data);
+
+void
+bndx_size_column_set_attrs (GtkTreeViewColumn *tree_column,
+ GtkCellRenderer *cell,
+ GtkTreeModel *tree_model,
+ GtkTreeIter *iter,
+ gpointer data)
+{
+ gchar *text;
+ PangoWeight weight;
+
+ gtk_tree_model_get (tree_model, iter,
+ BNDX_SIZE_COLUMN, &text,
+ BNDX_WEIGHT_COLUMN, &weight,
+ -1);
+
+ if (!text) {
+ GdkRectangle rect;
+ GtkTreePath* path;
+ BalsaIndex * index = BALSA_INDEX(tree_column->tree_view);
+
+ /* FIXME: There has to be a better way to test display */
+ path = gtk_tree_model_get_path(tree_model, iter);
+ gtk_tree_view_get_cell_area(GTK_TREE_VIEW(index),
+ path, tree_column, &rect);
+ gtk_tree_path_free(path);
+ if (rect.width<0 || rect.y<-rect.height) {
+ text="0";
+ } else {
+ gchar *txt_new;
+ LibBalsaMessage *message = NULL;
+
+ gtk_tree_model_get(tree_model, iter,
+ BNDX_MESSAGE_COLUMN, &message,
+ -1);
+ txt_new =
+ libbalsa_message_size_to_gchar(message, index->line_length);
+ gtk_tree_store_set(GTK_TREE_STORE(tree_model), iter,
+ BNDX_SIZE_COLUMN, txt_new,
+ -1);
+ g_free(txt_new);
+ gtk_tree_model_get (tree_model, iter,
+ BNDX_SIZE_COLUMN, &text,
+ -1);
+ }
+ }
+
+ g_object_set (cell, "text", text, "weight",weight, NULL);
+}
+
/* BalsaIndex instance init method; no tree store is set on the tree
* view--that's handled later, when the view is populated. */
static void
@@ -414,10 +470,9 @@
renderer = gtk_cell_renderer_text_new();
g_object_set(renderer, "xalign", 1.0, NULL);
gtk_tree_view_column_pack_start(column, renderer, FALSE);
- gtk_tree_view_column_set_attributes(column, renderer,
- "text", BNDX_SIZE_COLUMN,
- "weight",BNDX_WEIGHT_COLUMN,
- NULL);
+ gtk_tree_view_column_set_cell_data_func(column, renderer,
+ bndx_size_column_set_attrs,
+ NULL, NULL);
gtk_tree_view_column_set_sort_column_id(column,
BNDX_TREE_COLUMN_SIZE);
g_signal_connect(G_OBJECT(column), "clicked",
@@ -2157,16 +2212,9 @@
bndx_refresh_size_func(GtkTreeModel * model, GtkTreePath * path,
GtkTreeIter * iter, gpointer data)
{
- gchar *txt_new;
- LibBalsaMessage *message = NULL;
-
- gtk_tree_model_get(model, iter, BNDX_MESSAGE_COLUMN, &message, -1);
- txt_new =
- libbalsa_message_size_to_gchar(message, GPOINTER_TO_INT(data));
gtk_tree_store_set(GTK_TREE_STORE(model), iter,
- BNDX_SIZE_COLUMN, txt_new,
- -1);
- g_free(txt_new);
+ BNDX_SIZE_COLUMN, NULL,
+ -1);
return FALSE;
}
@@ -2475,7 +2523,7 @@
BNDX_FROM_COLUMN, from,
BNDX_SUBJECT_COLUMN, subject,
BNDX_DATE_COLUMN, date,
- BNDX_SIZE_COLUMN, size,
+ BNDX_SIZE_COLUMN, NULL,
BNDX_COLOR_COLUMN, NULL,
BNDX_WEIGHT_COLUMN, PANGO_WEIGHT_NORMAL,
-1);
PGP signature
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]