Fixes NB#123142, a long tap in headers view does not open the CSM
authorSergio Villar Senin <svillar@igalia.com>
Tue, 16 Jun 2009 18:29:45 +0000 (20:29 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 17 Jun 2009 14:20:44 +0000 (16:20 +0200)
Implemented mark as (un)read in headers window CSM

src/hildon2/modest-header-window.c

index 5ed64c6..44b4d23 100644 (file)
@@ -493,12 +493,40 @@ static void
 on_mark_read_csm_activated (GtkMenuItem *item,
                            gpointer user_data)
 {
 on_mark_read_csm_activated (GtkMenuItem *item,
                            gpointer user_data)
 {
+       TnyHeader *header;
+       ModestHeaderWindow *self;
+       ModestHeaderWindowPrivate *priv;
+
+       self = (ModestHeaderWindow *) user_data;
+       priv = MODEST_HEADER_WINDOW_GET_PRIVATE (self);
+
+       header = modest_header_view_get_header_at_pos ((ModestHeaderView *) priv->header_view,
+                                                      priv->x_coord, priv->y_coord);
+
+       if (header) {
+               tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
+               g_object_unref (header);
+       }
 }
 
 static void
 on_mark_unread_csm_activated (GtkMenuItem *item,
                              gpointer user_data)
 {
 }
 
 static void
 on_mark_unread_csm_activated (GtkMenuItem *item,
                              gpointer user_data)
 {
+       TnyHeader *header;
+       ModestHeaderWindow *self;
+       ModestHeaderWindowPrivate *priv;
+
+       self = (ModestHeaderWindow *) user_data;
+       priv = MODEST_HEADER_WINDOW_GET_PRIVATE (self);
+
+       header = modest_header_view_get_header_at_pos ((ModestHeaderView *) priv->header_view,
+                                                      priv->x_coord, priv->y_coord);
+
+       if (header) {
+               tny_header_unset_flag (header, TNY_HEADER_FLAG_SEEN);
+               g_object_unref (header);
+       }
 }
 
 static GtkWidget *
 }
 
 static GtkWidget *