[anjal] Make Junk/Delete work straigt from message list.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Make Junk/Delete work straigt from message list.
- Date: Sun, 22 Mar 2009 07:33:17 -0400 (EDT)
commit 988e2a5bbec647e21d6a0c338d4e9eb0a9697017
Author: Srinivasa Ragavan <sragavan novell com>
Date: Sun Mar 22 17:04:47 2009 +0530
Make Junk/Delete work straigt from message list.
---
src/mail-folder-view.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/mail-folder-view.c b/src/mail-folder-view.c
index 365edad..a584707 100644
--- a/src/mail-folder-view.c
+++ b/src/mail-folder-view.c
@@ -737,17 +737,28 @@ mfv_tree_resize (GtkWidget *w, GtkAllocation *req, GtkTreeViewColumn *col)
gtk_tree_view_column_set_fixed_width (col, req->width - 24);
}
-
+static CamelMessageInfo *
+mfv_get_info (GObject *obj, char *path)
+{
+ GtkTreeIter iter;
+ MailFolderView *mfv = g_object_get_data(obj, "mfv");
+ return em_tree_store_get_info_from_path_string (mfv->model, path);
+
+}
static gboolean
mfv_msg_delete (GtkCellRenderer *cell, GdkEvent *event,GtkWidget *widget,const gchar *path,const GdkRectangle *background_area,const GdkRectangle *cell_area,GtkCellRendererState flags)
{
- printf("Delete\n");
+ CamelMessageInfo *info = mfv_get_info (cell, path);
+
+ camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED );
+ return TRUE;
}
static gboolean
mfv_msg_junk (GtkCellRenderer *cell, GdkEvent *event,GtkWidget *widget,const gchar *path,const GdkRectangle *background_area,const GdkRectangle *cell_area,GtkCellRendererState flags)
{
- printf("Junk\n");
+ CamelMessageInfo *info = mfv_get_info (cell, path);
+ camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_NOTJUNK|CAMEL_MESSAGE_JUNK_LEARN, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK_LEARN);
return TRUE;
}
@@ -914,6 +925,7 @@ mail_folder_view_construct (MailFolderView *shell)
/* Another VBox for Delete/Junk */
vbox = custom_cell_renderer_vbox_new ();
+ g_object_set_data (vbox, "mfv", shell);
g_object_set (vbox, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
gtk_tree_view_column_pack_end (column, vbox, FALSE);
gtk_tree_view_column_set_cell_data_func (column, vbox, draw_img, NULL, NULL);
@@ -937,6 +949,7 @@ mail_folder_view_construct (MailFolderView *shell)
custom_cell_renderer_vbox_append (vbox, cell);
g_object_set_data (cell, "data", "mail-mark-junk");
g_object_set_data (cell, "activate_func", mfv_msg_junk);
+
/* Empty image */
if (!shell->priv->light) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]