2006-05-18 [colin] 2.2.0cvs33
authorColin Leroy <colin@colino.net>
Thu, 18 May 2006 17:10:21 +0000 (17:10 +0000)
committerColin Leroy <colin@colino.net>
Thu, 18 May 2006 17:10:21 +0000 (17:10 +0000)
        * src/imap.c
                Warning fix
        * src/compose.c
        * src/mainwindow.c
        * src/summaryview.c
        * src/toolbar.c
                Allow replying to multiple emails
                in multiple windows
        * src/mimeview.c
        * src/etpan/imap-thread.c
                Leak fixes

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/etpan/imap-thread.c
src/imap.c
src/mainwindow.c
src/mimeview.c
src/summaryview.c
src/toolbar.c

index d5aa881a67aa827a3c2c03c8220e3282e8dcec5d..32ad77633022bbe19794d93e418162b058dfcbf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-05-18 [colin]     2.2.0cvs33
+
+       * src/imap.c
+               Warning fix
+       * src/compose.c
+       * src/mainwindow.c
+       * src/summaryview.c
+       * src/toolbar.c
+               Allow replying to multiple emails
+               in multiple windows
+       * src/mimeview.c
+       * src/etpan/imap-thread.c
+               Leak fixes
+
 2006-05-18 [paul]      2.2.0cvs32
 
        * src/summaryview.c
index d1b67245d8b6ad4427187bb979980147076ebcc0..7e56a1bba5527c51c2f038620c8ae2648e385641 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 manual/handling.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/fr/handling.xml;  ) > 2.2.0cvs30.patchset
 ( cvs diff -u -r 1.1.2.15 -r 1.1.2.16 manual/advanced.xml;  cvs diff -u -r 1.1.2.8 -r 1.1.2.9 manual/faq.xml;  cvs diff -u -r 1.1.2.8 -r 1.1.2.9 manual/glossary.xml;  cvs diff -u -r 1.1.2.7 -r 1.1.2.8 manual/handling.xml;  cvs diff -u -r 1.1.2.6 -r 1.1.2.7 manual/intro.xml;  cvs diff -u -r 1.1.2.11 -r 1.1.2.12 manual/plugins.xml;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 manual/sylpheed-claws-manual.xml;  cvs diff -u -r 1.1.2.30 -r 1.1.2.31 src/wizard.c;  cvs diff -u -r 1.9.2.24 -r 1.9.2.25 src/common/defs.h;  cvs diff -u -r 1.4.2.32 -r 1.4.2.33 src/gtk/about.c;  cvs diff -u -r 1.2 -r 1.3 src/plugins/dillo_viewer/README;  ) > 2.2.0cvs31.patchset
 ( cvs diff -u -r 1.395.2.200 -r 1.395.2.201 src/summaryview.c;  ) > 2.2.0cvs32.patchset
+( cvs diff -u -r 1.382.2.272 -r 1.382.2.273 src/compose.c;  cvs diff -u -r 1.179.2.113 -r 1.179.2.114 src/imap.c;  cvs diff -u -r 1.274.2.115 -r 1.274.2.116 src/mainwindow.c;  cvs diff -u -r 1.83.2.69 -r 1.83.2.70 src/mimeview.c;  cvs diff -u -r 1.395.2.201 -r 1.395.2.202 src/summaryview.c;  cvs diff -u -r 1.43.2.44 -r 1.43.2.45 src/toolbar.c;  cvs diff -u -r 1.1.4.36 -r 1.1.4.37 src/etpan/imap-thread.c;  ) > 2.2.0cvs33.patchset
index e46099776d0b5fdc393cd5d83a38cc9254266346..6055013f73b2e2224dc8d3626daff2873c12417e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=2
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=32
+EXTRA_VERSION=33
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index cc62e1e6526df45c3a1d9a932288fdf7a62a3d5b..c03a639bb8a6f1c7ea8da5407704ee3c123b49e5 100644 (file)
@@ -5689,6 +5689,7 @@ static void compose_spell_menu_changed(void *data)
 }
 #endif
 
+static gboolean compose_force_window_origin = TRUE;
 static Compose *compose_create(PrefsAccount *account, ComposeMode mode,
                                                 gboolean batch)
 {
@@ -5768,7 +5769,9 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode,
        }
        gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL,
                                      &geometry, GDK_HINT_MIN_SIZE);
-       gtk_widget_set_uposition(window, prefs_common.compose_x, 
+       
+       if (compose_force_window_origin)
+               gtk_widget_set_uposition(window, prefs_common.compose_x, 
                                 prefs_common.compose_y);
 
        g_signal_connect(G_OBJECT(window), "delete_event",
@@ -8788,10 +8791,10 @@ static void compose_add_field_list( Compose *compose, GList *listAddress ) {
        }
 }
 
-void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list, 
-                                   guint action)
+static void compose_reply_from_messageview_real(MessageView *msgview, GSList *msginfo_list, 
+                                   guint action, gboolean opening_multiple)
 {
-       gchar *body;
+       gchar *body = NULL;
        GSList *new_msglist = NULL;
        MsgInfo *tmp_msginfo = NULL;
        gboolean originally_enc = FALSE;
@@ -8801,7 +8804,7 @@ void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list,
 
        g_return_if_fail(msginfo_list != NULL);
 
-       if (g_slist_length(msginfo_list) == 1) {
+       if (g_slist_length(msginfo_list) == 1 && !opening_multiple) {
                MimeInfo *mimeinfo = messageview_get_selected_mime_part(msgview);
                MsgInfo *orig_msginfo = (MsgInfo *)msginfo_list->data;
                
@@ -8818,7 +8821,8 @@ void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list,
                }
        }
 
-       body = messageview_get_selection(msgview);
+       if (!opening_multiple)
+               body = messageview_get_selection(msgview);
 
        if (new_msglist) {
                compose = compose_reply_mode((ComposeMode)action, new_msglist, body);
@@ -8834,6 +8838,41 @@ void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list,
        g_free(body);
 }
 
+void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list, 
+                                   guint action)
+{
+       if ((!prefs_common.forward_as_attachment || action != COMPOSE_FORWARD) 
+       &&  action != COMPOSE_FORWARD_AS_ATTACH && g_slist_length(msginfo_list) > 1) {
+               GSList *cur = msginfo_list;
+               gchar *msg = g_strdup_printf(_("You are about to reply to %d "
+                                              "messages. Opening the windows "
+                                              "could take some time. Do you "
+                                              "want to continue?"), 
+                                              g_slist_length(msginfo_list));
+               if (g_slist_length(msginfo_list) > 9
+               &&  alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, "+" GTK_STOCK_YES, NULL)
+                   != G_ALERTALTERNATE) {
+                       g_free(msg);
+                       return;
+               }
+               g_free(msg);
+               /* We'll open multiple compose windows */
+               /* let the WM place the next windows */
+               compose_force_window_origin = FALSE;
+               for (; cur; cur = cur->next) {
+                       GSList tmplist;
+                       tmplist.data = cur->data;
+                       tmplist.next = NULL;
+                       compose_reply_from_messageview_real(msgview, &tmplist, action, TRUE);
+               }
+               compose_force_window_origin = TRUE;
+       } else {
+               /* forwarding multiple mails as attachments is done via a
+                * single compose window */
+               compose_reply_from_messageview_real(msgview, msginfo_list, action, FALSE);
+       }
+}
+
 void compose_set_position(Compose *compose, gint pos)
 {
        GtkTextView *text = GTK_TEXT_VIEW(compose->text);
index 465d14aec3ef2827bf74d38f151a0178649d5cd5..3912d5f8e93effab07e7a5bc8265bdedfbc61dc1 100644 (file)
@@ -1073,6 +1073,26 @@ struct search_result {
        clist * search_result;
 };
 
+static struct mailimap_set_item *sc_mailimap_set_item_copy(struct mailimap_set_item *orig)
+{
+       return mailimap_set_item_new(orig->set_first, orig->set_last);
+}
+
+static struct mailimap_set *sc_mailimap_set_copy(struct mailimap_set *orig)
+{
+       clist *list = orig ? orig->set_list : NULL;
+       clist *newlist = clist_new();
+       clistiter *cur;
+       
+       if (!orig)
+               return NULL;
+       for (cur = clist_begin(list); cur; cur = clist_next(cur))
+               clist_append(newlist, 
+                       sc_mailimap_set_item_copy(
+                       (struct mailimap_set_item *)clist_content(cur)));
+       return mailimap_set_new(newlist);
+}
+
 static void search_run(struct etpan_thread_op * op)
 {
        struct search_param * param;
@@ -1085,7 +1105,8 @@ static void search_run(struct etpan_thread_op * op)
        
        param = op->param;
        
-       uid_key = mailimap_search_key_new_uid(param->set);
+       /* we copy the mailimap_set because freeing the key is recursive */
+       uid_key = mailimap_search_key_new_uid(sc_mailimap_set_copy(param->set));
        
        search_type_key = NULL;
        switch (param->type) {
@@ -1149,6 +1170,9 @@ static void search_run(struct etpan_thread_op * op)
        
        r = mailimap_uid_search(param->imap, NULL, key, &search_result);
        
+       /* free the key (with the imapset) */
+       mailimap_search_key_free(key);
+
        result = op->result;
        result->error = r;
        result->search_result = search_result;
index e0014de824f679a6bf5f409132740207a32c4f5d..c59fc8b0553730b9d2a90c262ed9dca4d5f53429 100644 (file)
@@ -2271,7 +2271,7 @@ static gchar imap_get_path_separator(IMAPFolder *folder, const gchar *path)
 {
        IMAPNameSpace *namespace;
        gchar separator = '/';
-       Session *session = imap_session_get(folder);
+       IMAPSession *session = imap_session_get(FOLDER(folder));
        g_return_val_if_fail(session != NULL, '/');
 
        if (folder->last_seen_separator == 0) {
index c76e225501bf1f7c5f03c437d74e1656553f93f9..4347c4196b982fa059097114c318089ffd73fc28 100644 (file)
@@ -2123,12 +2123,12 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                                                 , M_INC_ACTIVE},
 
                {"/Message/Compose a news message", M_HAVE_NEWS_ACCOUNT},
-               {"/Message/Reply"                 , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Reply to"              , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Follow-up and reply to", M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST|M_NEWS},
+               {"/Message/Reply"                 , M_HAVE_ACCOUNT|M_TARGET_EXIST},
+               {"/Message/Reply to"              , M_HAVE_ACCOUNT|M_TARGET_EXIST},
+               {"/Message/Follow-up and reply to", M_HAVE_ACCOUNT|M_TARGET_EXIST|M_NEWS},
                {"/Message/Forward"               , M_HAVE_ACCOUNT|M_TARGET_EXIST},
                {"/Message/Forward as attachment" , M_HAVE_ACCOUNT|M_TARGET_EXIST},
-               {"/Message/Redirect"              , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {"/Message/Redirect"              , M_HAVE_ACCOUNT|M_TARGET_EXIST},
                {"/Message/Move..."               , M_TARGET_EXIST|M_ALLOW_DELETE},
                {"/Message/Copy..."               , M_TARGET_EXIST|M_EXEC},
                {"/Message/Move to trash"         , M_TARGET_EXIST|M_ALLOW_DELETE|M_NOT_NEWS},
index f577c6e4828becac236d7cc4adce2c35f70b656d..811a00a33c2c2f7a374a33f8adfdf158a9ace65f 100644 (file)
@@ -2022,6 +2022,7 @@ static void icon_list_clear (MimeView *mimeview)
        for (; child != NULL; child = g_list_next(child)) {
                gtkut_container_remove(GTK_CONTAINER(mimeview->icon_vbox), 
                                       GTK_WIDGET(child->data));
+               gtk_widget_destroy(GTK_WIDGET(child->data));
        }
        mimeview->icon_count = 0;
        adj  = gtk_layout_get_vadjustment(GTK_LAYOUT(mimeview->icon_scroll));
index 4d03af2b289282c181375ee8e8808883f8b515ef..86a1576545eb4c23d2a637d69d4713b040bef6e4 100644 (file)
@@ -1309,15 +1309,15 @@ void summary_set_menu_sensitive(SummaryView *summaryview)
                gchar *const entry;
                SensitiveCond cond;
        } entry[] = {
-               {"/Reply"                       , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Reply to"                    , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Reply to/all"                , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Reply to/sender"             , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Reply to/mailing list"       , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {"/Reply"                       , M_HAVE_ACCOUNT|M_TARGET_EXIST},
+               {"/Reply to"                    , M_HAVE_ACCOUNT|M_TARGET_EXIST},
+               {"/Reply to/all"                , M_HAVE_ACCOUNT|M_TARGET_EXIST},
+               {"/Reply to/sender"             , M_HAVE_ACCOUNT|M_TARGET_EXIST},
+               {"/Reply to/mailing list"       , M_HAVE_ACCOUNT|M_TARGET_EXIST},
 
                {"/Forward"                     , M_HAVE_ACCOUNT|M_TARGET_EXIST},
                {"/Forward as attachment"       , M_HAVE_ACCOUNT|M_TARGET_EXIST},
-               {"/Redirect"                    , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {"/Redirect"                    , M_HAVE_ACCOUNT|M_TARGET_EXIST},
 
                {"/Move..."                     , M_TARGET_EXIST|M_ALLOW_DELETE|M_NOT_NEWS},
                {"/Copy..."                     , M_TARGET_EXIST|M_EXEC},
index 8a241d47cc238e9e052b1431a2170c186b0026cb..b4ab79dc51d89ee8cbab0648a9538ad1a25c9517 100644 (file)
@@ -1871,32 +1871,33 @@ void toolbar_main_set_sensitive(gpointer data)
                        M_HAVE_ACCOUNT);
        SET_WIDGET_COND(toolbar->compose_news_btn, M_HAVE_ACCOUNT);
        SET_WIDGET_COND(toolbar->reply_btn,
-                       M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+                       M_HAVE_ACCOUNT|M_TARGET_EXIST);
        if (toolbar->reply_btn)
                SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->reply_combo),
-                       M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
-       SET_WIDGET_COND(toolbar->replyall_btn,
-                       M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+                       M_HAVE_ACCOUNT|M_TARGET_EXIST);
+       if (toolbar->replyall_btn)
+               SET_WIDGET_COND(toolbar->replyall_btn,
+                       M_HAVE_ACCOUNT|M_TARGET_EXIST);
        if (toolbar->replyall_btn)
                SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->replyall_combo),
-                       M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+                       M_HAVE_ACCOUNT|M_TARGET_EXIST);
        SET_WIDGET_COND(toolbar->replylist_btn,
-                       M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+                       M_HAVE_ACCOUNT|M_TARGET_EXIST);
        if (toolbar->replylist_btn) 
                SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->replylist_combo),
-                       M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+                       M_HAVE_ACCOUNT|M_TARGET_EXIST);
        SET_WIDGET_COND(toolbar->replysender_btn,
-                       M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+                       M_HAVE_ACCOUNT|M_TARGET_EXIST);
        if (toolbar->replysender_btn)
                SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->replysender_combo),
-                       M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+                       M_HAVE_ACCOUNT|M_TARGET_EXIST);
        SET_WIDGET_COND(toolbar->fwd_btn, M_HAVE_ACCOUNT|M_TARGET_EXIST);
        if (toolbar->fwd_btn)
                SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->fwd_combo),
                        M_HAVE_ACCOUNT|M_TARGET_EXIST); 
        if (toolbar->fwd_combo) {
                GtkWidget *submenu = gtk_item_factory_get_widget(toolbar->fwd_combo->factory, "/Redirect");
-               SET_WIDGET_COND(submenu, M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST); 
+               SET_WIDGET_COND(submenu, M_HAVE_ACCOUNT|M_TARGET_EXIST); 
        }
 
        if (prefs_common.next_unread_msg_dialog == NEXTUNREADMSGDIALOG_ASSUME_NO) {