sync with sylpheed 0.7.2cvs24
authorPaul Mangan <paul@claws-mail.org>
Sun, 3 Mar 2002 09:32:58 +0000 (09:32 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 3 Mar 2002 09:32:58 +0000 (09:32 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/folderview.c
src/messageview.c
src/mimeview.c
src/prefs_filter.c
src/summaryview.c
src/textview.c

index 8dfa8ba0a58e4aede0ae1756c8a2db5689d70f37..9335f459f2e07c49c84371c7a604a55caa1c72cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2002-03-03
+
+       * src/mimeview.c: mimeview_create(): set the initial notebook page
+         to 0.
+       * src/folderview.c: folderview_selected(): scroll the view if the
+         selected row is hidden.
+       * src/prefs_filter.c: prefs_filter_register_cb(): scroll the view
+         and select the added row.
+       * src/summaryview.c: fix threading for null message ids.
+
+2002-03-02
+
+       * src/textview.c: textview_show_message(): follow message/rfc822
+         parts.
+         textview_add_part(): add a caption before the attached text files.
+         textview_show_header(): don't add the newline.
+       * src/messageview.c: enabled message search also in MIME mode.
+
 2002-03-01
 
        * src/messageview.c: messageview_show(): set header state of
index b50bcc2833c33a133cd8b9dccf2028d8f8c48454..89a6c347526883f75efe394d7e362981feb4157c 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-03 [paul]      0.7.2claws27
+
+       * sync with sylpheed 0.7.2cvs24
+               see ChangeLog entries 2002-03-02 and 2002-03-03
+
 2002-03-02 [melvin]    0.7.2claws26
 
        * src/inc.[ch]
index dff6f083c1902ae102ed70dc1b15df268d6f0371..5f88d3b9ea51f9b48c0fbd0a1515fe1f9d9eaa04 100644 (file)
@@ -1,3 +1,22 @@
+2002-03-03
+
+       * src/mimeview.c: mimeview_create(): ºÇ½é¤Î¥Î¡¼¥È¥Ö¥Ã¥¯¥Ú¡¼¥¸¤ò 0
+         ¤Ë¤·¤¿¡£
+       * src/folderview.c: folderview_selected(): ÁªÂò¹Ô¤¬±£¤ì¤Æ¤¤¤¿¤é
+         ¥Ó¥å¡¼¤ò¥¹¥¯¥í¡¼¥ë¤µ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/prefs_filter.c: prefs_filter_register_cb(): ¥Ó¥å¡¼¤ò¥¹¥¯¥í¡¼¥ë
+         ¤µ¤»¡¢Äɲ䵤줿¹Ô¤òÁªÂò¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/summaryview.c: ¶õ¤Î¥á¥Ã¥»¡¼¥¸ ID ¤Î¥¹¥ì¥Ã¥É²½¤ò½¤Àµ¡£
+
+2002-03-02
+
+       * src/textview.c: textview_show_message(): message/rfc822 ¤Î¥Ñ¡¼¥È¤ò
+         Ã©¤ë¤è¤¦¤Ë¤·¤¿¡£
+         textview_add_part(): ÅºÉեƥ­¥¹¥È¥Õ¥¡¥¤¥ë¤ÎÁ°¤Ë¸«½Ð¤·¤òÉÕ¤±¤ë¤è¤¦
+         ¤Ë¤·¤¿¡£
+         textview_show_header(): ²þ¹Ô¤òÉղ䷤ʤ¤¤è¤¦¤Ë¤·¤¿¡£
+       * src/messageview.c: MIME ¥â¡¼¥É¤Ç¤â¥á¥Ã¥»¡¼¥¸¸¡º÷¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2002-03-01
 
        * src/messageview.c: messageview_show(): MimeView ¤Î TextView ¤Î
index ee540a25bdbf9b81beb4a43cf3b1928fe5b1ba0a..f845a2c59b2ba5333e16ba514bc4ce7295f833b8 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws26
+EXTRA_VERSION=claws27
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index bce084cf36e2ce5d715a5d95cb24b687348b27e5..7b73f45bc9d7418f01167a24b7f5a57fccbe63e0 100644 (file)
@@ -1605,8 +1605,12 @@ static void folderview_selected(GtkCTree *ctree, GtkCTreeNode *row,
        if (!opened) {
                gtkut_ctree_set_focus_row(ctree, folderview->opened);
                gtk_ctree_select(ctree, folderview->opened);
-       } else
+       } else {
                folderview->opened = row;
+               if (gtk_ctree_node_is_visible(ctree, row)
+                   != GTK_VISIBILITY_FULL)
+                       gtk_ctree_node_moveto(ctree, row, -1, 0.5, 0);
+       }
 
        folderview->open_folder = FALSE;
        can_select = TRUE;
index 9e798f0b8d743c82e42322a1c5c7c76c65dd7b31..9d2da805e347dc201cabeea97af9a1bc980438b4 100644 (file)
@@ -528,36 +528,13 @@ void messageview_select_all(MessageView *messageview)
 
 void messageview_set_position(MessageView *messageview, gint pos)
 {
-       switch (messageview->type) {
-       case MVIEW_TEXT:
-               textview_set_position(messageview->textview, pos);
-               break;
-       case MVIEW_MIME:
-               if (messageview->mimeview->type == MIMEVIEW_TEXT)
-                       textview_set_position(messageview->mimeview->textview, pos);
-               break;
-       default:
-               break;
-       }
+       textview_set_position(messageview->textview, pos);
 }
 
 gboolean messageview_search_string(MessageView *messageview, const gchar *str,
                                   gboolean case_sens)
 {
-       switch (messageview->type) {
-       case MVIEW_TEXT:
-               return textview_search_string(messageview->textview,
-                                       str, case_sens);
-       case MVIEW_MIME:
-               if (messageview->mimeview->type == MIMEVIEW_TEXT)
-                       return textview_search_string(messageview->mimeview->textview,
-                                               str, case_sens);
-               else
-                       return FALSE;
-       default:
-               return FALSE;
-       }
-               
+       return textview_search_string(messageview->textview, str, case_sens);
        return FALSE;
 }
 
@@ -565,22 +542,9 @@ gboolean messageview_search_string_backward(MessageView *messageview,
                                            const gchar *str,
                                            gboolean case_sens)
 {
-       switch (messageview->type) {
-       case MVIEW_TEXT:
-               return textview_search_string_backward(messageview->textview,
-                                       str, case_sens);
-       case MVIEW_MIME:
-               if (messageview->mimeview->type == MIMEVIEW_TEXT)
-                       return textview_search_string_backward(messageview->mimeview->textview,
-                                               str, case_sens);
-               else
-                       return FALSE;
-       default:
-               return FALSE;
-       }
-               
+       return textview_search_string_backward(messageview->textview,
+                                              str, case_sens);
        return FALSE;
-
 }
 
 GtkWidget *messageview_get_text_widget(MessageView *messageview)
index de2c7bd09e34eb3815e97f511e31612f235f32e3..969e211b0fe907de0f58e0eea662ce49a724bca9 100644 (file)
@@ -198,6 +198,8 @@ MimeView *mimeview_create(void)
 
        gtk_widget_show_all(notebook);
 
+       gtk_notebook_set_page(GTK_NOTEBOOK(notebook), 0);
+
        n_entries = sizeof(mimeview_popup_entries) /
                sizeof(mimeview_popup_entries[0]);
        popupmenu = menu_create_items(mimeview_popup_entries, n_entries,
index b57e7e8da2e2a90a1e1ce3724e4ed215cce251b2..7d36ca2a71cc69e8b29ee7d3a2a87a4c4bfbd1ed 100644 (file)
@@ -766,7 +766,14 @@ static void prefs_filter_select_dest_cb(void)
 
 static void prefs_filter_register_cb(void)
 {
-       prefs_filter_clist_set_row(-1);
+       GtkCList *clist = GTK_CLIST(filter.cond_clist);
+       gint row;
+
+       row = prefs_filter_clist_set_row(-1);
+       if (gtk_clist_row_is_visible(clist, row) != GTK_VISIBILITY_FULL)
+               gtk_clist_moveto(clist, row, -1, 0.5, 0);
+       gtk_clist_select_row(clist, row, -1);
+       gtkut_clist_set_focus_row(clist, row);
 }
 
 static void prefs_filter_substitute_cb(void)
index 99cd0155b62a129cebfb22fd976707db41dc6dff..2513894e218289bee2694e16fefc3998a638a87e 100644 (file)
@@ -1954,7 +1954,7 @@ gboolean summary_insert_gnode_func(GtkCTree *ctree, guint depth, GNode *gnode,
        GTKUT_CTREE_NODE_SET_ROW_DATA(cnode, msginfo);
        summary_set_marks_func(ctree, cnode, summaryview);
 
-       if (msgid && msgid[0] != 0)
+       if (msgid && msgid[0] != '\0')
                g_hash_table_insert(msgid_table, (gchar *)msgid, cnode);
 
        return TRUE;
@@ -2033,7 +2033,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                        GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
                        summary_set_marks_func(ctree, node, summaryview);
 
-                       if (msginfo->msgid && msginfo->msgid[0] != 0)
+                       if (msginfo->msgid && msginfo->msgid[0] != '\0')
                                g_hash_table_insert(msgid_table,
                                                    msginfo->msgid, node);
 
index d2921686a65dd38790c732fc53ebe2e41054a99e..8695f2d2b96e134c4db6e68009fcfbc1b5d215d9 100644 (file)
@@ -293,6 +293,7 @@ void textview_update_message_colors(void)
 void textview_show_message(TextView *textview, MimeInfo *mimeinfo,
                           const gchar *file)
 {
+       GtkSText *text = GTK_STEXT(textview->text);
        FILE *fp;
        const gchar *charset = NULL;
        GPtrArray *headers = NULL;
@@ -311,11 +312,14 @@ void textview_show_message(TextView *textview, MimeInfo *mimeinfo,
        textview->body_pos = 0;
        textview->cur_pos  = 0;
 
+       gtk_stext_freeze(text);
+
        if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0) perror("fseek");
        headers = textview_scan_header(textview, fp);
        if (headers) {
                textview_show_header(textview, headers);
                procheader_header_array_destroy(headers);
+               textview->body_pos = gtk_stext_get_length(text);
        }
 
        while (mimeinfo != NULL) {
@@ -324,18 +328,18 @@ void textview_show_message(TextView *textview, MimeInfo *mimeinfo,
                    !strcasecmp(mimeinfo->parent->content_type,
                                "multipart/alternative"))
                        mimeinfo = mimeinfo->parent->next;
-               else if (mimeinfo->sub)
-                       mimeinfo = mimeinfo->next;
                else
                        mimeinfo = procmime_mimeinfo_next(mimeinfo);
        }
 
+       gtk_stext_thaw(text);
+
        fclose(fp);
 }
 
 void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
 {
-       GtkSText *text;
+       GtkSText *text = GTK_STEXT(textview->text);
        gchar buf[BUFFSIZE];
        const gchar *boundary = NULL;
        gint boundary_len = 0;
@@ -346,16 +350,8 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
        g_return_if_fail(mimeinfo != NULL);
        g_return_if_fail(fp != NULL);
 
-       if (mimeinfo->mime_type == MIME_MULTIPART) {
-               if (mimeinfo->sub) {
-                       mimeinfo = mimeinfo->sub;
-                       if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0) {
-                               perror("fseek");
-                               return;
-                       }
-               } else
-                       return;
-       }
+       if (mimeinfo->mime_type == MIME_MULTIPART) return;
+
        if (mimeinfo->parent && mimeinfo->parent->boundary) {
                boundary = mimeinfo->parent->boundary;
                boundary_len = strlen(boundary);
@@ -417,7 +413,6 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
        textview_set_font(textview, charset);
 
        textview_clear(textview);
-       text = GTK_STEXT(textview->text);
        gtk_stext_freeze(text);
 
        textview->body_pos = 0;
@@ -425,7 +420,9 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
 
        if (headers) {
                textview_show_header(textview, headers);
+               gtk_stext_insert(text, NULL, NULL, NULL, "\n", 1);
                procheader_header_array_destroy(headers);
+               textview->body_pos = gtk_stext_get_length(text);
        }
 
        conv = conv_code_converter_new(charset);
@@ -437,7 +434,7 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
 
 static void textview_add_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
 {
-       GtkSText *text;
+       GtkSText *text = GTK_STEXT(textview->text);
        gchar buf[BUFFSIZE];
        const gchar *boundary = NULL;
        gint boundary_len = 0;
@@ -448,21 +445,13 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
        g_return_if_fail(mimeinfo != NULL);
        g_return_if_fail(fp != NULL);
 
+       if (mimeinfo->mime_type == MIME_MULTIPART) return;
+
        if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0) {
                perror("fseek");
                return;
        }
 
-       if (mimeinfo->mime_type == MIME_MULTIPART) {
-               if (mimeinfo->sub) {
-                       mimeinfo = mimeinfo->sub;
-                       if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0) {
-                               perror("fseek");
-                               return;
-                       }
-               } else
-                       return;
-       }
        if (mimeinfo->parent && mimeinfo->parent->boundary) {
                boundary = mimeinfo->parent->boundary;
                boundary_len = strlen(boundary);
@@ -471,45 +460,42 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
        while (fgets(buf, sizeof(buf), fp) != NULL)
                if (buf[0] == '\r' || buf[0] == '\n') break;
 
-       /* display attached RFC822 single text message */
-       if (mimeinfo->parent && mimeinfo->mime_type == MIME_MESSAGE_RFC822) {
-               if (headers) procheader_header_array_destroy(headers);
-               if (!mimeinfo->sub || mimeinfo->sub->children) return;
-               headers = textview_scan_header(textview, fp);
-               mimeinfo = mimeinfo->sub;
-       } else if (!mimeinfo->parent &&
-                  mimeinfo->mime_type == MIME_MESSAGE_RFC822) {
-               if (headers) procheader_header_array_destroy(headers);
-               if (!mimeinfo->sub) return;
+       if (mimeinfo->mime_type == MIME_MESSAGE_RFC822) {
                headers = textview_scan_header(textview, fp);
-               mimeinfo = mimeinfo->sub;
+               if (headers) {
+                       gtk_stext_insert(text, NULL, NULL, NULL, "\n", 1);
+                       textview_show_header(textview, headers);
+                       procheader_header_array_destroy(headers);
+               }
+               return;
        }
 
-       if (prefs_common.force_charset)
-               charset = prefs_common.force_charset;
-       else if (mimeinfo->charset)
-               charset = mimeinfo->charset;
-
-       text = GTK_STEXT(textview->text);
        gtk_stext_freeze(text);
 
-       if (headers) {
-               textview_show_header(textview, headers);
-               procheader_header_array_destroy(headers);
-       }
+       if (mimeinfo->filename || mimeinfo->name)
+               g_snprintf(buf, sizeof(buf), "\n[%s  %s (%d bytes)]\n",
+                          mimeinfo->filename ? mimeinfo->filename :
+                          mimeinfo->name,
+                          mimeinfo->content_type, mimeinfo->size);
+       else
+               g_snprintf(buf, sizeof(buf), "\n[%s (%d bytes)]\n",
+                          mimeinfo->content_type, mimeinfo->size);
 
        if (mimeinfo->mime_type != MIME_TEXT &&
            mimeinfo->mime_type != MIME_TEXT_HTML &&
            mimeinfo->mime_type != MIME_TEXT_ENRICHED) {
-               if (mimeinfo->filename)
-                       g_snprintf(buf, sizeof(buf), "\n[%s  %s (%d bytes)]\n",
-                                  mimeinfo->content_type, mimeinfo->filename,
-                                  mimeinfo->size);
-               else
-                       g_snprintf(buf, sizeof(buf), "\n[%s (%d bytes)]\n",
-                                  mimeinfo->content_type, mimeinfo->size);
                gtk_stext_insert(text, NULL, NULL, NULL, buf, -1);
        } else {
+               if (!mimeinfo->main &&
+                   mimeinfo->parent &&
+                   mimeinfo->parent->children != mimeinfo)
+                       gtk_stext_insert(text, NULL, NULL, NULL, buf, -1);
+               else
+                       gtk_stext_insert(text, NULL, NULL, NULL, "\n", 1);
+               if (prefs_common.force_charset)
+                       charset = prefs_common.force_charset;
+               else if (mimeinfo->charset)
+                       charset = mimeinfo->charset;
                conv = conv_code_converter_new(charset);
                textview_write_body(textview, mimeinfo, fp, conv);
                conv_code_converter_destroy(conv);
@@ -1319,9 +1305,7 @@ static void textview_show_header(TextView *textview, GPtrArray *headers)
                gtk_stext_insert(text, textview->msgfont, NULL, NULL, "\n", 1);
        }
 
-       gtk_stext_insert(text, textview->msgfont, NULL, NULL, "\n", 1);
        gtk_stext_thaw(text);
-       textview->body_pos = gtk_stext_get_length(text);
 }
 
 gboolean textview_search_string(TextView *textview, const gchar *str,