sync with sylpheed 0.7.2cvs15
authorPaul Mangan <paul@claws-mail.org>
Mon, 25 Feb 2002 09:25:17 +0000 (09:25 +0000)
committerPaul Mangan <paul@claws-mail.org>
Mon, 25 Feb 2002 09:25:17 +0000 (09:25 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/messageview.c
src/messageview.h
src/mimeview.c
src/mimeview.h
src/summaryview.c
src/textview.c
src/textview.h

index 80017ea18d907e5957410b533bd0a5898727eea9..99c52b5c6b1bbfa229f30be8c9347e3022d5bfdc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2002-02-24
+
+       * src/messageview.c
+         src/mimeview.[ch]
+         src/summaryview.c: implemented the new notebook tab interface for
+         MIME message.
+       * src/textview.[ch]: fixed line space related glitches.
+
+2002-02-23
+
+       * src/prefs_filter.c:
+         prefs_filter_rename_path()
+         prefs_filter_delete_path(): fixed a crash when flt->dest was NULL.
+
+2002-02-23
+
+       * src/recv.[ch]: cancel data receiving if RecvUIFunc returns FALSE.
+       * src/pop.c: pop3_retr_recv(): fixed false 'No space' when cancelled
+         while getting data.
+       * src/inc.c: inc_pop3_recv_func(): abort data receiving when
+         cancelled, and fixed potential crash bug.
+       * src/grouplistdialog.c: enabled cancelling of data receiving.
+       * src/news.c: news_get_group_list(): destroy current session if
+         retrieving failed.
+
 2002-02-22
 
        * src/manage_window.[ch]: fixed a bug that caused crash when
index 6955b6fe5be2a04d4b820cb7b533bc9b457e7338..5bd9e80ee2fe3758c48ed03d105b51687c0d43cd 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-25 [paul]      0.7.2claws13
+
+       * sync with sylpheed 0.7.2cvs15
+               see ChangeLog entry 2002-02-24
+
 2002-02-24 [alfons]    0.7.2claws12
 
        * src/filtering.c
index b09add3840ce5add41c00cee98cedb870bbf4b3b..31ee8c487f2da72a8176fc41564c0801a3babd4b 100644 (file)
@@ -1,3 +1,30 @@
+2002-02-24
+
+       * src/messageview.c
+         src/mimeview.[ch]
+         src/summaryview.c: MIME ¥á¥Ã¥»¡¼¥¸¤Î¿·¤·¤¤¥Î¡¼¥È¥Ö¥Ã¥¯¥¿¥Ö¥¤¥ó¥¿
+         ¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¡£
+       * src/textview.[ch]: ¹Ô´Ö¤Ë´Ø¤¹¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¡£
+
+2002-02-23
+
+       * src/prefs_filter.c:
+         prefs_filter_rename_path()
+         prefs_filter_delete_path(): flt->dest ¤¬ NULL ¤Î¤È¤­¤Ë¥¯¥é¥Ã¥·¥å
+         ¤¹¤ë¤Î¤ò½¤Àµ¡£
+
+2002-02-23
+
+       * src/recv.[ch]: RecvUIFunc ¤¬ FALSE ¤òÊÖ¤·¤¿¤é¥Ç¡¼¥¿¼õ¿®¤ò¥­¥ã¥ó¥»¥ë
+         ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/pop.c: pop3_retr_recv(): ¥Ç¡¼¥¿¼õ¿®Ãæ¤Ë¥­¥ã¥ó¥»¥ë¤µ¤ì¤¿¤È¤­
+         ¸í¤Ã¤Æ 'No space' ¤òÊÖ¤¹¤Î¤ò½¤Àµ¡£
+       * src/inc.c: inc_pop3_recv_func(): ¥­¥ã¥ó¥»¥ë¤µ¤ì¤¿¤È¤­¤Ï¥Ç¡¼¥¿¼õ¿®
+         ¤òÃæÃǤ·¡¢ÀøºßŪ¤Ê¥¯¥é¥Ã¥·¥å¥Ð¥°¤ò½¤Àµ¡£
+       * src/grouplistdialog.c: ¥Ç¡¼¥¿¼õ¿®¤Î¥­¥ã¥ó¥»¥ë¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/news.c: news_get_group_list(): ¼õ¿®¤Ë¼ºÇÔ¤·¤¿¤é¸½ºß¤Î
+         ¥»¥Ã¥·¥ç¥ó¤ò destroy ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2002-02-22
 
        * src/manage_window.[ch]: ¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤ò±£¤·¤Æ¤¤¤ë¤È¤­¤Ë
index 3fe167f1563df66ac6644db8439cf82b129dad36..7e0449303d1e027286b9cc9903baa6fe1f18d0a6 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws12
+EXTRA_VERSION=claws13
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 7e9850c88bf4e9439368dbdf6f5efcaec6944e02..bf0b66e9243159dc84a6ba810fe5394c635b3eec 100644 (file)
@@ -83,7 +83,8 @@ MessageView *messageview_create(void)
        imageview->messageview = messageview;
 
        mimeview = mimeview_create();
-       mimeview->textview = textview;
+       mimeview->textview = textview_create();
+       mimeview->textview->messageview = messageview;
        mimeview->imageview = imageview;
        mimeview->messageview = messageview;
 
@@ -97,6 +98,7 @@ MessageView *messageview_create(void)
        gtk_widget_ref(GTK_WIDGET_PTR(textview));
        gtk_widget_ref(GTK_WIDGET_PTR(imageview));
        gtk_widget_ref(GTK_WIDGET_PTR(mimeview));
+       gtk_widget_ref(GTK_WIDGET_PTR(mimeview->textview));
 
        messageview->vbox       = vbox;
        messageview->new_window = FALSE;
@@ -431,7 +433,6 @@ static void messageview_change_view_type(MessageView *messageview,
                                         MessageType type)
 {
        TextView *textview = messageview->textview;
-       ImageView *imageview = messageview->imageview;
        MimeView *mimeview = messageview->mimeview;
 
        if (messageview->type == type) return;
@@ -444,19 +445,14 @@ static void messageview_change_view_type(MessageView *messageview,
                                   GTK_WIDGET_PTR(mimeview), TRUE, TRUE, 0);
                gtk_container_add(GTK_CONTAINER(mimeview->vbox),
                                  GTK_WIDGET_PTR(textview));
-               mimeview->type = MIMEVIEW_TEXT;
        } else if (type == MVIEW_TEXT) {
                gtkut_container_remove
                        (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
                         GTK_WIDGET_PTR(mimeview));
 
-               if (mimeview->vbox == GTK_WIDGET_PTR(textview)->parent) {
+               if (mimeview->vbox == GTK_WIDGET_PTR(textview)->parent)
                        gtkut_container_remove(GTK_CONTAINER(mimeview->vbox),
                                               GTK_WIDGET_PTR(textview));
-               } else {
-                       gtkut_container_remove(GTK_CONTAINER(mimeview->vbox),
-                                              GTK_WIDGET_PTR(imageview));
-               }
 
                gtk_box_pack_start(GTK_BOX(messageview->vbox),
                                   GTK_WIDGET_PTR(textview), TRUE, TRUE, 0);
index 40932f7a050e0268b0ee263fdbea116e19caa4f2..01d8b08dcdcf87328cc7f15e4a36e00d99595b36 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
index 8fc12aeb67ba5ec2a69e8157ff559f5f3c317bf5..019f91958e17d3896c86fd07da30074735d9c1a9 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <glib.h>
 #include <gdk/gdkkeysyms.h>
+#include <gtk/gtknotebook.h>
 #include <gtk/gtkscrolledwindow.h>
 #include <gtk/gtkctree.h>
 #include <gtk/gtkvbox.h>
@@ -130,10 +131,12 @@ MimeView *mimeview_create(void)
 {
        MimeView *mimeview;
 
+       GtkWidget *notebook;
+       GtkWidget *vbox;
        GtkWidget *paned;
        GtkWidget *scrolledwin;
        GtkWidget *ctree;
-       GtkWidget *vbox;
+       GtkWidget *mime_vbox;
        GtkWidget *popupmenu;
        GtkItemFactory *popupfactory;
        gchar *titles[N_MIMEVIEW_COLS];
@@ -147,6 +150,14 @@ MimeView *mimeview_create(void)
        titles[COL_SIZE]     = _("Size");
        titles[COL_NAME]     = _("Name");
 
+       notebook = gtk_notebook_new();
+       gtk_notebook_set_scrollable(GTK_NOTEBOOK(notebook), TRUE);
+
+       vbox = gtk_vbox_new(FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(notebook), vbox);
+       gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(notebook), vbox,
+                                       _("Text"));
+
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
                                       GTK_POLICY_AUTOMATIC,
@@ -176,24 +187,31 @@ MimeView *mimeview_create(void)
        gtk_signal_connect(GTK_OBJECT(ctree), "drag_data_get",
                           GTK_SIGNAL_FUNC(mimeview_drag_data_get), mimeview);
     
-       vbox = gtk_vbox_new(FALSE, 0);
+       mime_vbox = gtk_vbox_new(FALSE, 0);
 
        paned = gtk_vpaned_new();
        gtk_paned_add1(GTK_PANED(paned), scrolledwin);
-       gtk_paned_add2(GTK_PANED(paned), vbox);
-       gtk_widget_show_all(paned);
+       gtk_paned_add2(GTK_PANED(paned), mime_vbox);
+       gtk_container_add(GTK_CONTAINER(notebook), paned);
+       gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(notebook), paned,
+                                       _("Attachments"));
+
+       gtk_widget_show_all(notebook);
 
        n_entries = sizeof(mimeview_popup_entries) /
                sizeof(mimeview_popup_entries[0]);
        popupmenu = menu_create_items(mimeview_popup_entries, n_entries,
                                      "<MimeView>", &popupfactory, mimeview);
 
-       mimeview->paned       = paned;
-       mimeview->scrolledwin = scrolledwin;
-       mimeview->ctree       = ctree;
-       mimeview->vbox        = vbox;
-       mimeview->popupmenu   = popupmenu;
+       mimeview->notebook     = notebook;
+       mimeview->vbox         = vbox;
+       mimeview->paned        = paned;
+       mimeview->scrolledwin  = scrolledwin;
+       mimeview->ctree        = ctree;
+       mimeview->mime_vbox    = mime_vbox;
+       mimeview->popupmenu    = popupmenu;
        mimeview->popupfactory = popupfactory;
+       mimeview->type         = -1;
 
        return mimeview;
 }
@@ -263,6 +281,7 @@ void mimeview_show_message(MimeView *mimeview, MimeInfo *mimeinfo,
        FILE *fp;
 
        mimeview_clear(mimeview);
+       textview_clear(mimeview->messageview->textview);
 
        g_return_if_fail(file != NULL);
        g_return_if_fail(mimeinfo != NULL);
@@ -278,7 +297,7 @@ void mimeview_show_message(MimeView *mimeview, MimeInfo *mimeinfo,
        /* skip MIME part headers */
        if (mimeinfo->mime_type == MIME_MULTIPART) {
                if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0)
-               perror("fseek");
+                       perror("fseek");
                while (fgets(buf, sizeof(buf), fp) != NULL)
                        if (buf[0] == '\r' || buf[0] == '\n') break;
        }
@@ -290,7 +309,6 @@ void mimeview_show_message(MimeView *mimeview, MimeInfo *mimeinfo,
        else
                set_unchecked_signature(mimeinfo);
 #endif
-       fclose(fp);
 
        gtk_signal_handler_block_by_func(GTK_OBJECT(ctree), mimeview_selected,
                                         mimeview);
@@ -308,9 +326,18 @@ void mimeview_show_message(MimeView *mimeview, MimeInfo *mimeinfo,
                partinfo = gtk_ctree_node_get_row_data(ctree, node);
                if (partinfo &&
                    (partinfo->mime_type == MIME_TEXT ||
-                    partinfo->mime_type == MIME_TEXT_HTML))
+                    partinfo->mime_type == MIME_TEXT_HTML)) {
+                       if (fseek(fp, partinfo->fpos, SEEK_SET) < 0)
+                               perror("fseek");
+                       else
+                               textview_show_part
+                                       (mimeview->messageview->textview,
+                                        partinfo, fp);
                        break;
+               }
        }
+       fclose(fp);
+
        if (!node)
                node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
@@ -448,20 +475,24 @@ static void mimeview_change_view_type(MimeView *mimeview, MimeViewType type)
 {
        TextView  *textview  = mimeview->textview;
        ImageView *imageview = mimeview->imageview;
+       GList *children;
 
        if (mimeview->type == type) return;
 
+       children = gtk_container_children(GTK_CONTAINER(mimeview->mime_vbox));
+       if (children) {
+               gtkut_container_remove(GTK_CONTAINER(mimeview->mime_vbox),
+                                      GTK_WIDGET(children->data));
+               g_list_free(children);
+       }
+
        switch (type) {
        case MIMEVIEW_IMAGE:
-               gtkut_container_remove(GTK_CONTAINER(mimeview->vbox),
-                                      GTK_WIDGET_PTR(textview));
-               gtk_container_add(GTK_CONTAINER(mimeview->vbox),
+               gtk_container_add(GTK_CONTAINER(mimeview->mime_vbox),
                                  GTK_WIDGET_PTR(imageview));
                break;
        case MIMEVIEW_TEXT:
-               gtkut_container_remove(GTK_CONTAINER(mimeview->vbox),
-                                      GTK_WIDGET_PTR(imageview));
-               gtk_container_add(GTK_CONTAINER(mimeview->vbox),
+               gtk_container_add(GTK_CONTAINER(mimeview->mime_vbox),
                                  GTK_WIDGET_PTR(textview));
                break;
        default:
@@ -486,6 +517,8 @@ static void mimeview_clear(MimeView *mimeview)
 
        g_free(mimeview->file);
        mimeview->file = NULL;
+
+       /* gtk_notebook_set_page(GTK_NOTEBOOK(mimeview->notebook), 0); */
 }
 
 static void mimeview_selected(GtkCTree *ctree, GtkCTreeNode *node, gint column,
@@ -534,8 +567,8 @@ static void mimeview_selected(GtkCTree *ctree, GtkCTreeNode *node, gint column,
        }
 }
 
-static void mimeview_start_drag (GtkWidget *widget, gint button,
-                                GdkEvent *event, MimeView *mimeview)
+static void mimeview_start_drag(GtkWidget *widget, gint button,
+                               GdkEvent *event, MimeView *mimeview)
 {
        GtkTargetList *list;
        GdkDragContext *context;
index 197ef231de2fe273680c3a32c239ec08f92bd6b0..9d5e0baa2a4cd4df1d6317f5df98cc603c495478 100644 (file)
@@ -40,13 +40,15 @@ typedef enum
 
 struct _MimeView
 {
-       GtkWidget *paned;
-
-       MimeViewType type;
+       GtkWidget *notebook;
+       GtkWidget *vbox;
 
+       GtkWidget *paned;
        GtkWidget *scrolledwin;
        GtkWidget *ctree;
-       GtkWidget *vbox;
+       GtkWidget *mime_vbox;
+
+       MimeViewType type;
 
        GtkWidget *popupmenu;
        GtkItemFactory *popupfactory;
index de3ee9c3801420bafd5fbc01c3e6e2b49f87ecc4..f976f2d7cfadc51ed843d56a28d80885224605ba 100644 (file)
@@ -2329,7 +2329,9 @@ static void summary_display_msg_full(SummaryView *summaryview,
                messageview_show(msgview, msginfo, all_headers);
                if (msgview->type == MVIEW_TEXT ||
                    (msgview->type == MVIEW_MIME &&
-                    GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL))
+                    (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL ||
+                     gtk_notebook_get_current_page
+                       (GTK_NOTEBOOK(msgview->mimeview->notebook)) == 0)))
                        gtk_widget_grab_focus(summaryview->ctree);
                GTK_EVENTS_FLUSH();
                gtkut_ctree_node_move_if_on_the_edge(ctree, row);
index 2990beffd5808e6df173c19ff32e1628ccca4141..7446f35863ae0978c52dcfde65810e2645e07e36 100644 (file)
@@ -99,6 +99,12 @@ static GdkColor error_color = {
        (gushort)0
 };
 
+static GdkFont *text_sb_font;
+static GdkFont *text_mb_font;
+static gint text_sb_font_orig_ascent;
+static gint text_sb_font_orig_descent;
+static gint text_mb_font_orig_ascent;
+static gint text_mb_font_orig_descent;
 static GdkFont *spacingfont;
 
 static void textview_show_ertf         (TextView       *textview,
@@ -227,6 +233,8 @@ TextView *textview_create(void)
        vbox = gtk_vbox_new(FALSE, 0);
        gtk_box_pack_start(GTK_BOX(vbox), scrolledwin_sb, TRUE, TRUE, 0);
 
+       gtk_widget_show(vbox);
+
        textview->vbox             = vbox;
        textview->scrolledwin      = scrolledwin_sb;
        textview->scrolledwin_sb   = scrolledwin_sb;
@@ -946,11 +954,8 @@ void textview_destroy(TextView *textview)
        if (!textview->scrolledwin_mb->parent)
                gtk_widget_destroy(textview->scrolledwin_mb);
 
-       if (textview->msgfont) {
-               textview->msgfont->ascent = textview->prev_ascent;
-               textview->msgfont->descent = textview->prev_descent;
+       if (textview->msgfont)
                gdk_font_unref(textview->msgfont);
-       }
        if (textview->boldfont)
                gdk_font_unref(textview->boldfont);
 
@@ -1007,39 +1012,57 @@ void textview_set_font(TextView *textview, const gchar *codeset)
        }
 
        if (prefs_common.textfont) {
-               if (textview->msgfont) {
-                       textview->msgfont->ascent = textview->prev_ascent;
-                       textview->msgfont->descent = textview->prev_descent;
-                       gdk_font_unref(textview->msgfont);
-                       textview->msgfont = NULL;
-               }
-               if (use_fontset)
-                       textview->msgfont =
-                               gdk_fontset_load(prefs_common.textfont);
-               else {
+               GdkFont *font;
+
+               if (use_fontset) {
+                       if (text_mb_font) {
+                               text_mb_font->ascent = text_mb_font_orig_ascent;
+                               text_mb_font->descent = text_mb_font_orig_descent;
+                       }
+                       font = gdk_fontset_load(prefs_common.textfont);
+                       if (font && text_mb_font != font) {
+                               if (text_mb_font)
+                                       gdk_font_unref(text_mb_font);
+                               text_mb_font = font;
+                               text_mb_font_orig_ascent = font->ascent;
+                               text_mb_font_orig_descent = font->descent;
+                       }
+               } else {
+                       if (text_sb_font) {
+                               text_sb_font->ascent = text_sb_font_orig_ascent;
+                               text_sb_font->descent = text_sb_font_orig_descent;
+                       }
                        if (MB_CUR_MAX > 1) {
-                               FONT_LOAD(textview->msgfont,
-                                         "-*-courier-medium-r-normal--14-*-*-*-*-*-iso8859-1");
+                               FONT_LOAD(font, "-*-courier-medium-r-normal--14-*-*-*-*-*-iso8859-1");
                        } else {
-                               FONT_LOAD(textview->msgfont,
-                                         prefs_common.textfont);
+                               FONT_LOAD(font, prefs_common.textfont);
+                       }
+                       if (font && text_sb_font != font) {
+                               if (text_sb_font)
+                                       gdk_font_unref(text_sb_font);
+                               text_sb_font = font;
+                               text_sb_font_orig_ascent = font->ascent;
+                               text_sb_font_orig_descent = font->descent;
                        }
                }
 
-               if (textview->msgfont) {
+               if (font) {
                        gint ascent, descent;
 
-                       textview->prev_ascent = textview->msgfont->ascent;
-                       textview->prev_descent = textview->msgfont->descent;
                        descent = prefs_common.line_space / 2;
                        ascent  = prefs_common.line_space - descent;
-                       textview->msgfont->ascent  += ascent;
-                       textview->msgfont->descent += descent;
+                       font->ascent  += ascent;
+                       font->descent += descent;
+
+                       if (textview->msgfont)
+                               gdk_font_unref(textview->msgfont);
+                       textview->msgfont = font;
+                       gdk_font_ref(font);
                }
        }
 
-       if (!textview->boldfont)
-               FONT_LOAD(textview->boldfont, BOLD_FONT);
+       if (!textview->boldfont && prefs_common.boldfont)
+               FONT_LOAD(textview->boldfont, prefs_common.boldfont);
        if (!spacingfont)
                spacingfont = gdk_font_load("-*-*-medium-r-normal--6-*");
 }
index 4b43d3ae5652e7979a8a2ecd8581209c3aede4df..49f33bc0ece5fde188ceed91ca27ad3ef79396cf 100644 (file)
@@ -53,8 +53,6 @@ struct _TextView
 
        GdkFont *msgfont;
        GdkFont *boldfont;
-       gint prev_ascent;
-       gint prev_descent;
 
        gboolean show_all_headers;