sync with 0.9.8cvs8
authorPaul Mangan <paul@claws-mail.org>
Sun, 25 Jan 2004 10:38:25 +0000 (10:38 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 25 Jan 2004 10:38:25 +0000 (10:38 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/folder.c
src/folder.h
src/folderview.c

index c397500..247ca21 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2004-01-23
+
+       * src/folder.[ch]: folder_item_fetch_all_msg(): new. It fetches all
+         messages in a folder.
+       * src/folderview.c: implemented 'Download' feature.
+
+2004-01-23
+
+       * src/gtkutils.[ch]: implemented ComboButton which adds an arrow
+         menu button to a button.
+       * src/mainwindow.[ch]: main_window_toolbar_create(): added combo
+         button to reply and forward button.
+
 2004-01-22
 
        * src/mainwindow.c: fixed automatic expansion of window size because
index dde3802..c9c2252 100644 (file)
@@ -1,3 +1,14 @@
+2004-01-25 [paul]      0.9.8claws47
+
+       * sync with 0.9.8cvs8
+               see ChangeLog 2004-01-23
+               
+       * tools/mbox_convert.pl
+               Fixed (hopefully) to account for From lines 
+               that are of various lengths and that might have
+               timezone info at the end
+               submitted by Fred Marton
+
 2004-01-25 [thorsten]  0.9.8claws46
 
        * src/messageview.c
index 6f93dc1..2aa7b1c 100644 (file)
@@ -1,3 +1,16 @@
+2004-01-23
+
+       * src/folder.[ch]: folder_item_fetch_all_msg(): ¿·µ¬¡£¥Õ¥©¥ë¥ÀÃæ¤Î
+         Á´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤¹¤ë¡£
+       * src/folderview.c: ¡Ö¥À¥¦¥ó¥í¡¼¥É¡×µ¡Ç½¤ò¼ÂÁõ¡£
+
+2004-01-23
+
+       * src/gtkutils.[ch]: Ìð°õ¥á¥Ë¥å¡¼¥Ü¥¿¥ó¤ò¥Ü¥¿¥ó¤ËÉղ乤ë ComboButton
+         ¤ò¼ÂÁõ¡£
+       * src/mainwindow.[ch]: main_window_toolbar_create(): ÊÖ¿®¡¢Å¾Á÷¥Ü¥¿¥ó
+         ¤Ë¥³¥ó¥Ü¥Ü¥¿¥ó¤òÄɲá£
+
 2004-01-22
 
        * src/mainwindow.c: ¥Ä¡¼¥ë¥Ð¡¼¤Ë¤è¤Ã¤Æ¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤¬¼«Æ°Åª¤Ë
index d9734a6..ca88a79 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=46
+EXTRA_VERSION=47
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 2a7b10c..491d350 100644 (file)
@@ -1881,6 +1881,37 @@ gchar *folder_item_fetch_msg(FolderItem *item, gint num)
        return folder->klass->fetch_msg(folder, item, num);
 }
 
+gint folder_item_fetch_all_msg(FolderItem *item)
+{
+       GSList *mlist;
+       GSList *cur;
+       gint ret = 0;
+
+       g_return_val_if_fail(item != NULL, -1);
+
+       debug_print("fetching all messages in %s ...\n", item->path);
+
+       mlist = folder_item_get_msg_list(item);
+
+       for (cur = mlist; cur != NULL; cur = cur->next) {
+               MsgInfo *msginfo = (MsgInfo *)cur->data;
+               gchar *msg;
+
+               msg = folder_item_fetch_msg(item, msginfo->msgnum);
+               if (!msg) {
+                       g_warning("Can't fetch message %d. Aborting.\n",
+                                 msginfo->msgnum);
+                       ret = -1;
+                       break;
+               }
+               g_free(msg);
+       }
+
+       procmsg_msg_list_free(mlist);
+
+       return ret;
+}
+
 static gint folder_item_get_msg_num_by_file(FolderItem *dest, const gchar *file)
 {
        static HeaderEntry hentry[] = {{"Message-ID:",  NULL, TRUE},
index dadb1e9..2c2e4a0 100644 (file)
@@ -404,6 +404,7 @@ MsgInfo *folder_item_get_msginfo_by_msgid(FolderItem        *item,
 GSList *folder_item_get_msg_list       (FolderItem     *item);
 gchar *folder_item_fetch_msg           (FolderItem     *item,
                                         gint            num);
+gint   folder_item_fetch_all_msg       (FolderItem     *item);
 gint   folder_item_add_msg             (FolderItem     *dest,
                                         const gchar    *file,
                                         MsgFlags       *flags,
index b0a72d4..d5321c6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -180,6 +180,10 @@ static void folderview_col_resized (GtkCList       *clist,
                                         gint            width,
                                         FolderView     *folderview);
 
+static void folderview_download_cb     (FolderView     *folderview,
+                                        guint           action,
+                                        GtkWidget      *widget);
+
 static void folderview_update_tree_cb  (FolderView     *folderview,
                                         guint           action,
                                         GtkWidget      *widget);
@@ -322,6 +326,8 @@ static GtkItemFactoryEntry folderview_imap_popup_entries[] =
        {N_("/M_ove folder..."),        NULL, folderview_move_to_cb, 0, NULL},
        {N_("/_Delete folder"),         NULL, folderview_delete_folder_cb,   0, NULL},
        {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
+       {N_("/Down_load"),              NULL, folderview_download_cb, 0, NULL},
+       {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/_Check for new messages"),
                                        NULL, folderview_update_tree_cb, 0, NULL},
        {N_("/R_ebuild folder tree"),   NULL, folderview_update_tree_cb, 1, NULL},
@@ -341,6 +347,8 @@ static GtkItemFactoryEntry folderview_news_popup_entries[] =
                                        NULL, folderview_new_news_group_cb, 0, NULL},
        {N_("/_Remove newsgroup"),      NULL, folderview_rm_news_group_cb, 0, NULL},
        {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
+       {N_("/Down_load"),              NULL, folderview_download_cb, 0, NULL},
+       {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/_Check for new messages"),
                                        NULL, folderview_update_tree_cb, 0, NULL},
        {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
@@ -1442,6 +1450,7 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
        gboolean rename_folder   = FALSE;
        gboolean move_folder     = FALSE;
        gboolean delete_folder   = FALSE;
+       gboolean download_msg    = FALSE;
        gboolean update_tree     = FALSE;
        gboolean rescan_tree     = FALSE;
        gboolean remove_tree     = FALSE;
@@ -1516,6 +1525,13 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
                        if (folder_item_parent(item) != NULL)
                                delete_folder = folder_scoring = folder_processing = TRUE;
                }
+               if (FOLDER_TYPE(folder) == F_IMAP ||
+                   FOLDER_TYPE(folder) == F_NEWS) {
+                       if (folder_item_parent(item) != NULL && 
+                           item->no_select == FALSE &&
+                           !prefs_common.work_offline)
+                               download_msg = TRUE;
+               }
                if (item->unread_msgs < 1) 
                        mark_all_read = FALSE;
        }
@@ -1548,6 +1564,7 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
                SET_SENS(imap_factory, "/Rename folder...", rename_folder);
                SET_SENS(imap_factory, "/Move folder...", move_folder);
                SET_SENS(imap_factory, "/Delete folder", delete_folder);
+               SET_SENS(imap_factory, "/Download", download_msg);
                SET_SENS(imap_factory, "/Check for new messages", update_tree);
                SET_SENS(imap_factory, "/Rebuild folder tree", rescan_tree);
                SET_SENS(imap_factory, "/Remove IMAP4 account", remove_tree);
@@ -1560,6 +1577,7 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
                SET_SENS(news_factory, "/Mark all read", mark_all_read);
                SET_SENS(news_factory, "/Subscribe to newsgroup...", new_folder);
                SET_SENS(news_factory, "/Remove newsgroup", delete_folder);
+               SET_SENS(news_factory, "/Download", download_msg);
                SET_SENS(news_factory, "/Check for new messages", update_tree);
                SET_SENS(news_factory, "/Remove news account", remove_tree);
                SET_SENS(news_factory, "/Search folder...", search_folder);
@@ -1809,6 +1827,46 @@ static GtkCTreeNode *folderview_find_by_name(GtkCTree *ctree,
        return NULL;
 }
 
+static void folderview_download_cb(FolderView *folderview, guint action,
+                                  GtkWidget *widget)
+{
+       GtkCTree *ctree = GTK_CTREE(folderview->ctree);
+       MainWindow *mainwin = folderview->mainwin;
+       FolderItem *item;
+
+       if (!folderview->selected) return;
+
+       item = gtk_ctree_node_get_row_data(ctree, folderview->selected);
+       g_return_if_fail(item != NULL);
+       g_return_if_fail(item->folder != NULL);
+#if 0
+       if (!prefs_common.online_mode) {
+               if (alertpanel(_("Offline"),
+                              _("You are offline. Go online?"),
+                              _("Yes"), _("No"), NULL) == G_ALERTDEFAULT)
+                       main_window_toggle_online(folderview->mainwin, TRUE);
+               else
+                       return;
+       }
+#endif
+       STATUSBAR_PUSH(mainwin, _("Downloading messages..."));
+       main_window_cursor_wait(mainwin);
+       inc_lock();
+       main_window_lock(mainwin);
+       GTK_EVENTS_FLUSH();
+       if (folder_item_fetch_all_msg(item) < 0) {
+               gchar *name;
+
+               name = trim_string(item->name, 32);
+               alertpanel_error(_("Error occurred while downloading messages in `%s'."), name);
+               g_free(name);
+       }
+       main_window_unlock(mainwin);
+       inc_unlock();
+       main_window_cursor_normal(mainwin);
+       STATUSBAR_POP(mainwin);
+}
+
 static void folderview_update_tree_cb(FolderView *folderview, guint action,
                                      GtkWidget *widget)
 {