2012-04-01 [colin] 3.8.0cvs36
[claws.git] / src / summaryview.c
index 16c53ebf00821a135ba5ac6c5185d620693e754f..f64c1cdded876cd79e617d5851d8880dc0461931 100644 (file)
 #include "colorlabel.h"
 #include "inc.h"
 #include "imap.h"
-#include "addressbook.h"
+#ifndef USE_NEW_ADDRBOOK
+       #include "addressbook.h"
+#else
+       #include "addressbook-dbus.h"
+       #include "addressadd.h"
+#endif
 #include "addr_compl.h"
 #include "folder_item_prefs.h"
 #include "filtering.h"
@@ -4626,8 +4631,13 @@ void summary_add_address(SummaryView *summaryview)
        if (image)
                picture = gtk_image_get_pixbuf(GTK_IMAGE(image));
 
+#ifndef USE_NEW_ADDRBOOK
        addressbook_add_contact(msginfo->fromname, from, NULL, picture);
-
+#else
+       if (addressadd_selection(msginfo->fromname, from, NULL, picture)) {
+               debug_print( "addressbook_add_contact - added\n" );
+       }
+#endif
        if (image)
                gtk_widget_destroy(image);
 }
@@ -6817,6 +6827,8 @@ static void summary_unselected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
 static void summary_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
                             gint column, SummaryView *summaryview)
 {
+       GList *list, *cur;
+       MessageView *msgview;
        MsgInfo *msginfo;
        gboolean marked_unread = FALSE;
 
@@ -6908,6 +6920,17 @@ static void summary_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
                break;
        }
 
+       list = messageview_get_msgview_list();
+       for (cur = list; cur != NULL; cur = cur->next) {
+               msgview = (MessageView *) cur->data;
+               
+               if (msgview->new_window && msgview->update_needed) {
+                       MsgInfo *new_msginfo = summary_get_selected_msg(summaryview);
+                       messageview_show(msgview, new_msginfo, msgview->all_headers);
+                       msgview->update_needed = FALSE;         
+               }
+       }
+
        if (summaryview->display_msg ||
            (prefs_common.always_show_msg &&
             messageview_is_visible(summaryview->messageview))) {
@@ -7843,7 +7866,9 @@ void summary_harvest_address(SummaryView *summaryview)
                        continue;
                msgList = g_list_append( msgList, GUINT_TO_POINTER( msginfo->msgnum ) );
        }
+
        addressbook_harvest( summaryview->folder_item, TRUE, msgList );
+
        g_list_free( msgList );
 }