0.9.3claws34
[claws.git] / src / summaryview.c
index d3ac078f717d492047253006ed9d6893146f85e0..f55298bc7dad4edd89fd7686ed6019250883c969 100644 (file)
@@ -75,7 +75,7 @@
 #include "addressbook.h"
 #include "addr_compl.h"
 #include "scoring.h"
-#include "prefs_folder_item.h"
+#include "folder_item_prefs.h"
 #include "filtering.h"
 #include "string_match.h"
 #include "toolbar.h"
@@ -254,7 +254,7 @@ static void summary_colorlabel_menu_create(SummaryView      *summaryview);
 static GtkWidget *summary_ctree_create (SummaryView    *summaryview);
 
 /* callback functions */
-static void summary_toggle_pressed     (GtkWidget              *eventbox,
+static gint summary_toggle_pressed     (GtkWidget              *eventbox,
                                         GdkEventButton         *event,
                                         SummaryView            *summaryview);
 static void summary_button_pressed     (GtkWidget              *ctree,
@@ -263,10 +263,10 @@ static void summary_button_pressed        (GtkWidget              *ctree,
 static void summary_button_released    (GtkWidget              *ctree,
                                         GdkEventButton         *event,
                                         SummaryView            *summaryview);
-static void summary_key_pressed                (GtkWidget              *ctree,
+static gint summary_key_pressed                (GtkWidget              *ctree,
                                         GdkEventKey            *event,
                                         SummaryView            *summaryview);
-static void summary_searchbar_pressed  (GtkWidget              *ctree,
+static gint summary_searchbar_pressed  (GtkWidget              *ctree,
                                         GdkEventKey            *event,
                                         SummaryView            *summaryview);
 static void summary_searchbar_focus_evt        (GtkWidget              *ctree,
@@ -526,7 +526,8 @@ static DescriptionWindow search_descr = {
        search_descr_strings
 };
        
-static void search_description_cb (GtkWidget *widget) {
+static void search_description_cb(GtkWidget *widget)
+{
        description_window_create(&search_descr);
 };
 
@@ -708,6 +709,8 @@ SummaryView *summary_create(void)
        summaryview->msginfo_update_callback_id =
                hooks_register_hook(MSGINFO_UPDATE_HOOKLIST, summary_update_msg, (gpointer) summaryview);
 
+       summaryview->target_list = gtk_target_list_new(summary_drag_types, 1);
+
        /* CLAWS: need this to get the SummaryView * from
         * the CList */
        gtk_object_set_data(GTK_OBJECT(ctree), "summaryview", (gpointer)summaryview); 
@@ -4410,12 +4413,12 @@ void summary_set_column_order(SummaryView *summaryview)
 
 /* callback functions */
 
-static void summary_toggle_pressed(GtkWidget *eventbox, GdkEventButton *event,
+static gint summary_toggle_pressed(GtkWidget *eventbox, GdkEventButton *event,
                                   SummaryView *summaryview)
 {
-       if (!event) return;
-
-       summary_toggle_view(summaryview);
+       if (event)  
+               summary_toggle_view(summaryview);
+       return TRUE;
 }
 
 static void summary_button_pressed(GtkWidget *ctree, GdkEventButton *event,
@@ -4453,7 +4456,7 @@ void summary_pass_key_press_event(SummaryView *summaryview, GdkEventKey *event)
 #define RETURN_IF_LOCKED() \
        if (summaryview->mainwin->lock_count) return
 
-static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
+static gint summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(widget);
@@ -4461,14 +4464,14 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        MessageView *messageview;
        TextView *textview;
 
-       if (summary_is_locked(summaryview)) return;
-       if (!event) return;
+       if (summary_is_locked(summaryview)) return TRUE;
+       if (!event) return TRUE;
 
        switch (event->keyval) {
        case GDK_Left:          /* Move focus */
        case GDK_Escape:
                gtk_widget_grab_focus(summaryview->folderview->ctree);
-               return;
+               return TRUE;
        default:
                break;
        }
@@ -4478,7 +4481,7 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                if (node)
                        gtk_sctree_select(GTK_SCTREE(ctree), node);
                else
-                       return;
+                       return TRUE;
        }
 
        messageview = summaryview->messageview;
@@ -4525,13 +4528,15 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        default:
                break;
        }
+       return TRUE;
 }
 
-static void summary_searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
+static gint summary_searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
                                SummaryView *summaryview)
 {
        if (event != NULL && event->keyval == GDK_Return)
                summary_show(summaryview, summaryview->folder_item);
+       return TRUE;            
 }
 
 static void summary_searchbar_focus_evt(GtkWidget *widget, GdkEventFocus *event,
@@ -4833,7 +4838,6 @@ static void summary_locked_clicked(GtkWidget *button,
 static void summary_start_drag(GtkWidget *widget, gint button, GdkEvent *event,
                               SummaryView *summaryview)
 {
-       GtkTargetList *list;
        GdkDragContext *context;
 
        g_return_if_fail(summaryview != NULL);
@@ -4841,9 +4845,7 @@ static void summary_start_drag(GtkWidget *widget, gint button, GdkEvent *event,
        g_return_if_fail(summaryview->folder_item->folder != NULL);
        if (summaryview->selected == NULL) return;
 
-       list = gtk_target_list_new(summary_drag_types, 1);
-
-       context = gtk_drag_begin(widget, list,
+       context = gtk_drag_begin(widget, summaryview->target_list,
                                 GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_DEFAULT, button, event);
        gtk_drag_set_icon_default(context);
 }
@@ -4987,7 +4989,7 @@ static gint summary_cmp_by_subject(GtkCList *clist,                        \
  static gint summary_cmp_by_simplified_subject
        (GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2)
 {
-       const PrefsFolderItem *prefs;
+       const FolderItemPrefs *prefs;
        const gchar *str1, *str2;
        const GtkCListRow *r1 = (const GtkCListRow *) ptr1;
        const GtkCListRow *r2 = (const GtkCListRow *) ptr2;