2005-09-07 [colin] 1.9.14cvs2
authorColin Leroy <colin@colino.net>
Wed, 7 Sep 2005 18:19:18 +0000 (18:19 +0000)
committerColin Leroy <colin@colino.net>
Wed, 7 Sep 2005 18:19:18 +0000 (18:19 +0000)
* src/folderview.c
* src/procmsg.c
* src/summaryview.c
* src/toolbar.c
Fix special subfolders:
- Inherit parent's icon
- sent contents of queues subfolders
- empty subfolders of trashes
* src/mainwindow.c
Remove outdated manual and faq entries
* src/common/utils.c
Add quotes around %s coming from mailcap

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/common/utils.c
src/folderview.c
src/mainwindow.c
src/procmsg.c
src/summaryview.c
src/toolbar.c

index 0e4bf03549ae1c1655b0f1061533102749295c2e..0e87178a33861a88c15c50879fcb7122ce016343 100644 (file)
@@ -1,3 +1,18 @@
+2005-09-07 [colin]     1.9.14cvs2
+
+       * src/folderview.c
+       * src/procmsg.c
+       * src/summaryview.c
+       * src/toolbar.c
+               Fix special subfolders:
+               - Inherit parent's icon
+               - sent contents of queues subfolders
+               - empty subfolders of trashes
+       * src/mainwindow.c
+               Remove outdated manual and faq entries
+       * src/common/utils.c
+               Add quotes around %s coming from mailcap
+
 2005-09-07 [colin]     1.9.14cvs1
 
        * src/compose.c
 2005-09-07 [colin]     1.9.14cvs1
 
        * src/compose.c
index 2683c711758e9f8d4dd20465b628f400c9b217d9..7d9555df8b3beb29f935af58ea7c05dd40b7fe9b 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.160 -r 1.382.2.161 src/compose.c;  ) > 1.9.13cvs82.patchset
 ( cvs diff -u -r 1.58.2.11 -r 1.58.2.12 po/de.po;  cvs diff -u -r 1.60.2.12 -r 1.60.2.13 po/es.po;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 po/fi.po;  cvs diff -u -r 1.42.2.12 -r 1.42.2.13 po/fr.po;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 po/nb.po;  cvs diff -u -r 1.50.2.9 -r 1.50.2.10 po/pt_BR.po;  cvs diff -u -r 1.17.2.12 -r 1.17.2.13 po/sr.po;  ) > 1.9.13cvs83.patchset
 ( cvs diff -u -r 1.382.2.161 -r 1.382.2.162 src/compose.c;  cvs diff -u -r 1.83.2.38 -r 1.83.2.39 src/mimeview.c;  cvs diff -u -r 1.36.2.42 -r 1.36.2.43 src/common/utils.c;  cvs diff -u -r 1.20.2.23 -r 1.20.2.24 src/common/utils.h;  ) > 1.9.14cvs1.patchset
 ( cvs diff -u -r 1.382.2.160 -r 1.382.2.161 src/compose.c;  ) > 1.9.13cvs82.patchset
 ( cvs diff -u -r 1.58.2.11 -r 1.58.2.12 po/de.po;  cvs diff -u -r 1.60.2.12 -r 1.60.2.13 po/es.po;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 po/fi.po;  cvs diff -u -r 1.42.2.12 -r 1.42.2.13 po/fr.po;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 po/nb.po;  cvs diff -u -r 1.50.2.9 -r 1.50.2.10 po/pt_BR.po;  cvs diff -u -r 1.17.2.12 -r 1.17.2.13 po/sr.po;  ) > 1.9.13cvs83.patchset
 ( cvs diff -u -r 1.382.2.161 -r 1.382.2.162 src/compose.c;  cvs diff -u -r 1.83.2.38 -r 1.83.2.39 src/mimeview.c;  cvs diff -u -r 1.36.2.42 -r 1.36.2.43 src/common/utils.c;  cvs diff -u -r 1.20.2.23 -r 1.20.2.24 src/common/utils.h;  ) > 1.9.14cvs1.patchset
+( cvs diff -u -r 1.207.2.62 -r 1.207.2.63 src/folderview.c;  cvs diff -u -r 1.274.2.58 -r 1.274.2.59 src/mainwindow.c;  cvs diff -u -r 1.150.2.42 -r 1.150.2.43 src/procmsg.c;  cvs diff -u -r 1.395.2.121 -r 1.395.2.122 src/summaryview.c;  cvs diff -u -r 1.43.2.23 -r 1.43.2.24 src/toolbar.c;  cvs diff -u -r 1.36.2.43 -r 1.36.2.44 src/common/utils.c;  ) > 1.9.14cvs2.patchset
index da2d36dfa70cb768da50c5440161d67a283afbd9..59201f5c8d762092d9393efd5af4618e9f0020e3 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=14
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=14
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=1
+EXTRA_VERSION=2
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 556bf3cf0be83125e9bce6d0a8aa131a31fdcfdc..fb26796346352c4e1c1c721e0c8df4bb699f3cfb 100644 (file)
@@ -4414,6 +4414,17 @@ static gchar *mailcap_get_command_in_file(const gchar *path, const gchar *type)
                        result = g_strdup(trimmed);
                        g_strfreev(parts);
                        fclose(fp);
                        result = g_strdup(trimmed);
                        g_strfreev(parts);
                        fclose(fp);
+                       if (strstr(result, "%s") && !strstr(result, "'%s'")) {
+                               gchar *start = g_strdup(result);
+                               gchar *end = g_strdup(strstr(result, "%s")+2);
+                               gchar *tmp;
+                               *strstr(start, "%s") = '\0';
+                               tmp = g_strconcat(start,"'%s'",end, NULL);
+                               g_free(start);
+                               g_free(end);
+                               g_free(result);
+                               result = tmp;
+                       }
                        return result;
                }
                g_strfreev(parts);
                        return result;
                }
                g_strfreev(parts);
index 7fb65908e427fd11b736609fbd1f06d4e47d8454..058b6a4f4aab6ccec98fdc3712aeafb7f33d16ab 100644 (file)
@@ -639,7 +639,6 @@ void folderview_init(FolderView *folderview)
        }
 
        if (!bold_style) {
        }
 
        if (!bold_style) {
-               PangoFontDescription *font_desc;
                bold_style = gtk_style_copy(gtk_widget_get_style(ctree));
                pango_font_description_set_weight
                        (bold_style->font_desc, PANGO_WEIGHT_BOLD);
                bold_style = gtk_style_copy(gtk_widget_get_style(ctree));
                pango_font_description_set_weight
                        (bold_style->font_desc, PANGO_WEIGHT_BOLD);
@@ -1202,13 +1201,25 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
        gboolean add_sub_match_mark;
        gboolean use_bold, use_color;
        gint *col_pos = folderview->col_pos;
        gboolean add_sub_match_mark;
        gboolean use_bold, use_color;
        gint *col_pos = folderview->col_pos;
-
+       SpecialFolderItemType stype;
+       
        item = gtk_ctree_node_get_row_data(ctree, node);
        g_return_if_fail(item != NULL);
 
        mark = (item->marked_msgs != 0);
 
        item = gtk_ctree_node_get_row_data(ctree, node);
        g_return_if_fail(item != NULL);
 
        mark = (item->marked_msgs != 0);
 
-       switch (item->stype) {
+       stype = item->stype;
+       if (stype == F_NORMAL) {
+               if (folder_has_parent_of_type(item, F_TRASH))
+                       stype = F_TRASH;
+               else if (folder_has_parent_of_type(item, F_DRAFT))
+                       stype = F_DRAFT;
+               else if (folder_has_parent_of_type(item, F_OUTBOX))
+                       stype = F_OUTBOX;
+               else if (folder_has_parent_of_type(item, F_QUEUE))
+                       stype = F_QUEUE;
+       }
+       switch (stype) {
        case F_INBOX:
                if (item->hide_read_msgs) {
                        xpm = mark?m_inboxhrmxpm:inboxhrmxpm;
        case F_INBOX:
                if (item->hide_read_msgs) {
                        xpm = mark?m_inboxhrmxpm:inboxhrmxpm;
@@ -1673,11 +1684,13 @@ static gboolean folderview_button_pressed(GtkWidget *ctree, GdkEventButton *even
        if (NULL != (ac = account_find_from_item(item)))
                special_trash = account_get_special_folder(ac, F_TRASH);
 
        if (NULL != (ac = account_find_from_item(item)))
                special_trash = account_get_special_folder(ac, F_TRASH);
 
-       if ((item == folder->trash || item == special_trash) &&
+       if ((item == folder->trash || item == special_trash
+            || folder_has_parent_of_type(item, F_TRASH)) &&
            gtk_item_factory_get_item(fpopup_factory, "/Empty trash...") == NULL) {
                gtk_item_factory_create_item(fpopup_factory, &folder_view_trash_popup_entries[0], folderview, 1);
                gtk_item_factory_create_item(fpopup_factory, &folder_view_trash_popup_entries[1], folderview, 1);
            gtk_item_factory_get_item(fpopup_factory, "/Empty trash...") == NULL) {
                gtk_item_factory_create_item(fpopup_factory, &folder_view_trash_popup_entries[0], folderview, 1);
                gtk_item_factory_create_item(fpopup_factory, &folder_view_trash_popup_entries[1], folderview, 1);
-       } else if (item != folder->trash && (special_trash == NULL || item != special_trash)) {
+       } else if (item != folder->trash && (special_trash == NULL || item != special_trash)
+               && !folder_has_parent_of_type(item, F_TRASH)) {
                gtk_item_factory_delete_entry(fpopup_factory, &folder_view_trash_popup_entries[0]);
                gtk_item_factory_delete_entry(fpopup_factory, &folder_view_trash_popup_entries[1]);
        }
                gtk_item_factory_delete_entry(fpopup_factory, &folder_view_trash_popup_entries[0]);
                gtk_item_factory_delete_entry(fpopup_factory, &folder_view_trash_popup_entries[1]);
        }
@@ -1690,7 +1703,8 @@ static gboolean folderview_button_pressed(GtkWidget *ctree, GdkEventButton *even
                 folderview->selected == folderview->opened);
        SET_SENS("/Properties...", item->node->parent != NULL);
        SET_SENS("/Processing...", item->node->parent != NULL);
                 folderview->selected == folderview->opened);
        SET_SENS("/Properties...", item->node->parent != NULL);
        SET_SENS("/Processing...", item->node->parent != NULL);
-       if (item == folder->trash || item == special_trash) {
+       if (item == folder->trash || item == special_trash
+           || folder_has_parent_of_type(item, F_TRASH)) {
                GSList *msglist = folder_item_get_msg_list(item);
                SET_SENS("/Empty trash...", msglist != NULL);
                procmsg_msg_list_free(msglist);
                GSList *msglist = folder_item_get_msg_list(item);
                SET_SENS("/Empty trash...", msglist != NULL);
                procmsg_msg_list_free(msglist);
@@ -1927,6 +1941,7 @@ void folderview_create_folder_node(FolderView *folderview, FolderItem *item)
        gchar *text[N_FOLDER_COLS] = {NULL, "0", "0", "0"};
        GtkCTreeNode *node, *parent_node;
        gint *col_pos = folderview->col_pos;
        gchar *text[N_FOLDER_COLS] = {NULL, "0", "0", "0"};
        GtkCTreeNode *node, *parent_node;
        gint *col_pos = folderview->col_pos;
+       FolderItemUpdateData hookdata;
 
        parent_node = gtk_ctree_find_by_row_data(ctree, NULL, folder_item_parent(item));
        if (parent_node == NULL)
 
        parent_node = gtk_ctree_find_by_row_data(ctree, NULL, folder_item_parent(item));
        if (parent_node == NULL)
@@ -1946,6 +1961,11 @@ void folderview_create_folder_node(FolderView *folderview, FolderItem *item)
                gtk_ctree_node_set_row_style(ctree, node, normal_style);
        folderview_sort_folders(folderview, parent_node, item->folder);
 
                gtk_ctree_node_set_row_style(ctree, node, normal_style);
        folderview_sort_folders(folderview, parent_node, item->folder);
 
+       hookdata.item = item;
+       hookdata.update_flags = F_ITEM_UPDATE_NAME;
+       hookdata.msg = NULL;
+       hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &hookdata);
+
        gtk_clist_thaw(GTK_CLIST(ctree));
 }
 
        gtk_clist_thaw(GTK_CLIST(ctree));
 }
 
@@ -1967,7 +1987,8 @@ static void folderview_empty_trash_cb(FolderView *folderview, guint action,
        if (NULL != (ac = account_find_from_item(item)))
                special_trash = account_get_special_folder(ac, F_TRASH);
 
        if (NULL != (ac = account_find_from_item(item)))
                special_trash = account_get_special_folder(ac, F_TRASH);
 
-       if (item != item->folder->trash && item != special_trash) return;
+       if (item != item->folder->trash && item != special_trash
+       &&  !folder_has_parent_of_type(item, F_TRASH)) return;
        
        if (prefs_common.ask_on_clean) {
                if (alertpanel(_("Empty trash"),
        
        if (prefs_common.ask_on_clean) {
                if (alertpanel(_("Empty trash"),
index 06c5981a2107e0144cc64b5f345a5c909e03d845..0613dc723a3e57084bcfae3701766b8c18ce38d2 100644 (file)
@@ -784,12 +784,8 @@ static GtkItemFactoryEntry mainwin_entries[] =
 
        {N_("/_Help"),                          NULL, NULL, 0, "<Branch>"},
        {N_("/_Help/_Manual (Local)"),          NULL, manual_open_cb, MANUAL_MANUAL_LOCAL, NULL},
 
        {N_("/_Help"),                          NULL, NULL, 0, "<Branch>"},
        {N_("/_Help/_Manual (Local)"),          NULL, manual_open_cb, MANUAL_MANUAL_LOCAL, NULL},
-       {N_("/_Help/Ma_nual (Sylpheed Doc Homepage)"),
-                                               NULL, manual_open_cb, MANUAL_MANUAL_SYLDOC, NULL},
        {N_("/_Help/_FAQ (Local)"),             NULL, manual_open_cb, MANUAL_FAQ_LOCAL, NULL},
        {N_("/_Help/_FAQ (Local)"),             NULL, manual_open_cb, MANUAL_FAQ_LOCAL, NULL},
-       {N_("/_Help/FA_Q (Sylpheed Doc Homepage)"),
-                                               NULL, manual_open_cb, MANUAL_FAQ_SYLDOC, NULL},
-       {N_("/_Help/_Claws FAQ (Claws Documentation)"),
+       {N_("/_Help/_User-contributed FAQ (Online)"),   
                                                NULL, manual_open_cb, MANUAL_FAQ_CLAWS, NULL},
        {N_("/_Help/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_Help/_About"),                   NULL, about_show, 0, NULL}
                                                NULL, manual_open_cb, MANUAL_FAQ_CLAWS, NULL},
        {N_("/_Help/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_Help/_About"),                   NULL, about_show, 0, NULL}
@@ -1651,21 +1647,6 @@ void main_window_progress_set(MainWindow *mainwin, gint cur, gint total)
 
 void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
 {
 
 void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
 {
-       GList *list;
-       guint has_trash;
-       Folder *folder;
-
-       for (has_trash = 0, list = folder_get_list(); list != NULL; list = list->next) {
-               folder = FOLDER(list->data);
-               if (folder && folder->trash && folder->trash->total_msgs > 0)
-                       has_trash++;
-               if (folder->account && folder->account->set_trash_folder && 
-                   folder_find_item_from_identifier(folder->account->trash_folder))
-                       has_trash++;
-       }
-
-       if (!has_trash) return;
-       
        if (confirm) {
                if (alertpanel(_("Empty trash"),
                               _("Delete all messages in trash folders?"),
        if (confirm) {
                if (alertpanel(_("Empty trash"),
                               _("Delete all messages in trash folders?"),
index 379e9782fb5c22697926d828369efc2f9aa252d0..c1de1cc44050408235279bf3753f2a7c459650b2 100644 (file)
@@ -648,6 +648,13 @@ void procmsg_get_filter_keyword(MsgInfo *msginfo, gchar **header, gchar **key,
 
 void procmsg_empty_trash(FolderItem *trash)
 {
 
 void procmsg_empty_trash(FolderItem *trash)
 {
+       GNode *node, *next;
+
+       if (!trash || 
+           (trash->stype != F_TRASH && 
+            !folder_has_parent_of_type(trash, F_TRASH)))
+               return;
+
        if (trash && trash->total_msgs > 0) {
                GSList *mlist = folder_item_get_msg_list(trash);
                GSList *cur;
        if (trash && trash->total_msgs > 0) {
                GSList *mlist = folder_item_get_msg_list(trash);
                GSList *cur;
@@ -664,6 +671,16 @@ void procmsg_empty_trash(FolderItem *trash)
                g_slist_free(mlist);
                folder_item_remove_all_msg(trash);
        }
                g_slist_free(mlist);
                folder_item_remove_all_msg(trash);
        }
+
+       if (!trash->node || !trash->node->children)
+               return;
+
+       node = trash->node->children;
+       while (node != NULL) {
+               next = node->next;
+               procmsg_empty_trash(FOLDER_ITEM(node->data));
+               node = next;
+       }
 }
 
 void procmsg_empty_all_trash(void)
 }
 
 void procmsg_empty_all_trash(void)
@@ -748,9 +765,10 @@ parse_again:
        cur = orig;
        while (cur) {
                gchar *file = NULL;
        cur = orig;
        while (cur) {
                gchar *file = NULL;
-               PrefsAccount *ac = procmsg_get_account_from_file(file);
+               PrefsAccount *ac = NULL;
                msg = (MsgInfo *)cur->data;
                file = folder_item_fetch_msg(queue, msg->msgnum);
                msg = (MsgInfo *)cur->data;
                file = folder_item_fetch_msg(queue, msg->msgnum);
+               ac = procmsg_get_account_from_file(file);
                g_free(file);
 
                if (last_account == NULL || (ac != NULL && ac == last_account)) {
                g_free(file);
 
                if (last_account == NULL || (ac != NULL && ac == last_account)) {
@@ -823,6 +841,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
        gint sent = 0, err = 0;
        GSList *list, *elem;
        GSList *sorted_list = NULL;
        gint sent = 0, err = 0;
        GSList *list, *elem;
        GSList *sorted_list = NULL;
+       GNode *node, *next;
 
        if (!queue)
                queue = folder_get_default_queue();
 
        if (!queue)
                queue = folder_get_default_queue();
@@ -871,6 +890,21 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
        }
 
        g_slist_free(sorted_list);
        }
 
        g_slist_free(sorted_list);
+       folder_item_scan(queue);
+
+       if (queue->node && queue->node->children) {
+               node = queue->node->children;
+               while (node != NULL) {
+                       int res = 0;
+                       next = node->next;
+                       res = procmsg_send_queue(FOLDER_ITEM(node->data), save_msgs);
+                       if (res < 0) 
+                               err = -res;
+                       else
+                               sent += res;
+                       node = next;
+               }
+       }
 
        return (err != 0 ? -err : sent);
 }
 
        return (err != 0 ? -err : sent);
 }
@@ -894,6 +928,19 @@ gboolean procmsg_queue_is_empty(FolderItem *queue)
        list = folder_item_get_msg_list(queue);
        res = (list == NULL);
        procmsg_msg_list_free(list);
        list = folder_item_get_msg_list(queue);
        res = (list == NULL);
        procmsg_msg_list_free(list);
+
+       if (res == TRUE) {
+               GNode *node, *next;
+               if (queue->node && queue->node->children) {
+                       node = queue->node->children;
+                       while (node != NULL) {
+                               next = node->next;
+                               if (!procmsg_queue_is_empty(FOLDER_ITEM(node->data)))
+                                       return FALSE;
+                               node = next;
+                       }
+               }
+       }
        return res;
 }
 
        return res;
 }
 
index 04b85eda9e3f3b670f58543db678d968fba43f78..c07e79cbb1d29b30299c7857fbfca2621ddbb3a1 100644 (file)
@@ -1336,7 +1336,6 @@ void summary_select_prev_unread(SummaryView *summaryview)
 void summary_select_next_unread(SummaryView *summaryview)
 {
        GtkCTreeNode *node = summaryview->selected;
 void summary_select_next_unread(SummaryView *summaryview)
 {
        GtkCTreeNode *node = summaryview->selected;
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        gboolean skip_cur = FALSE;
        
        if (summaryview->displayed 
        gboolean skip_cur = FALSE;
        
        if (summaryview->displayed 
@@ -1436,7 +1435,6 @@ void summary_select_prev_new(SummaryView *summaryview)
 void summary_select_next_new(SummaryView *summaryview)
 {
        GtkCTreeNode *node = summaryview->selected;
 void summary_select_next_new(SummaryView *summaryview)
 {
        GtkCTreeNode *node = summaryview->selected;
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        gboolean skip_cur = FALSE;
        
        if (summaryview->displayed 
        gboolean skip_cur = FALSE;
        
        if (summaryview->displayed 
@@ -3224,7 +3222,8 @@ void summary_delete_trash(SummaryView *summaryview)
        if (to_folder == NULL)
                to_folder = summaryview->folder_item->folder->trash;
        
        if (to_folder == NULL)
                to_folder = summaryview->folder_item->folder->trash;
        
-       if (to_folder == NULL || to_folder == summaryview->folder_item)
+       if (to_folder == NULL || to_folder == summaryview->folder_item
+           || folder_has_parent_of_type(summaryview->folder_item, F_TRASH))
                summary_delete(summaryview);
        else
                summary_move_selected_to(summaryview, to_folder);
                summary_delete(summaryview);
        else
                summary_move_selected_to(summaryview, to_folder);
index 932b90f2f9a963f5cfa64c9bf4147d5521d1854a..379a7dccbb1cd1b00fa8abedcf999943fe230770 100644 (file)
@@ -1996,7 +1996,6 @@ void send_queue_cb(gpointer data, guint action, GtkWidget *widget)
                                               prefs_common.savemsg) < 0)
                                alertpanel_error(_("Some errors occurred while "
                                                   "sending queued messages."));
                                               prefs_common.savemsg) < 0)
                                alertpanel_error(_("Some errors occurred while "
                                                   "sending queued messages."));
-                       folder_item_scan(folder->queue);
                }
        }
 }
                }
        }
 }