2005-03-30 [paul] 1.9.6cvs12
authorPaul Mangan <paul@claws-mail.org>
Wed, 30 Mar 2005 12:01:26 +0000 (12:01 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 30 Mar 2005 12:01:26 +0000 (12:01 +0000)
partial sync with main:

* src/action.c
create_io_dialog(): use user-defined text font
(thanks to Alfons), and modified its appearance.
* src/addrgather.c
* src/addrharvest.c
* src/browseldap.c
replace old code
* src/compose.c
don't join (presumably) itemized lines on line-wrapping
fixed wrapping of quote when auto-wrapping is enabled
compose_destroy(): destroy paned only if it's not
attached to window. Fixed memory leak of popup menu.
* src/exphtmldlg.c
* src/expldifdlg.c
replace old code
* src/html.c
* src/html.h
* src/importmutt.c
* src/importpine.c
replace old code
* src/main.c
removed redundant code
* src/mainwindow.c
changed 'Code set' (which is rather incorrect)
in the menu to 'Character encoding'
main_window_set_widgets(): request size first
to prevent window size becoming wrong
fixed remembering of the state of the visibility
of MessageView
* src/messageview.c
changed 'Code set' (which is rather incorrect)
in the menu to 'Character encoding'
* src/prefs_common.c
* src/prefs_common.h
added an option whether to render HTML as text or not
added separators to outgoing encoding menu
* src/procheader.c
procheader_scan_date_string(): support header
like: "[Tue,] 01 Feb 2005 09:57[:00]"
* src/summaryview.c
* src/summaryview.h
minor code cleanup
* src/textview.c
textview_show_html(): force output of newline
added an option whether to render HTML as text or not
* src/common/utils.c
strncpy2(): optimized based on Alfons' code
* src/gtk/gtkutils.c
* src/gtk/gtkutils.h
removed non-used code
* src/plugins/pgpmime/passphrase.c
partially fixed grab input of passphrase dialog
Confine pointer to window

27 files changed:
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/action.c
src/addrgather.c
src/addrharvest.c
src/browseldap.c
src/common/utils.c
src/compose.c
src/exphtmldlg.c
src/expldifdlg.c
src/gtk/gtkutils.c
src/gtk/gtkutils.h
src/html.c
src/html.h
src/importmutt.c
src/importpine.c
src/main.c
src/mainwindow.c
src/messageview.c
src/plugins/pgpmime/passphrase.c
src/prefs_common.c
src/prefs_common.h
src/procheader.c
src/summaryview.c
src/summaryview.h
src/textview.c

index e1c1ff99850b94bd8727b158bdc20c47a5231b36..0b54634712ad22dd5cc37d6fba5bfd30941e7f6b 100644 (file)
@@ -1,3 +1,61 @@
+2005-03-30 [paul]      1.9.6cvs12
+
+       partial sync with main:
+
+       * src/action.c
+               create_io_dialog(): use user-defined text font
+               (thanks to Alfons), and modified its appearance.
+       * src/addrgather.c
+       * src/addrharvest.c
+       * src/browseldap.c
+               replace old code
+       * src/compose.c
+               don't join (presumably) itemized lines on line-wrapping
+               fixed wrapping of quote when auto-wrapping is enabled
+               compose_destroy(): destroy paned only if it's not
+               attached to window. Fixed memory leak of popup menu.
+       * src/exphtmldlg.c
+       * src/expldifdlg.c
+               replace old code
+       * src/html.c
+       * src/html.h
+       * src/importmutt.c
+       * src/importpine.c
+               replace old code
+       * src/main.c
+               removed redundant code
+       * src/mainwindow.c
+               changed 'Code set' (which is rather incorrect)
+               in the menu to 'Character encoding'
+               main_window_set_widgets(): request size first
+               to prevent window size becoming wrong
+               fixed remembering of the state of the visibility
+               of MessageView
+       * src/messageview.c
+               changed 'Code set' (which is rather incorrect)
+               in the menu to 'Character encoding'
+       * src/prefs_common.c
+       * src/prefs_common.h
+               added an option whether to render HTML as text or not
+               added separators to outgoing encoding menu
+       * src/procheader.c
+               procheader_scan_date_string(): support header
+               like: "[Tue,] 01 Feb 2005 09:57[:00]"
+       * src/summaryview.c
+       * src/summaryview.h
+               minor code cleanup
+       * src/textview.c
+               textview_show_html(): force output of newline
+               added an option whether to render HTML as text or not
+       * src/common/utils.c
+               strncpy2(): optimized based on Alfons' code
+       * src/gtk/gtkutils.c
+       * src/gtk/gtkutils.h
+               removed non-used code
+       * src/plugins/pgpmime/passphrase.c
+               partially fixed grab input of passphrase dialog
+               Confine pointer to window
+
 2005-03-30 [colin]     1.9.6cvs11
 
        * src/msgcache.c
 2005-03-30 [colin]     1.9.6cvs11
 
        * src/msgcache.c
index 47960a9fc2063b4386b0198734e9127bb1a538a3..e569fc0a78f5aec05f60a06a71b50ed337dd82db 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.654.2.461 -r 1.654.2.462 configure.ac; cvs diff -u -r 1.53.2.9 -r 1.53.2.10 po/POTFILES.in; cvs diff -u -r 1.155.2.18 -r 1.155.2.19 src/Makefile.am; cvs diff -u -r 1.23.2.8 -r 1.23.2.9 src/crash.c; cvs diff -u -r 0 -r 1 src/image_viewer.c; cvs diff -u -r 0 -r 1 src/image_viewer.h; cvs diff -u -r 1.115.2.29 -r 1.115.2.30 src/main.c; cvs diff -u -r 1.204.2.32 -r 1.204.2.33 src/prefs_common.c; cvs diff -u -r 1.103.2.12 -r 1.103.2.13 src/prefs_common.h; cvs diff -u -r 0 -r 1 src/prefs_image_viewer.c; cvs diff -u -r 0 -r 1 src/prefs_image_viewer.h; cvs diff -u -r 1.96.2.49 -r 1.96.2.50 src/textview.c; cvs diff -u -r 1.4.2.9 -r 1.4.2.10 src/gtk/about.c; cvs diff -u -r 1.1.14.1 -r 1.1.14.2 src/pixmaps/sylpheed_logo.xpm; cvs diff -u -r 1.8.2.1 -r 1.8.2.2 src/plugins/Makefile.am; cvs diff -u -r -1.1 -r -1.2 src/plugins/image_viewer/.cvsignore; cvs diff -u -r -1.4.2.2 -r -1.4.2.3 src/plugins/image_viewer/Makefile.am; cvs diff -u -r -1.8.2.3 -r -1.8.2.4 src/plugins/image_viewer/plugin.c; cvs diff -u -r -1.7.2.10 -r -1.7.2.11 src/plugins/image_viewer/viewer.c; cvs diff -u -r -1.1 -r -1.2 src/plugins/image_viewer/viewer.glade; cvs diff -u -r -1.4 -r -1.5 src/plugins/image_viewer/viewer.h; cvs diff -u -r -1.5.2.5 -r -1.5.2.6 src/plugins/image_viewer/viewerprefs.c; cvs diff -u -r -1.1.4.1 -r -1.1.4.2 src/plugins/image_viewer/viewerprefs.glade; cvs diff -u -r -1.3 -r -1.4 src/plugins/image_viewer/viewerprefs.h; ) > 1.9.6cvs9.patchset
 ( cvs diff -u -r 1.100.2.14 -r 1.100.2.15 AUTHORS; cvs diff -u -r 1.2504.2.55 -r 1.2504.2.56 ChangeLog.claws; cvs diff -u -r 1.382.2.113 -r 1.382.2.114 src/compose.c; cvs diff -u -r 1.9.2.10 -r 1.9.2.11 src/gtk/gtkaspell.c; ) > 1.9.6cvs10.patchset
 ( cvs diff -u -r 1.16.2.14 -r 1.16.2.15 src/msgcache.c; cvs diff -u -r 1.5 -r 1.6 src/msgcache.h; ) > 1.9.6cvs11.patchset
 ( cvs diff -u -r 1.654.2.461 -r 1.654.2.462 configure.ac; cvs diff -u -r 1.53.2.9 -r 1.53.2.10 po/POTFILES.in; cvs diff -u -r 1.155.2.18 -r 1.155.2.19 src/Makefile.am; cvs diff -u -r 1.23.2.8 -r 1.23.2.9 src/crash.c; cvs diff -u -r 0 -r 1 src/image_viewer.c; cvs diff -u -r 0 -r 1 src/image_viewer.h; cvs diff -u -r 1.115.2.29 -r 1.115.2.30 src/main.c; cvs diff -u -r 1.204.2.32 -r 1.204.2.33 src/prefs_common.c; cvs diff -u -r 1.103.2.12 -r 1.103.2.13 src/prefs_common.h; cvs diff -u -r 0 -r 1 src/prefs_image_viewer.c; cvs diff -u -r 0 -r 1 src/prefs_image_viewer.h; cvs diff -u -r 1.96.2.49 -r 1.96.2.50 src/textview.c; cvs diff -u -r 1.4.2.9 -r 1.4.2.10 src/gtk/about.c; cvs diff -u -r 1.1.14.1 -r 1.1.14.2 src/pixmaps/sylpheed_logo.xpm; cvs diff -u -r 1.8.2.1 -r 1.8.2.2 src/plugins/Makefile.am; cvs diff -u -r -1.1 -r -1.2 src/plugins/image_viewer/.cvsignore; cvs diff -u -r -1.4.2.2 -r -1.4.2.3 src/plugins/image_viewer/Makefile.am; cvs diff -u -r -1.8.2.3 -r -1.8.2.4 src/plugins/image_viewer/plugin.c; cvs diff -u -r -1.7.2.10 -r -1.7.2.11 src/plugins/image_viewer/viewer.c; cvs diff -u -r -1.1 -r -1.2 src/plugins/image_viewer/viewer.glade; cvs diff -u -r -1.4 -r -1.5 src/plugins/image_viewer/viewer.h; cvs diff -u -r -1.5.2.5 -r -1.5.2.6 src/plugins/image_viewer/viewerprefs.c; cvs diff -u -r -1.1.4.1 -r -1.1.4.2 src/plugins/image_viewer/viewerprefs.glade; cvs diff -u -r -1.3 -r -1.4 src/plugins/image_viewer/viewerprefs.h; ) > 1.9.6cvs9.patchset
 ( cvs diff -u -r 1.100.2.14 -r 1.100.2.15 AUTHORS; cvs diff -u -r 1.2504.2.55 -r 1.2504.2.56 ChangeLog.claws; cvs diff -u -r 1.382.2.113 -r 1.382.2.114 src/compose.c; cvs diff -u -r 1.9.2.10 -r 1.9.2.11 src/gtk/gtkaspell.c; ) > 1.9.6cvs10.patchset
 ( cvs diff -u -r 1.16.2.14 -r 1.16.2.15 src/msgcache.c; cvs diff -u -r 1.5 -r 1.6 src/msgcache.h; ) > 1.9.6cvs11.patchset
+( cvs diff -u -r 1.12.2.20 -r 1.12.2.21 src/action.c; cvs diff -u -r 1.5.10.7 -r 1.5.10.8 src/addrgather.c; cvs diff -u -r 1.6.10.4 -r 1.6.10.5 src/addrharvest.c; cvs diff -u -r 1.2.4.5 -r 1.2.4.6 src/browseldap.c; cvs diff -u -r 1.382.2.114 -r 1.382.2.115 src/compose.c; cvs diff -u -r 1.3.2.7 -r 1.3.2.8 src/exphtmldlg.c; cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/expldifdlg.c; cvs diff -u -r 1.12.2.6 -r 1.12.2.7 src/html.c; cvs diff -u -r 1.3.2.1 -r 1.3.2.2 src/html.h; cvs diff -u -r 1.4.12.4 -r 1.4.12.5 src/importmutt.c; cvs diff -u -r 1.1.14.4 -r 1.1.14.5 src/importpine.c; cvs diff -u -r 1.115.2.30 -r 1.115.2.31 src/main.c; cvs diff -u -r 1.274.2.32 -r 1.274.2.33 src/mainwindow.c; cvs diff -u -r 1.94.2.48 -r 1.94.2.49 src/messageview.c; cvs diff -u -r 1.204.2.33 -r 1.204.2.34 src/prefs_common.c; cvs diff -u -r 1.103.2.13 -r 1.103.2.14 src/prefs_common.h; cvs diff -u -r 1.47.2.17 -r 1.47.2.18 src/procheader.c; cvs diff -u -r 1.395.2.61 -r 1.395.2.62 src/summaryview.c; cvs diff -u -r 1.68.2.6 -r 1.68.2.7 src/summaryview.h; cvs diff -u -r 1.96.2.50 -r 1.96.2.51 src/textview.c; cvs diff -u -r 1.36.2.26 -r 1.36.2.27 src/common/utils.c; cvs diff -u -r 1.5.2.10 -r 1.5.2.11 src/gtk/gtkutils.c; cvs diff -u -r 1.4.2.8 -r 1.4.2.9 src/gtk/gtkutils.h; cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/plugins/pgpmime/passphrase.c; ) > 1.9.6cvs12.patchset
index 4ccc573c2163e6ffa524ce2a2162a5ea1a1f568e..55706c376af2d543cb4ebd0592fe384edfdcb68b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=11
+EXTRA_VERSION=12
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 901d07a288914e5c9f362b7ac8e8afd7d03e185b..3b1d9b62f9e7daae511539c2aca17a6da3a52ea8 100644 (file)
@@ -1173,21 +1173,30 @@ static void create_io_dialog(Children *children)
 
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
 
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
-                                      GTK_POLICY_AUTOMATIC, 
+                                      GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_AUTOMATIC);
                                       GTK_POLICY_AUTOMATIC);
+       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
+                                           GTK_SHADOW_IN);
        gtk_box_pack_start(GTK_BOX(vbox), scrolledwin, TRUE, TRUE, 0);
        gtk_box_pack_start(GTK_BOX(vbox), scrolledwin, TRUE, TRUE, 0);
-       gtk_widget_set_size_request(scrolledwin, 480, 200);
+       gtk_widget_set_size_request(scrolledwin, 560, 200);
        gtk_widget_hide(scrolledwin);
 
        text = gtk_text_view_new();
        gtk_widget_hide(scrolledwin);
 
        text = gtk_text_view_new();
+
        if (prefs_common.textfont) {
        if (prefs_common.textfont) {
-               if (NULL != (text_font = pango_font_description_from_string
-                               (prefs_common.textfont))) {
-                       gtk_widget_modify_font(text, text_font);
-                       pango_font_description_free(text_font);
-               }                       
-       }                       
+               PangoFontDescription *font_desc;
+               font_desc = pango_font_description_from_string
+                       (prefs_common.textfont);
+               if (font_desc) {
+                       gtk_widget_modify_font(text, font_desc);
+                       pango_font_description_free(font_desc);
+               }
+       }
+
        gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
        gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
+       gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+       gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
+       gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
        gtk_container_add(GTK_CONTAINER(scrolledwin), text);
        gtk_widget_show(text);
 
        gtk_container_add(GTK_CONTAINER(scrolledwin), text);
        gtk_widget_show(text);
 
index 0616984637724ff071d95d1d9b18dc5c09f27f78..029c2ff20c654171ddb699af4115ea3c3a0cf40b 100644 (file)
@@ -504,8 +504,9 @@ static void addrgather_dlg_create( void ) {
        gtk_box_pack_start( GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH );
 
        /* Button panel */
        gtk_box_pack_start( GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH );
 
        /* Button panel */
-       gtkut_button_set_create( &hbbox, &btnOk, _("OK"),
-               &btnCancel, _("Cancel"), NULL, NULL );
+       gtkut_stock_button_set_create(&hbbox, &btnOk, GTK_STOCK_OK,
+                                     &btnCancel, GTK_STOCK_CANCEL,
+                                     NULL, NULL );
        gtk_box_pack_end( GTK_BOX(vbox), hbbox, FALSE, FALSE, 0 );
        gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
 
        gtk_box_pack_end( GTK_BOX(vbox), hbbox, FALSE, FALSE, 0 );
        gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
 
index e80a8e849aa8029c9c44e160b80c18b931acb29b..e97b8655f1de9ef0274999936056a2657e8e9e3c 100644 (file)
@@ -514,6 +514,7 @@ static void addrharvest_parse_address(
                AddressCache *cache, const gchar *hdrBuf )
 {
        gchar buffer[ ADDR_BUFFSIZE + 2 ];
                AddressCache *cache, const gchar *hdrBuf )
 {
        gchar buffer[ ADDR_BUFFSIZE + 2 ];
+       gchar buf[ADDR_BUFFSIZE];
        const gchar *bp;
        const gchar *ep;
        gchar *atCh, *email, *name;
        const gchar *bp;
        const gchar *ep;
        gchar *atCh, *email, *name;
@@ -555,10 +556,9 @@ static void addrharvest_parse_address(
                                name = "";
                        }
                        else {
                                name = "";
                        }
                        else {
-                                gchar *tmp = conv_unmime_header(buffer, NULL);
-                                strncpy2(buffer, tmp, sizeof buffer);
-                                name = buffer;
-                                g_free(tmp);
+                               name = buffer;
+                               conv_unmime_header(buf, sizeof(buf), name,
+                               NULL);
                        }
 
                        /* Insert into address book */
                        }
 
                        /* Insert into address book */
index 2e864b7d6b3e862e199798466bf6ddc6dac4a757..1e7d2706fce1db6789961de2f107bca835a59573 100644 (file)
@@ -304,8 +304,8 @@ static void browse_create( void ) {
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
-       gtkut_button_set_create(&hbbox, &close_btn, _( "Close" ),
-                               NULL, NULL, NULL, NULL);
+       gtkut_stock_button_set_create(&hbbox, &close_btn, GTK_STOCK_CLOSE,
+                                     NULL, NULL, NULL, NULL);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
 
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
 
index 213c45b739c102ac9364dcc262836cb0d40a3284..c55f5d9d0dfc741a3f53432435f1b952c4054668 100644 (file)
@@ -335,20 +335,14 @@ gpointer my_memmem(gconstpointer haystack, size_t haystacklen,
 /* Copy no more than N characters of SRC to DEST, with NULL terminating.  */
 gchar *strncpy2(gchar *dest, const gchar *src, size_t n)
 {
 /* Copy no more than N characters of SRC to DEST, with NULL terminating.  */
 gchar *strncpy2(gchar *dest, const gchar *src, size_t n)
 {
-       register gchar c;
-       gchar *s = dest;
+       register const gchar *s = src;
+       register gchar *d = dest;
 
 
-       do {
-               if (--n == 0) {
-                       *dest = '\0';
-                       return s;
-               }
-               c = *src++;
-               *dest++ = c;
-       } while (c != '\0');
+       while (--n && *s)
+               *d++ = *s++;
+       *d = '\0';
 
 
-       /* don't do zero fill */
-       return s;
+       return dest;
 }
 
 #if !HAVE_ISWALNUM
 }
 
 #if !HAVE_ISWALNUM
@@ -3448,7 +3442,7 @@ void debug_print_real(const gchar *format, ...)
        g_vsnprintf(buf, sizeof(buf), format, args);
        va_end(args);
 
        g_vsnprintf(buf, sizeof(buf), format, args);
        va_end(args);
 
-       fputs(buf, stdout);
+       g_print("%s", buf);
 }
 
 void * subject_table_lookup(GHashTable *subject_table, gchar * subject)
 }
 
 void * subject_table_lookup(GHashTable *subject_table, gchar * subject)
index e048b3163abc2c00143b5b9e3c4c152c5ce6c86f..4389c063d9107c1a5c7af9411430f8dad098f6a0 100644 (file)
@@ -1345,10 +1345,14 @@ void compose_reedit(MsgInfo *msginfo)
        if ((fp = procmime_get_first_text_content(msginfo)) == NULL)
                g_warning("Can't get text part\n");
        else {
        if ((fp = procmime_get_first_text_content(msginfo)) == NULL)
                g_warning("Can't get text part\n");
        else {
+               gboolean prev_autowrap = compose->autowrap;
+
+               compose->autowrap = FALSE;
                while (fgets(buf, sizeof(buf), fp) != NULL) {
                        strcrchomp(buf);
                        gtk_text_buffer_insert(textbuf, &iter, buf, -1);
                }
                while (fgets(buf, sizeof(buf), fp) != NULL) {
                        strcrchomp(buf);
                        gtk_text_buffer_insert(textbuf, &iter, buf, -1);
                }
+               compose->autowrap = prev_autowrap;
                fclose(fp);
        }
        
                fclose(fp);
        }
        
@@ -1615,6 +1619,9 @@ static void compose_entries_set(Compose *compose, const gchar *mailto)
                GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
                GtkTextMark *mark;
                GtkTextIter iter;
                GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
                GtkTextMark *mark;
                GtkTextIter iter;
+               gboolean prev_autowrap = compose->autowrap;
+
+               compose->autowrap = FALSE;
 
                mark = gtk_text_buffer_get_insert(buffer);
                gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark);
 
                mark = gtk_text_buffer_get_insert(buffer);
                gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark);
@@ -1627,6 +1634,10 @@ static void compose_entries_set(Compose *compose, const gchar *mailto)
                        gtk_text_buffer_insert(buffer, &iter, body, -1);
                }
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
                        gtk_text_buffer_insert(buffer, &iter, body, -1);
                }
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+
+               compose->autowrap = prev_autowrap;
+               if (compose->autowrap)
+                       compose_wrap_all(compose);
        }
 
        g_free(to);
        }
 
        g_free(to);
@@ -1669,16 +1680,13 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
        fclose(fp);
 
        if (hentry[H_REPLY_TO].body != NULL) {
        fclose(fp);
 
        if (hentry[H_REPLY_TO].body != NULL) {
-               compose->replyto =
-                       conv_unmime_header(hentry[H_REPLY_TO].body, NULL);
+               if (hentry[H_REPLY_TO].body[0] != '\0') {
+                       compose->replyto =
+                               conv_unmime_header(hentry[H_REPLY_TO].body,
+                                                  NULL);
+               }
                g_free(hentry[H_REPLY_TO].body);
                hentry[H_REPLY_TO].body = NULL;
                g_free(hentry[H_REPLY_TO].body);
                hentry[H_REPLY_TO].body = NULL;
-               /* if empty replyto, let sylpheed figure it out, i.e.
-                 * neglect the reply-to header. */
-                if (*(compose->replyto) == 0) {
-                        g_free(compose->replyto);
-                        compose->replyto = NULL;
-                }
        }
        if (hentry[H_CC].body != NULL) {
                compose->cc = conv_unmime_header(hentry[H_CC].body, NULL);
        }
        if (hentry[H_CC].body != NULL) {
                compose->cc = conv_unmime_header(hentry[H_CC].body, NULL);
@@ -1707,8 +1715,11 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
                hentry[H_NEWSGROUPS].body = NULL;
        }
        if (hentry[H_FOLLOWUP_TO].body != NULL) {
                hentry[H_NEWSGROUPS].body = NULL;
        }
        if (hentry[H_FOLLOWUP_TO].body != NULL) {
-               compose->followup_to =
-                       conv_unmime_header(hentry[H_FOLLOWUP_TO].body, NULL);
+               if (hentry[H_FOLLOWUP_TO].body[0] != '\0') {
+                       compose->followup_to =
+                               conv_unmime_header(hentry[H_FOLLOWUP_TO].body,
+                                                  NULL);
+               }
                g_free(hentry[H_FOLLOWUP_TO].body);
                hentry[H_FOLLOWUP_TO].body = NULL;
        }
                g_free(hentry[H_FOLLOWUP_TO].body);
                hentry[H_FOLLOWUP_TO].body = NULL;
        }
@@ -1745,13 +1756,17 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
                        compose->priority =  priority;
                }
  
                        compose->priority =  priority;
                }
  
-       if (compose->mode == COMPOSE_REEDIT && msginfo->inreplyto)
-               compose->inreplyto = g_strdup(msginfo->inreplyto);
-       else if (compose->mode != COMPOSE_REEDIT &&
-                msginfo->msgid && *msginfo->msgid) {
+       if (compose->mode == COMPOSE_REEDIT) {
+               if (msginfo->inreplyto && *msginfo->inreplyto)
+                       compose->inreplyto = g_strdup(msginfo->inreplyto);
+               return 0;
+       }
+
+       if (msginfo->msgid && *msginfo->msgid)
                compose->inreplyto = g_strdup(msginfo->msgid);
 
                compose->inreplyto = g_strdup(msginfo->msgid);
 
-               if (!compose->references) {
+       if (!compose->references) {
+               if (msginfo->msgid && *msginfo->msgid) {
                        if (msginfo->inreplyto && *msginfo->inreplyto)
                                compose->references =
                                        g_strdup_printf("<%s>\n\t<%s>",
                        if (msginfo->inreplyto && *msginfo->inreplyto)
                                compose->references =
                                        g_strdup_printf("<%s>\n\t<%s>",
@@ -1761,6 +1776,10 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
                                compose->references =
                                        g_strconcat("<", msginfo->msgid, ">",
                                                    NULL);
                                compose->references =
                                        g_strconcat("<", msginfo->msgid, ">",
                                                    NULL);
+               } else if (msginfo->inreplyto && *msginfo->inreplyto) {
+                       compose->references =
+                               g_strconcat("<", msginfo->inreplyto, ">",
+                                           NULL);
                }
        }
 
                }
        }
 
@@ -1826,6 +1845,7 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
        gchar *buf;
        gchar *p, *lastp;
        gint len;
        gchar *buf;
        gchar *p, *lastp;
        gint len;
+       gboolean prev_autowrap;
        const gchar *trimmed_body = body;
        
        if (!msginfo)
        const gchar *trimmed_body = body;
        
        if (!msginfo)
@@ -1860,6 +1880,9 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
        } else
                buf = "";
 
        } else
                buf = "";
 
+       prev_autowrap = compose->autowrap;
+       compose->autowrap = FALSE;
+
        for (p = buf; *p != '\0'; ) {
                GtkTextView *text = GTK_TEXT_VIEW(compose->text);
                GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
        for (p = buf; *p != '\0'; ) {
                GtkTextView *text = GTK_TEXT_VIEW(compose->text);
                GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
@@ -1894,6 +1917,10 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
                        break;
        }
 
                        break;
        }
 
+       compose->autowrap = prev_autowrap;
+       if (compose->autowrap)
+               compose_wrap_all(compose);
+
        return buf;
 }
 
        return buf;
 }
 
@@ -2070,10 +2097,14 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
        GtkTextMark *mark;
        GtkTextIter iter;
        gint cur_pos;
        GtkTextMark *mark;
        GtkTextIter iter;
        gint cur_pos;
+       gboolean prev_autowrap;
 
        
        g_return_if_fail(compose->account != NULL);
 
 
        
        g_return_if_fail(compose->account != NULL);
 
+       prev_autowrap = compose->autowrap;
+       compose->autowrap = FALSE;
+
        g_signal_handlers_block_by_func(G_OBJECT(buffer),
                                        G_CALLBACK(compose_changed_cb),
                                        compose);
        g_signal_handlers_block_by_func(G_OBJECT(buffer),
                                        G_CALLBACK(compose_changed_cb),
                                        compose);
@@ -2122,6 +2153,9 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
                                        G_CALLBACK(compose_changed_cb),
                                        compose);
        
                                        G_CALLBACK(compose_changed_cb),
                                        compose);
        
+       compose->autowrap = prev_autowrap;
+       if (compose->autowrap)
+               compose_wrap_all(compose);
 }
 
 static gchar *compose_get_signature_str(Compose *compose)
 }
 
 static gchar *compose_get_signature_str(Compose *compose)
@@ -2194,6 +2228,9 @@ static ComposeInsertResult compose_insert_file(Compose *compose, const gchar *fi
                return COMPOSE_INSERT_READ_ERROR;
        }
 
                return COMPOSE_INSERT_READ_ERROR;
        }
 
+       prev_autowrap = compose->autowrap;
+       compose->autowrap = FALSE;
+
        text = GTK_TEXT_VIEW(compose->text);
        buffer = gtk_text_view_get_buffer(text);
        mark = gtk_text_buffer_get_insert(buffer);
        text = GTK_TEXT_VIEW(compose->text);
        buffer = gtk_text_view_get_buffer(text);
        mark = gtk_text_buffer_get_insert(buffer);
@@ -2205,9 +2242,6 @@ static ComposeInsertResult compose_insert_file(Compose *compose, const gchar *fi
 
        cur_encoding = conv_get_locale_charset_str();
 
 
        cur_encoding = conv_get_locale_charset_str();
 
-       prev_autowrap = compose->autowrap;
-       compose->autowrap = FALSE;
-
        while (fgets(buf, sizeof(buf), fp) != NULL) {
                gchar *str;
 
        while (fgets(buf, sizeof(buf), fp) != NULL) {
                gchar *str;
 
@@ -2550,6 +2584,44 @@ static gchar *compose_get_quote_str(GtkTextBuffer *buffer,
        return NULL;
 }
 
        return NULL;
 }
 
+/* return TRUE if the line is itemized */
+static gboolean compose_is_itemized(GtkTextBuffer *buffer,
+                                   const GtkTextIter *start)
+{
+       GtkTextIter iter = *start;
+       gunichar wc;
+       gchar ch[6];
+       gint clen;
+
+       if (gtk_text_iter_ends_line(&iter))
+               return FALSE;
+
+       while (1) {
+               wc = gtk_text_iter_get_char(&iter);
+               if (!g_unichar_isspace(wc))
+                       break;
+               gtk_text_iter_forward_char(&iter);
+               if (gtk_text_iter_ends_line(&iter))
+                       return FALSE;
+       }
+
+       clen = g_unichar_to_utf8(wc, ch);
+       if (clen != 1)
+               return FALSE;
+
+       if (!strchr("*-+", ch[0]))
+               return FALSE;
+
+       gtk_text_iter_forward_char(&iter);
+       if (gtk_text_iter_ends_line(&iter))
+               return FALSE;
+       wc = gtk_text_iter_get_char(&iter);
+       if (g_unichar_isspace(wc))
+               return TRUE;
+
+       return FALSE;
+}
+
 static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
                                           const GtkTextIter *start,
                                           GtkTextIter *break_pos,
 static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
                                           const GtkTextIter *start,
                                           GtkTextIter *break_pos,
@@ -2678,7 +2750,7 @@ static gboolean compose_join_next_line(Compose *compose,
                                       GtkTextIter *iter,
                                       const gchar *quote_str)
 {
                                       GtkTextIter *iter,
                                       const gchar *quote_str)
 {
-       GtkTextIter iter_ = *iter, cur, prev, next;
+       GtkTextIter iter_ = *iter, cur, prev, next, end;
        PangoLogAttr attrs[3];
        gchar *str;
        gchar *next_quote_str;
        PangoLogAttr attrs[3];
        gchar *str;
        gchar *next_quote_str;
@@ -2699,20 +2771,21 @@ static gboolean compose_join_next_line(Compose *compose,
        }
        g_free(next_quote_str);
 
        }
        g_free(next_quote_str);
 
-       /* delete quote str */
+       end = iter_;
        if (quote_len > 0) {
        if (quote_len > 0) {
-               GtkTextIter end = iter_;
-
                gtk_text_iter_forward_chars(&end, quote_len);
                if (gtk_text_iter_ends_line(&end))
                        return FALSE;
                gtk_text_iter_forward_chars(&end, quote_len);
                if (gtk_text_iter_ends_line(&end))
                        return FALSE;
-               gtk_text_buffer_delete(buffer, &iter_, &end);
        }
 
        }
 
-       /* don't join if next line is sig separator */
-       if (is_sig_separator(compose, buffer, &iter_))
+       /* don't join itemized lines */
+       if (compose_is_itemized(buffer, &end))
                return FALSE;
 
                return FALSE;
 
+       /* delete quote str */
+       if (quote_len > 0)
+               gtk_text_buffer_delete(buffer, &iter_, &end);
+
        /* delete linebreak and extra spaces */
        prev = cur = iter_;
        while (gtk_text_iter_backward_char(&cur)) {
        /* delete linebreak and extra spaces */
        prev = cur = iter_;
        while (gtk_text_iter_backward_char(&cur)) {
@@ -2729,7 +2802,6 @@ static gboolean compose_join_next_line(Compose *compose,
                gtk_text_iter_forward_char(&cur);
                next = cur;
        }
                gtk_text_iter_forward_char(&cur);
                next = cur;
        }
-       
        if (!gtk_text_iter_equal(&prev, &next)) {
                GtkTextMark *mark;
 
        if (!gtk_text_iter_equal(&prev, &next)) {
                GtkTextMark *mark;
 
@@ -2770,6 +2842,9 @@ static void compose_wrap_paragraph(Compose *compose, GtkTextIter *par_iter)
        gchar *quote_str = NULL;
        gint quote_len;
        gboolean wrap_quote = prefs_common.linewrap_quote;
        gchar *quote_str = NULL;
        gint quote_len;
        gboolean wrap_quote = prefs_common.linewrap_quote;
+       gboolean prev_autowrap = compose->autowrap;
+
+       compose->autowrap = FALSE;
 
        buffer = gtk_text_view_get_buffer(text);
 
 
        buffer = gtk_text_view_get_buffer(text);
 
@@ -2796,13 +2871,8 @@ static void compose_wrap_paragraph(Compose *compose, GtkTextIter *par_iter)
                }
        }
 
                }
        }
 
-       if (gtk_text_iter_is_end(&iter)) {
-               if (par_iter)
-                       *par_iter = iter;
-               return;
-       }
-
-       do {
+       /* go until paragraph end (empty line) */
+       while (!gtk_text_iter_ends_line(&iter)) {
                quote_str = compose_get_quote_str(buffer, &iter, &quote_len);
                if (quote_str) {
                        if (!wrap_quote) {
                quote_str = compose_get_quote_str(buffer, &iter, &quote_len);
                if (quote_str) {
                        if (!wrap_quote) {
@@ -2855,11 +2925,12 @@ static void compose_wrap_paragraph(Compose *compose, GtkTextIter *par_iter)
                }
 
                g_free(quote_str);
                }
 
                g_free(quote_str);
-       } while (!gtk_text_iter_ends_line(&iter));
-       /* stop if paragraph end (empty line) */
+       }
 
        if (par_iter)
                *par_iter = iter;
 
        if (par_iter)
                *par_iter = iter;
+
+       compose->autowrap = prev_autowrap;
 }
 
 static void compose_wrap_all(Compose *compose)
 }
 
 static void compose_wrap_all(Compose *compose)
@@ -5332,7 +5403,9 @@ static void compose_destroy(Compose *compose)
        prefs_common.compose_width = compose->scrolledwin->allocation.width;
        prefs_common.compose_height = compose->window->allocation.height;
 
        prefs_common.compose_width = compose->scrolledwin->allocation.width;
        prefs_common.compose_height = compose->window->allocation.height;
 
-       gtk_widget_destroy(compose->paned);
+       if (!gtk_widget_get_parent(compose->paned))
+               gtk_widget_destroy(compose->paned);
+       gtk_widget_destroy(compose->popupmenu);
 
        toolbar_destroy(compose->toolbar);
        g_free(compose->toolbar);
 
        toolbar_destroy(compose->toolbar);
        g_free(compose->toolbar);
index 082bae92d1f830203de96bd4b66a576df5be1f5b..e6581328ea1d07192b892381a1fe5dfadfe4f9e1 100644 (file)
@@ -723,9 +723,9 @@ static void export_html_dialog_create( void ) {
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
-       gtkut_button_set_create(&hbbox, &btnPrev, _( "Prev" ),
-                               &btnNext, _( "Next" ),
-                               &btnCancel, _( "Cancel" ) );
+       gtkut_stock_button_set_create(&hbbox, &btnPrev, GTK_STOCK_GO_BACK,
+                                     &btnNext, GTK_STOCK_GO_FORWARD,
+                                     &btnCancel, GTK_STOCK_CANCEL);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(hbbox), 2);
        gtk_widget_grab_default(btnNext);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(hbbox), 2);
        gtk_widget_grab_default(btnNext);
index e6ec59e4433a458722e1b04385908a9148096d83..679936aed416562dde82e504faf8b604ed1888d2 100644 (file)
@@ -744,9 +744,9 @@ static void export_ldif_dialog_create( void ) {
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
-       gtkut_button_set_create(&hbbox, &btnPrev, _( "Prev" ),
-                               &btnNext, _( "Next" ),
-                               &btnCancel, _( "Cancel" ) );
+       gtkut_stock_button_set_create(&hbbox, &btnPrev, GTK_STOCK_GO_BACK,
+                                     &btnNext, GTK_STOCK_GO_FORWARD,
+                                     &btnCancel, GTK_STOCK_CANCEL);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(hbbox), 2);
        gtk_widget_grab_default(btnNext);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(hbbox), 2);
        gtk_widget_grab_default(btnNext);
index b23177ca4f1f9dee7b0822fc30f72691eb01cd40..88f475ef9217a2c354ea1a7a88a44ff8439cb027 100644 (file)
@@ -95,38 +95,6 @@ void gtkut_convert_int_to_gdk_color(gint rgbvalue, GdkColor *color)
        color->blue  = (int) (((gdouble) (rgbvalue & 0x0000ff)        / 255.0) * 65535.0);
 }
 
        color->blue  = (int) (((gdouble) (rgbvalue & 0x0000ff)        / 255.0) * 65535.0);
 }
 
-void gtkut_button_set_create(GtkWidget **bbox,
-                            GtkWidget **button1, const gchar *label1,
-                            GtkWidget **button2, const gchar *label2,
-                            GtkWidget **button3, const gchar *label3)
-{
-       g_return_if_fail(bbox != NULL);
-       g_return_if_fail(button1 != NULL);
-
-       *bbox = gtk_hbutton_box_new();
-       gtk_button_box_set_layout(GTK_BUTTON_BOX(*bbox), GTK_BUTTONBOX_END);
-       gtk_box_set_spacing(GTK_BOX(*bbox), 5);
-
-       *button1 = gtk_button_new_with_label(label1);
-       GTK_WIDGET_SET_FLAGS(*button1, GTK_CAN_DEFAULT);
-       gtk_box_pack_start(GTK_BOX(*bbox), *button1, TRUE, TRUE, 0);
-       gtk_widget_show(*button1);
-
-       if (button2) {
-               *button2 = gtk_button_new_with_label(label2);
-               GTK_WIDGET_SET_FLAGS(*button2, GTK_CAN_DEFAULT);
-               gtk_box_pack_start(GTK_BOX(*bbox), *button2, TRUE, TRUE, 0);
-               gtk_widget_show(*button2);
-       }
-
-       if (button3) {
-               *button3 = gtk_button_new_with_label(label3);
-               GTK_WIDGET_SET_FLAGS(*button3, GTK_CAN_DEFAULT);
-               gtk_box_pack_start(GTK_BOX(*bbox), *button3, TRUE, TRUE, 0);
-               gtk_widget_show(*button3);
-       }
-}
-
 void gtkut_stock_button_set_create(GtkWidget **bbox,
                                   GtkWidget **button1, const gchar *label1,
                                   GtkWidget **button2, const gchar *label2,
 void gtkut_stock_button_set_create(GtkWidget **bbox,
                                   GtkWidget **button1, const gchar *label1,
                                   GtkWidget **button2, const gchar *label2,
@@ -473,46 +441,8 @@ void gtkut_editable_disable_im(GtkEditable *editable)
 #endif
 }
 
 #endif
 }
 
-/*
- * Walk through the widget tree and disclaim the selection from all currently
- * realized GtkEditable widgets.
- */
-static void gtkut_check_before_remove(GtkWidget *widget, gpointer unused)
-{
-       g_return_if_fail(widget != NULL);
-
-       if (!GTK_WIDGET_REALIZED(widget))
-               return; /* all nested widgets must be unrealized too */
-       if (GTK_IS_CONTAINER(widget))
-               gtk_container_forall(GTK_CONTAINER(widget),
-                                    gtkut_check_before_remove, NULL);
-#warning FIXME_GTK2
-#if 0
-       if (GTK_IS_EDITABLE(widget))
-               gtk_editable_claim_selection(GTK_EDITABLE(widget),
-                                            FALSE, GDK_CURRENT_TIME);
-#endif
-}
-
-/*
- * Wrapper around gtk_container_remove to work around a bug in GtkText and
- * GtkEntry (in all GTK+ versions up to and including at least 1.2.10).
- *
- * The problem is that unrealizing a GtkText or GtkEntry widget which has the
- * active selection completely messes up selection handling, leading to
- * non-working selections and crashes.  Removing a widget from its container
- * implies unrealizing it and all its child widgets; this triggers the bug if
- * the removed widget or any of its children is GtkText or GtkEntry.  As a
- * workaround, this function walks through the widget subtree before removing
- * and disclaims the selection from all GtkEditable widgets found.
- *
- * A similar workaround may be needed for gtk_widget_reparent(); currently it
- * is not necessary because Sylpheed does not use gtk_widget_reparent() for
- * GtkEditable widgets or containers holding such widgets.
- */
 void gtkut_container_remove(GtkContainer *container, GtkWidget *widget)
 {
 void gtkut_container_remove(GtkContainer *container, GtkWidget *widget)
 {
-       gtkut_check_before_remove(widget, NULL);
        gtk_container_remove(container, widget);
 }
 
        gtk_container_remove(container, widget);
 }
 
index 9850886dec2778bc6ba519ca8032d01c899a3da8..c4d3434c8a9f25d6d9360d1d1e878ba4f6418936 100644 (file)
@@ -96,14 +96,6 @@ gboolean gtkut_get_font_size         (GtkWidget      *widget,
 void gtkut_convert_int_to_gdk_color    (gint            rgbvalue,
                                         GdkColor       *color);
 
 void gtkut_convert_int_to_gdk_color    (gint            rgbvalue,
                                         GdkColor       *color);
 
-void gtkut_button_set_create           (GtkWidget      **bbox,
-                                        GtkWidget      **button1,
-                                        const gchar     *label1,
-                                        GtkWidget      **button2,
-                                        const gchar     *label2,
-                                        GtkWidget      **button3,
-                                        const gchar     *label3);
-
 void gtkut_stock_button_set_create     (GtkWidget      **bbox,
                                         GtkWidget      **button1,
                                         const gchar     *label1,
 void gtkut_stock_button_set_create     (GtkWidget      **bbox,
                                         GtkWidget      **button1,
                                         const gchar     *label1,
index d7833a0175053060b8267e7d33be6c6af8c25f01..0cdd01f03685864d798e7fb3db50287614613c85 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 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
  *
  * 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
@@ -111,201 +111,7 @@ static HTMLSymbol ascii_symbol_list[] = {
        {"&yacute;", "y'"},
 };
 
        {"&yacute;", "y'"},
 };
 
-static HTMLSymbol eucjp_symbol_list[] = {
-       {"&iexcl;" , "^!"},
-       {"&cent;"  , "\xa1\xf1"},
-       {"&pound;" , "\xa1\xf2"},
-       {"&yen;"   , "\xa1\xef"},
-       {"&brvbar;", "|"},
-       {"&sect;"  , "\xa1\xf8"},
-       {"&uml;"   , "\xa1\xaf"},
-       {"&copy;"  , "(C)"},
-       {"&laquo;" , "<<"},
-       {"&reg;"   , "(R)"},
-
-       {"&deg;"   , "\xa1\xeb"},
-       {"&plusmn;", "\xa1\xde"},
-       {"&sup2;"  , "^2"},
-       {"&sup3;"  , "^3"},
-       {"&acute;" , "'"},
-       {"&micro;" , "\xa6\xcc"},
-       {"&para;"  , "\xa2\xf9"},
-       {"&middot;", "\xa1\xa6"},
-       {"&cedil;" , ","},
-       {"&sup1;"  , "^1"},
-       {"&raquo;" , ">>"},
-       {"&frac14;", "1/4"},
-       {"&frac12;", "1/2"},
-       {"&frac34;", "3/4"},
-       {"&iquest;", "^?"},
-
-       {"&Agrave;", "A`"},
-       {"&Aacute;", "A'"},
-       {"&Acirc;" , "A^"},
-       {"&Atilde;", "A~"},
-       {"&Auml;"  , "A\xa1\xaf"},
-       {"&Aring;" , "A\xa1\xeb"},
-       {"&AElig;" , "AE"},
-       {"&Egrave;", "E`"},
-       {"&Eacute;", "E'"},
-       {"&Ecirc;" , "E^"},
-       {"&Euml;"  , "E\xa1\xaf"},
-       {"&Igrave;", "I`"},
-       {"&Iacute;", "I'"},
-       {"&Icirc;" , "I^"},
-       {"&Iuml;"  , "I\xa1\xaf"},
-
-       {"&Ntilde;", "N~"},
-       {"&Ograve;", "O`"},
-       {"&Oacute;", "O'"},
-       {"&Ocirc;" , "O^"},
-       {"&Otilde;", "O~"},
-       {"&Ouml;"  , "O\xa1\xaf"},
-       {"&times;" , "\xa1\xdf"},
-       {"&Ugrave;", "U`"},
-       {"&Uacute;", "U'"},
-       {"&Ucirc;" , "U^"},
-       {"&Uuml;"  , "U\xa1\xaf"},
-       {"&Yacute;", "Y'"},
-
-       {"&agrave;", "a`"},
-       {"&aacute;", "a'"},
-       {"&acirc;" , "a^"},
-       {"&atilde;", "a~"},
-       {"&auml;"  , "a\xa1\xaf"},
-       {"&aring;" , "a\xa1\xeb"},
-       {"&aelig;" , "ae"},
-       {"&egrave;", "e`"},
-       {"&eacute;", "e'"},
-       {"&ecirc;" , "e^"},
-       {"&euml;"  , "e\xa1\xaf"},
-       {"&igrave;", "i`"},
-       {"&iacute;", "i'"},
-       {"&icirc;" , "i^"},
-       {"&iuml;"  , "i\xa1\xaf"},
-
-       {"&eth;"   , "\xa2\xdf"},
-       {"&ntilde;", "n~"},
-       {"&ograve;", "o`"},
-       {"&oacute;", "o'"},
-       {"&ocirc;" , "o^"},
-       {"&otilde;", "o~"},
-       {"&ouml;"  , "o\xa1\xaf"},
-       {"&divide;", "\xa1\xe0"},
-       {"&ugrave;", "u`"},
-       {"&uacute;", "u'"},
-       {"&ucirc;" , "u^"},
-       {"&uuml;"  , "u\xa1\xaf"},
-       {"&yacute;", "y'"},
-       {"&yuml;"  , "y\xa1\xaf"},
-};
-
-static HTMLSymbol latin_symbol_list[] = {
-       {"&iexcl;" , "\xa1"},
-       {"&cent;"  , "\xa2"},
-       {"&pound;" , "\xa3"},
-       {"&curren;", "\xa4"},
-       {"&yen;"   , "\xa5"},
-       {"&brvbar;", "\xa6"},
-       {"&sect;"  , "\xa7"},
-       {"&uml;"   , "\xa8"},
-       {"&copy;"  , "\xa9"},
-       {"&ordf;"  , "\xaa"},
-       {"&laquo;" , "\xab"},
-       {"&not;"   , "\xac"},
-       {"&shy;"   , "\xad"},
-       {"&reg;"   , "\xae"},
-       {"&macr;"  , "\xaf"},
-
-       {"&deg;"   , "\xb0"},
-       {"&plusmn;", "\xb1"},
-       {"&sup2;"  , "\xb2"},
-       {"&sup3;"  , "\xb3"},
-       {"&acute;" , "\xb4"},
-       {"&micro;" , "\xb5"},
-       {"&para;"  , "\xb6"},
-       {"&middot;", "\xb7"},
-       {"&cedil;" , "\xb8"},
-       {"&sup1;"  , "\xb9"},
-       {"&ordm;"  , "\xba"},
-       {"&raquo;" , "\xbb"},
-       {"&frac14;", "\xbc"},
-       {"&frac12;", "\xbd"},
-       {"&frac34;", "\xbe"},
-       {"&iquest;", "\xbf"},
-
-       {"&Agrave;", "\xc0"},
-       {"&Aacute;", "\xc1"},
-       {"&Acirc;" , "\xc2"},
-       {"&Atilde;", "\xc3"},
-       {"&Auml;"  , "\xc4"},
-       {"&Aring;" , "\xc5"},
-       {"&AElig;" , "\xc6"},
-       {"&Ccedil;", "\xc7"},
-       {"&Egrave;", "\xc8"},
-       {"&Eacute;", "\xc9"},
-       {"&Ecirc;" , "\xca"},
-       {"&Euml;"  , "\xcb"},
-       {"&Igrave;", "\xcc"},
-       {"&Iacute;", "\xcd"},
-       {"&Icirc;" , "\xce"},
-       {"&Iuml;"  , "\xcf"},
-
-       {"&ETH;"   , "\xd0"},
-       {"&Ntilde;", "\xd1"},
-       {"&Ograve;", "\xd2"},
-       {"&Oacute;", "\xd3"},
-       {"&Ocirc;" , "\xd4"},
-       {"&Otilde;", "\xd5"},
-       {"&Ouml;"  , "\xd6"},
-       {"&times;" , "\xd7"},
-       {"&Oslash;", "\xd8"},
-       {"&Ugrave;", "\xd9"},
-       {"&Uacute;", "\xda"},
-       {"&Ucirc;" , "\xdb"},
-       {"&Uuml;"  , "\xdc"},
-       {"&Yacute;", "\xdd"},
-       {"&THORN;" , "\xde"},
-       {"&szlig;" , "\xdf"},
-
-       {"&agrave;", "\xe0"},
-       {"&aacute;", "\xe1"},
-       {"&acirc;" , "\xe2"},
-       {"&atilde;", "\xe3"},
-       {"&auml;"  , "\xe4"},
-       {"&aring;" , "\xe5"},
-       {"&aelig;" , "\xe6"},
-       {"&ccedil;", "\xe7"},
-       {"&egrave;", "\xe8"},
-       {"&eacute;", "\xe9"},
-       {"&ecirc;" , "\xea"},
-       {"&euml;"  , "\xeb"},
-       {"&igrave;", "\xec"},
-       {"&iacute;", "\xed"},
-       {"&icirc;" , "\xee"},
-       {"&iuml;"  , "\xef"},
-
-       {"&eth;"   , "\xf0"},
-       {"&ntilde;", "\xf1"},
-       {"&ograve;", "\xf2"},
-       {"&oacute;", "\xf3"},
-       {"&ocirc;" , "\xf4"},
-       {"&otilde;", "\xf5"},
-       {"&ouml;"  , "\xf6"},
-       {"&divide;", "\xf7"},
-       {"&oslash;", "\xf8"},
-       {"&ugrave;", "\xf9"},
-       {"&uacute;", "\xfa"},
-       {"&ucirc;" , "\xfb"},
-       {"&uuml;"  , "\xfc"},
-       {"&yacute;", "\xfd"},
-       {"&thorn;" , "\xfe"},
-       {"&yuml;"  , "\xff"},
-};
-
 static GHashTable *default_symbol_table;
 static GHashTable *default_symbol_table;
-static GHashTable *eucjp_symbol_table;
-static GHashTable *latin_symbol_table;
 
 static HTMLState html_read_line                (HTMLParser     *parser);
 static void html_append_char           (HTMLParser     *parser,
 
 static HTMLState html_read_line                (HTMLParser     *parser);
 static void html_append_char           (HTMLParser     *parser,
@@ -354,31 +160,10 @@ HTMLParser *html_parser_new(FILE *fp, CodeConverter *conv)
                SYMBOL_TABLE_ADD(default_symbol_table, symbol_list);
                SYMBOL_TABLE_ADD(default_symbol_table, ascii_symbol_list);
        }
                SYMBOL_TABLE_ADD(default_symbol_table, symbol_list);
                SYMBOL_TABLE_ADD(default_symbol_table, ascii_symbol_list);
        }
-       if (!eucjp_symbol_table) {
-               eucjp_symbol_table =
-                       g_hash_table_new(g_str_hash, g_str_equal);
-               SYMBOL_TABLE_ADD(eucjp_symbol_table, symbol_list);
-               SYMBOL_TABLE_ADD(eucjp_symbol_table, eucjp_symbol_list);
-       }
-       if (!latin_symbol_table) {
-               latin_symbol_table =
-                       g_hash_table_new(g_str_hash, g_str_equal);
-               SYMBOL_TABLE_ADD(latin_symbol_table, symbol_list);
-               SYMBOL_TABLE_ADD(latin_symbol_table, latin_symbol_list);
-       }
 
 #undef SYMBOL_TABLE_ADD
 
 
 #undef SYMBOL_TABLE_ADD
 
-       if (conv->charset == C_ISO_8859_1)
-               parser->symbol_table = latin_symbol_table;
-       else if ((conv->charset == C_ISO_2022_JP   ||
-                 conv->charset == C_ISO_2022_JP_2 ||
-                 conv->charset == C_EUC_JP        ||
-                 conv->charset == C_SHIFT_JIS) &&
-                conv_get_locale_charset() == C_EUC_JP)
-               parser->symbol_table = eucjp_symbol_table;
-       else
-               parser->symbol_table = default_symbol_table;
+       parser->symbol_table = default_symbol_table;
 
        return parser;
 }
 
        return parser;
 }
@@ -534,7 +319,7 @@ static HTMLTag *html_get_tag(const gchar *str)
 
        tag = g_new0(HTMLTag, 1);
 
 
        tag = g_new0(HTMLTag, 1);
 
-       for (tmpp = tmp; *tmpp != '\0' && !isspace(*tmpp); tmpp++)
+       for (tmpp = tmp; *tmpp != '\0' && !g_ascii_isspace(*tmpp); tmpp++)
                ;
 
        if (*tmpp == '\0') {
                ;
 
        if (*tmpp == '\0') {
@@ -554,18 +339,20 @@ static HTMLTag *html_get_tag(const gchar *str)
                gchar *p;
                gchar quote;
 
                gchar *p;
                gchar quote;
 
-               while (isspace(*tmpp)) tmpp++;
+               while (g_ascii_isspace(*tmpp)) tmpp++;
                attr_name = tmpp;
 
                attr_name = tmpp;
 
-               while (*tmpp != '\0' && !isspace(*tmpp) && *tmpp != '=') tmpp++;
+               while (*tmpp != '\0' && !g_ascii_isspace(*tmpp) &&
+                      *tmpp != '=')
+                       tmpp++;
                if (*tmpp != '\0' && *tmpp != '=') {
                        *tmpp++ = '\0';
                if (*tmpp != '\0' && *tmpp != '=') {
                        *tmpp++ = '\0';
-                       while (isspace(*tmpp)) tmpp++;
+                       while (g_ascii_isspace(*tmpp)) tmpp++;
                }
 
                if (*tmpp == '=') {
                        *tmpp++ = '\0';
                }
 
                if (*tmpp == '=') {
                        *tmpp++ = '\0';
-                       while (isspace(*tmpp)) tmpp++;
+                       while (g_ascii_isspace(*tmpp)) tmpp++;
 
                        if (*tmpp == '"' || *tmpp == '\'') {
                                /* name="value" */
 
                        if (*tmpp == '"' || *tmpp == '\'') {
                                /* name="value" */
@@ -578,11 +365,11 @@ static HTMLTag *html_get_tag(const gchar *str)
                                }
                                tmpp = p;
                                *tmpp++ = '\0';
                                }
                                tmpp = p;
                                *tmpp++ = '\0';
-                               while (isspace(*tmpp)) tmpp++;
+                               while (g_ascii_isspace(*tmpp)) tmpp++;
                        } else {
                                /* name=value */
                                attr_value = tmpp;
                        } else {
                                /* name=value */
                                attr_value = tmpp;
-                               while (*tmpp != '\0' && !isspace(*tmpp)) tmpp++;
+                               while (*tmpp != '\0' && !g_ascii_isspace(*tmpp)) tmpp++;
                                if (*tmpp != '\0')
                                        *tmpp++ = '\0';
                        }
                                if (*tmpp != '\0')
                                        *tmpp++ = '\0';
                        }
@@ -667,7 +454,7 @@ static HTMLState html_parse_tag(HTMLParser *parser)
                   !strcmp(tag->name, "li")     ||
                   !strcmp(tag->name, "table")  ||
                   !strcmp(tag->name, "tr")     ||
                   !strcmp(tag->name, "li")     ||
                   !strcmp(tag->name, "table")  ||
                   !strcmp(tag->name, "tr")     ||
-                  (tag->name[0] == 'h' && isdigit((guchar)tag->name[1]))) {
+                  (tag->name[0] == 'h' && g_ascii_isdigit(tag->name[1]))) {
                if (!parser->newline) {
                        parser->space = FALSE;
                        html_append_char(parser, '\n');
                if (!parser->newline) {
                        parser->space = FALSE;
                        html_append_char(parser, '\n');
@@ -676,7 +463,7 @@ static HTMLState html_parse_tag(HTMLParser *parser)
        } else if (!strcmp(tag->name, "/table") ||
                   (tag->name[0] == '/' &&
                    tag->name[1] == 'h' &&
        } else if (!strcmp(tag->name, "/table") ||
                   (tag->name[0] == '/' &&
                    tag->name[1] == 'h' &&
-                   isdigit((guchar)tag->name[1]))) {
+                   g_ascii_isdigit(tag->name[1]))) {
                if (!parser->empty_line) {
                        parser->space = FALSE;
                        if (!parser->newline) html_append_char(parser, '\n');
                if (!parser->empty_line) {
                        parser->space = FALSE;
                        if (!parser->newline) html_append_char(parser, '\n');
@@ -724,7 +511,7 @@ static void html_parse_special(HTMLParser *parser)
                html_append_str(parser, val, -1);
                parser->state = HTML_NORMAL;
                return;
                html_append_str(parser, val, -1);
                parser->state = HTML_NORMAL;
                return;
-       } else if (symbol_name[1] == '#' && isdigit((guchar)symbol_name[2])) {
+       } else if (symbol_name[1] == '#' && g_ascii_isdigit(symbol_name[2])) {
                gint ch;
 
                ch = atoi(symbol_name + 2);
                gint ch;
 
                ch = atoi(symbol_name + 2);
index c7e1a75af9fa76102973fee45a1b2f8751536caa..72a55748ce239a77704bdb6f5ec106a41fed99cc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 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
  *
  * 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 100a0438bfb5bded73f61ca232e56d551ac8eb29..0d110bf443782d735d75826fb376cc8e4ac54516 100644 (file)
@@ -285,8 +285,9 @@ static void imp_mutt_create( gboolean *cancelled ) {
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
-       gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
-                               &cancel_btn, _("Cancel"), NULL, NULL);
+       gtkut_stock_button_set_create(&hbbox, &ok_btn, GTK_STOCK_OK,
+                                     &cancel_btn, GTK_STOCK_CANCEL,
+                                     NULL, NULL);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
        gtk_widget_grab_default(ok_btn);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
        gtk_widget_grab_default(ok_btn);
index 11a63443e357abe2ec272f51bfd3a9345993d8b9..80afee6107ef276fcca827804b15298013c9d538 100644 (file)
@@ -285,8 +285,9 @@ static void imp_pine_create( gboolean *cancelled ) {
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
        gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
 
        /* Button panel */
-       gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
-                               &cancel_btn, _("Cancel"), NULL, NULL);
+       gtkut_stock_button_set_create(&hbbox, &ok_btn, GTK_STOCK_OK,
+                                     &cancel_btn, GTK_STOCK_CANCEL,
+                                     NULL, NULL);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
        gtk_widget_grab_default(ok_btn);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
        gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
        gtk_widget_grab_default(ok_btn);
index 5489b1a02d821849e673121f2a13f8dbf86a4a53..9edeafdf881d21dd1fc6367732021c84c886ea9f 100644 (file)
@@ -150,12 +150,6 @@ static void quit_signal_handler         (int sig);
 static void install_basic_sighandlers   (void);
 static void exit_sylpheed              (MainWindow *mainwin);
 
 static void install_basic_sighandlers   (void);
 static void exit_sylpheed              (MainWindow *mainwin);
 
-#if 0
-/* for gettext */
-_("File `%s' already exists.\n"
-  "Can't create folder.")
-#endif
-
 #define MAKE_DIR_IF_NOT_EXIST(dir) \
 { \
        if (!is_dir_exist(dir)) { \
 #define MAKE_DIR_IF_NOT_EXIST(dir) \
 { \
        if (!is_dir_exist(dir)) { \
index e86774151150b27a2992ddbc1acb6df22e9b0f24..66d846ea21b7680bf7dfdc5239f2faec9a5acc3a 100644 (file)
@@ -488,7 +488,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, toggle_statusbar_cb, 0, "<ToggleItem>"},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Separate f_older tree"),    NULL, separate_widget_cb, SEPARATE_FOLDER, "<ToggleItem>"},
                                                NULL, toggle_statusbar_cb, 0, "<ToggleItem>"},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Separate f_older tree"),    NULL, separate_widget_cb, SEPARATE_FOLDER, "<ToggleItem>"},
-       {N_("/_View/Separate m_essage view"),   NULL, separate_widget_cb, SEPARATE_MESSAGE, "<ToggleItem>"},
+       {N_("/_View/Separate _message view"),   NULL, separate_widget_cb, SEPARATE_MESSAGE, "<ToggleItem>"},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/_Sort"),                    NULL, NULL, 0, "<Branch>"},
        {N_("/_View/_Sort/by _number"),         NULL, sort_summary_cb, SORT_BY_NUMBER, "<RadioItem>"},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/_Sort"),                    NULL, NULL, 0, "<Branch>"},
        {N_("/_View/_Sort/by _number"),         NULL, sort_summary_cb, SORT_BY_NUMBER, "<RadioItem>"},
@@ -544,95 +544,104 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_View/_Go to/Other _folder..."),  "G", goto_folder_cb, 0, NULL},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
 
        {N_("/_View/_Go to/Other _folder..."),  "G", goto_folder_cb, 0, NULL},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
 
-#define CODESET_SEPARATOR \
-       {N_("/_View/_Code set/---"),            NULL, NULL, 0, "<Separator>"}
-#define CODESET_ACTION(action) \
-        NULL, set_charset_cb, action, "/View/Code set/Auto detect"
+#define ENC_SEPARATOR \
+       {N_("/_View/Character _encoding/---"),          NULL, NULL, 0, "<Separator>"}
+#define ENC_ACTION(action) \
+        NULL, set_charset_cb, action, "/View/Character encoding/Auto detect"
 
 
-       {N_("/_View/_Code set"),                NULL, NULL, 0, "<Branch>"},
-       {N_("/_View/_Code set/_Auto detect"),
+       {N_("/_View/Character _encoding"),              NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/_Auto detect"),
         NULL, set_charset_cb, C_AUTO, "<RadioItem>"},
         NULL, set_charset_cb, C_AUTO, "<RadioItem>"},
-       {N_("/_View/_Code set/---"),            NULL, NULL, 0, "<Separator>"},
-       {N_("/_View/_Code set/7bit ascii (US-ASC_II)"),
-        CODESET_ACTION(C_US_ASCII)},
-
-       {N_("/_View/_Code set/Unicode (_UTF-8)"),
-        CODESET_ACTION(C_UTF_8)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Western European (ISO-8859-_1)"),
-        CODESET_ACTION(C_ISO_8859_1)},
-       {N_("/_View/_Code set/Western European (ISO-8859-15)"),
-        CODESET_ACTION(C_ISO_8859_15)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Central European (ISO-8859-_2)"),
-        CODESET_ACTION(C_ISO_8859_2)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/_Baltic (ISO-8859-13)"),
-        CODESET_ACTION(C_ISO_8859_13)},
-       {N_("/_View/_Code set/Baltic (ISO-8859-_4)"),
-        CODESET_ACTION(C_ISO_8859_4)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Greek (ISO-8859-_7)"),
-        CODESET_ACTION(C_ISO_8859_7)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Turkish (ISO-8859-_9)"),
-        CODESET_ACTION(C_ISO_8859_9)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Cyrillic (ISO-8859-_5)"),
-        CODESET_ACTION(C_ISO_8859_5)},
-       {N_("/_View/_Code set/Cyrillic (KOI8-_R)"),
-        CODESET_ACTION(C_KOI8_R)},
-       {N_("/_View/_Code set/Cyrillic (KOI8-U)"),
-        CODESET_ACTION(C_KOI8_U)},
-       {N_("/_View/_Code set/Cyrillic (Windows-1251)"),
-        CODESET_ACTION(C_WINDOWS_1251)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Japanese (ISO-2022-_JP)"),
-        CODESET_ACTION(C_ISO_2022_JP)},
-       {N_("/_View/_Code set/Japanese (ISO-2022-JP-2)"),
-        CODESET_ACTION(C_ISO_2022_JP_2)},
-       {N_("/_View/_Code set/Japanese (_EUC-JP)"),
-        CODESET_ACTION(C_EUC_JP)},
-       {N_("/_View/_Code set/Japanese (_Shift__JIS)"),
-        CODESET_ACTION(C_SHIFT_JIS)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Simplified Chinese (_GB2312)"),
-        CODESET_ACTION(C_GB2312)},
-       {N_("/_View/_Code set/Traditional Chinese (_Big5)"),
-        CODESET_ACTION(C_BIG5)},
-       {N_("/_View/_Code set/Traditional Chinese (EUC-_TW)"),
-        CODESET_ACTION(C_EUC_TW)},
-       {N_("/_View/_Code set/Chinese (ISO-2022-_CN)"),
-        CODESET_ACTION(C_ISO_2022_CN)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Korean (EUC-_KR)"),
-        CODESET_ACTION(C_EUC_KR)},
-       {N_("/_View/_Code set/Korean (ISO-2022-KR)"),
-        CODESET_ACTION(C_ISO_2022_KR)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Thai (TIS-620)"),
-        CODESET_ACTION(C_TIS_620)},
-       {N_("/_View/_Code set/Thai (Windows-874)"),
-        CODESET_ACTION(C_WINDOWS_874)},
-
-#undef CODESET_SEPARATOR
-#undef CODESET_ACTION
-
-#define DECODE_SEPARATOR \
+       {N_("/_View/Character _encoding/---"),          NULL, NULL, 0, "<Separator>"},
+       {N_("/_View/Character _encoding/7bit ascii (US-ASC_II)"),
+        ENC_ACTION(C_US_ASCII)},
+       {N_("/_View/Character _encoding/Unicode (_UTF-8)"),
+        ENC_ACTION(C_UTF_8)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Western European (ISO-8859-_1)"),
+        ENC_ACTION(C_ISO_8859_1)},
+       {N_("/_View/Character _encoding/Western European (ISO-8859-15)"),
+        ENC_ACTION(C_ISO_8859_15)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Central European (ISO-8859-_2)"),
+        ENC_ACTION(C_ISO_8859_2)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/_Baltic (ISO-8859-13)"),
+        ENC_ACTION(C_ISO_8859_13)},
+       {N_("/_View/Character _encoding/Baltic (ISO-8859-_4)"),
+        ENC_ACTION(C_ISO_8859_4)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Greek (ISO-8859-_7)"),
+        ENC_ACTION(C_ISO_8859_7)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Turkish (ISO-8859-_9)"),
+        ENC_ACTION(C_ISO_8859_9)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Cyrillic (ISO-8859-_5)"),
+        ENC_ACTION(C_ISO_8859_5)},
+       {N_("/_View/Character _encoding/Cyrillic (KOI8-_R)"),
+        ENC_ACTION(C_KOI8_R)},
+       {N_("/_View/Character _encoding/Cyrillic (KOI8-U)"),
+        ENC_ACTION(C_KOI8_U)},
+       {N_("/_View/Character _encoding/Cyrillic (Windows-1251)"),
+        ENC_ACTION(C_CP1251)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Japanese (ISO-2022-_JP)"),
+        ENC_ACTION(C_ISO_2022_JP)},
+       {N_("/_View/Character _encoding/Japanese (ISO-2022-JP-2)"),
+        ENC_ACTION(C_ISO_2022_JP_2)},
+       {N_("/_View/Character _encoding/Japanese (_EUC-JP)"),
+        ENC_ACTION(C_EUC_JP)},
+       {N_("/_View/Character _encoding/Japanese (_Shift__JIS)"),
+        ENC_ACTION(C_SHIFT_JIS)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Simplified Chinese (_GB2312)"),
+        ENC_ACTION(C_GB2312)},
+       {N_("/_View/Character _encoding/Traditional Chinese (_Big5)"),
+        ENC_ACTION(C_BIG5)},
+       {N_("/_View/Character _encoding/Traditional Chinese (EUC-_TW)"),
+        ENC_ACTION(C_EUC_TW)},
+       {N_("/_View/Character _encoding/Chinese (ISO-2022-_CN)"),
+        ENC_ACTION(C_ISO_2022_CN)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Korean (EUC-_KR)"),
+        ENC_ACTION(C_EUC_KR)},
+       {N_("/_View/Character _encoding/Korean (ISO-2022-KR)"),
+        ENC_ACTION(C_ISO_2022_KR)},
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/Thai (TIS-620)"),
+        ENC_ACTION(C_TIS_620)},
+       {N_("/_View/Character _encoding/Thai (Windows-874)"),
+        ENC_ACTION(C_WINDOWS_874)},
+
+#undef ENC_SEPARATOR
+#undef ENC_ACTION
+
+#define DEC_SEPARATOR \
        {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"}
        {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"}
-#define DECODE_ACTION(action) \
+#define DEC_ACTION(action) \
         NULL, set_decode_cb, action, "/View/Decode/Auto detect"
        {N_("/_View/Decode"),           NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Decode/_Auto detect"),
         NULL, set_decode_cb, 0, "<RadioItem>"},
        {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"},
         NULL, set_decode_cb, action, "/View/Decode/Auto detect"
        {N_("/_View/Decode"),           NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Decode/_Auto detect"),
         NULL, set_decode_cb, 0, "<RadioItem>"},
        {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"},
-       {N_("/_View/Decode/_8bit"),             DECODE_ACTION(ENC_8BIT)},
-       {N_("/_View/Decode/_Quoted printable"), DECODE_ACTION(ENC_QUOTED_PRINTABLE)},
-       {N_("/_View/Decode/_Base64"),           DECODE_ACTION(ENC_BASE64)},
-       {N_("/_View/Decode/_Uuencode"),         DECODE_ACTION(ENC_X_UUENCODE)},
+       {N_("/_View/Decode/_8bit"),             DEC_ACTION(ENC_8BIT)},
+       {N_("/_View/Decode/_Quoted printable"), DEC_ACTION(ENC_QUOTED_PRINTABLE)},
+       {N_("/_View/Decode/_Base64"),           DEC_ACTION(ENC_BASE64)},
+       {N_("/_View/Decode/_Uuencode"),         DEC_ACTION(ENC_X_UUENCODE)},
 
 
-#undef DECODE_SEPARATOR
-#undef DECODE_ACTION
+#undef DEC_SEPARATOR
+#undef DEC_ACTION
 
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Open in new _window"),      "<control><alt>N", open_msg_cb, 0, NULL},
 
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Open in new _window"),      "<control><alt>N", open_msg_cb, 0, NULL},
@@ -1026,7 +1035,7 @@ MainWindow *main_window_create(SeparateType type)
 
        /* set menu items */
        menuitem = gtk_item_factory_get_item
 
        /* set menu items */
        menuitem = gtk_item_factory_get_item
-               (ifactory, "/View/Code set/Auto detect");
+               (ifactory, "/View/Character encoding/Auto detect");
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
 
        switch (prefs_common.toolbar_style) {
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
 
        switch (prefs_common.toolbar_style) {
@@ -1468,17 +1477,20 @@ void main_window_toggle_message_view(MainWindow *mainwin)
                gtk_widget_ref(vpaned);
                gtkut_container_remove(GTK_CONTAINER(container), vpaned);
                gtk_widget_reparent(GTK_WIDGET_PTR(summaryview), container);
                gtk_widget_ref(vpaned);
                gtkut_container_remove(GTK_CONTAINER(container), vpaned);
                gtk_widget_reparent(GTK_WIDGET_PTR(summaryview), container);
-               gtk_arrow_set(GTK_ARROW(summaryview->toggle_arrow),
-                             GTK_ARROW_UP, GTK_SHADOW_OUT);
        } else {
                mainwin->messageview->visible = TRUE;
                gtk_widget_reparent(GTK_WIDGET_PTR(summaryview), vpaned);
                gtk_container_add(GTK_CONTAINER(container), vpaned);
                gtk_widget_unref(vpaned);
        } else {
                mainwin->messageview->visible = TRUE;
                gtk_widget_reparent(GTK_WIDGET_PTR(summaryview), vpaned);
                gtk_container_add(GTK_CONTAINER(container), vpaned);
                gtk_widget_unref(vpaned);
-               gtk_arrow_set(GTK_ARROW(summaryview->toggle_arrow),
-                             GTK_ARROW_DOWN, GTK_SHADOW_OUT);
        }
 
        }
 
+       if (messageview_is_visible(mainwin->messageview))
+               gtk_arrow_set(GTK_ARROW(mainwin->summaryview->toggle_arrow),
+                             GTK_ARROW_DOWN, GTK_SHADOW_OUT);
+       else
+               gtk_arrow_set(GTK_ARROW(mainwin->summaryview->toggle_arrow),
+                             GTK_ARROW_UP, GTK_SHADOW_OUT);
+
        if (mainwin->messageview->visible == FALSE)
                messageview_clear(mainwin->messageview);
 
        if (mainwin->messageview->visible == FALSE)
                messageview_clear(mainwin->messageview);
 
@@ -1982,6 +1994,16 @@ static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
 
        debug_print("Setting widgets... ");
 
 
        debug_print("Setting widgets... ");
 
+       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
+                                   prefs_common.folderview_width,
+                                   prefs_common.folderview_height);
+       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
+                                   prefs_common.summaryview_width,
+                                   prefs_common.summaryview_height);
+       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
+                                   prefs_common.msgview_width,
+                                   prefs_common.msgview_height);
+
        /* create separated window(s) if needed */
        if (type & SEPARATE_FOLDER) {
                folderwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        /* create separated window(s) if needed */
        if (type & SEPARATE_FOLDER) {
                folderwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -2025,16 +2047,6 @@ static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
                mainwin->messageview->statusbar_cid = mainwin->messageview_cid;
        }
 
                mainwin->messageview->statusbar_cid = mainwin->messageview_cid;
        }
 
-       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
-                                   prefs_common.folderview_width,
-                                   prefs_common.folderview_height);
-       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
-                                   prefs_common.summaryview_width,
-                                   prefs_common.summaryview_height);
-       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
-                                   prefs_common.msgview_width,
-                                   prefs_common.msgview_height);
-
        switch (type) {
        case SEPARATE_NONE:
                hpaned = gtk_hpaned_new();
        switch (type) {
        case SEPARATE_NONE:
                hpaned = gtk_hpaned_new();
@@ -2138,6 +2150,13 @@ static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
                break;
        }
 
                break;
        }
 
+       if (messageview_is_visible(mainwin->messageview))
+               gtk_arrow_set(GTK_ARROW(mainwin->summaryview->toggle_arrow),
+                             GTK_ARROW_DOWN, GTK_SHADOW_OUT);
+       else
+               gtk_arrow_set(GTK_ARROW(mainwin->summaryview->toggle_arrow),
+                             GTK_ARROW_UP, GTK_SHADOW_OUT);
+
        gtk_window_move(GTK_WINDOW(mainwin->window),
                        prefs_common.mainwin_x,
                        prefs_common.mainwin_y);
        gtk_window_move(GTK_WINDOW(mainwin->window),
                        prefs_common.mainwin_x,
                        prefs_common.mainwin_y);
@@ -2168,9 +2187,9 @@ static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
        gtk_widget_set_sensitive(menuitem, ((type & SEPARATE_FOLDER) != 0));
        menuitem = gtk_item_factory_get_item
                (ifactory, "/View/Show or hide/Message view");
        gtk_widget_set_sensitive(menuitem, ((type & SEPARATE_FOLDER) != 0));
        menuitem = gtk_item_factory_get_item
                (ifactory, "/View/Show or hide/Message view");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                      (type & SEPARATE_MESSAGE) == 0 ? TRUE :
-                                      prefs_common.msgview_visible);
+       gtk_check_menu_item_set_active
+               (GTK_CHECK_MENU_ITEM(menuitem),
+                messageview_is_visible(mainwin->messageview));
 
        menuitem = gtk_item_factory_get_item
                (ifactory, "/View/Separate folder tree");
 
        menuitem = gtk_item_factory_get_item
                (ifactory, "/View/Separate folder tree");
index d915de2d48b95bb377979758ba5a5953f875b315..b553630cdb9a9412b67d03b3a1b483d3ab765ab3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 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
  *
  * 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
@@ -24,7 +24,6 @@
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtkvbox.h>
 #include <gtk/gtkcontainer.h>
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtkvbox.h>
 #include <gtk/gtkcontainer.h>
-#include <gtk/gtkeditable.h>
 #include <gtk/gtkwindow.h>
 #include <gtk/gtktext.h>
 #include <gtk/gtkmenu.h>
 #include <gtk/gtkwindow.h>
 #include <gtk/gtktext.h>
 #include <gtk/gtkmenu.h>
@@ -166,95 +165,95 @@ static GtkItemFactoryEntry msgview_entries[] =
 
        {N_("/_View"),                  NULL, NULL, 0, "<Branch>"},
 
 
        {N_("/_View"),                  NULL, NULL, 0, "<Branch>"},
 
-#define CODESET_SEPARATOR \
-       {N_("/_View/_Code set/---"),    NULL, NULL, 0, "<Separator>"}
-#define CODESET_ACTION(action) \
-       NULL, set_charset_cb, action, "/View/Code set/Auto detect"
+#define ENC_SEPARATOR \
+       {N_("/_View/Character _encoding/---"),  NULL, NULL, 0, "<Separator>"}
+#define ENC_ACTION(action) \
+       NULL, set_charset_cb, action, "/View/Character encoding/Auto detect"
 
 
-       {N_("/_View/_Code set"),        NULL, NULL, 0, "<Branch>"},
-       {N_("/_View/_Code set/_Auto detect"),
+       {N_("/_View/Character _encoding"),      NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/_Auto detect"),
                                        NULL, set_charset_cb, C_AUTO, "<RadioItem>"},
                                        NULL, set_charset_cb, C_AUTO, "<RadioItem>"},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/7bit ascii (US-ASC_II)"),
-        CODESET_ACTION(C_US_ASCII)},
-
-       {N_("/_View/_Code set/Unicode (_UTF-8)"),
-        CODESET_ACTION(C_UTF_8)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Western European (ISO-8859-_1)"),
-        CODESET_ACTION(C_ISO_8859_1)},
-       {N_("/_View/_Code set/Western European (ISO-8859-15)"),
-        CODESET_ACTION(C_ISO_8859_15)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Central European (ISO-8859-_2)"),
-        CODESET_ACTION(C_ISO_8859_2)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/_Baltic (ISO-8859-13)"),
-        CODESET_ACTION(C_ISO_8859_13)},
-       {N_("/_View/_Code set/Baltic (ISO-8859-_4)"),
-        CODESET_ACTION(C_ISO_8859_4)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Greek (ISO-8859-_7)"),
-        CODESET_ACTION(C_ISO_8859_7)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Turkish (ISO-8859-_9)"),
-        CODESET_ACTION(C_ISO_8859_9)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Cyrillic (ISO-8859-_5)"),
-        CODESET_ACTION(C_ISO_8859_5)},
-       {N_("/_View/_Code set/Cyrillic (KOI8-_R)"),
-        CODESET_ACTION(C_KOI8_R)},
-       {N_("/_View/_Code set/Cyrillic (KOI8-U)"),
-        CODESET_ACTION(C_KOI8_U)},
-       {N_("/_View/_Code set/Cyrillic (Windows-1251)"),
-        CODESET_ACTION(C_CP1251)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Japanese (ISO-2022-_JP)"),
-        CODESET_ACTION(C_ISO_2022_JP)},
-       {N_("/_View/_Code set/Japanese (ISO-2022-JP-2)"),
-        CODESET_ACTION(C_ISO_2022_JP_2)},
-       {N_("/_View/_Code set/Japanese (_EUC-JP)"),
-        CODESET_ACTION(C_EUC_JP)},
-       {N_("/_View/_Code set/Japanese (_Shift__JIS)"),
-        CODESET_ACTION(C_SHIFT_JIS)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Simplified Chinese (_GB2312)"),
-        CODESET_ACTION(C_GB2312)},
-       {N_("/_View/_Code set/Traditional Chinese (_Big5)"),
-        CODESET_ACTION(C_BIG5)},
-       {N_("/_View/_Code set/Traditional Chinese (EUC-_TW)"),
-        CODESET_ACTION(C_EUC_TW)},
-       {N_("/_View/_Code set/Chinese (ISO-2022-_CN)"),
-        CODESET_ACTION(C_ISO_2022_CN)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Korean (EUC-_KR)"),
-        CODESET_ACTION(C_EUC_KR)},
-       {N_("/_View/_Code set/Korean (ISO-2022-KR)"),
-        CODESET_ACTION(C_ISO_2022_KR)},
-       CODESET_SEPARATOR,
-       {N_("/_View/_Code set/Thai (TIS-620)"),
-        CODESET_ACTION(C_TIS_620)},
-       {N_("/_View/_Code set/Thai (Windows-874)"),
-        CODESET_ACTION(C_WINDOWS_874)},
-
-#undef CODESET_SEPARATOR
-#undef CODESET_ACTION
-
-#define DECODE_SEPARATOR \
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/7bit ascii (US-ASC_II)"),
+        ENC_ACTION(C_US_ASCII)},
+
+       {N_("/_View/Character _encoding/Unicode (_UTF-8)"),
+        ENC_ACTION(C_UTF_8)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Western European (ISO-8859-_1)"),
+        ENC_ACTION(C_ISO_8859_1)},
+       {N_("/_View/Character _encoding/Western European (ISO-8859-15)"),
+        ENC_ACTION(C_ISO_8859_15)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Central European (ISO-8859-_2)"),
+        ENC_ACTION(C_ISO_8859_2)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/_Baltic (ISO-8859-13)"),
+        ENC_ACTION(C_ISO_8859_13)},
+       {N_("/_View/Character _encoding/Baltic (ISO-8859-_4)"),
+        ENC_ACTION(C_ISO_8859_4)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Greek (ISO-8859-_7)"),
+        ENC_ACTION(C_ISO_8859_7)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Turkish (ISO-8859-_9)"),
+        ENC_ACTION(C_ISO_8859_9)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Cyrillic (ISO-8859-_5)"),
+        ENC_ACTION(C_ISO_8859_5)},
+       {N_("/_View/Character _encoding/Cyrillic (KOI8-_R)"),
+        ENC_ACTION(C_KOI8_R)},
+       {N_("/_View/Character _encoding/Cyrillic (KOI8-U)"),
+        ENC_ACTION(C_KOI8_U)},
+       {N_("/_View/Character _encoding/Cyrillic (Windows-1251)"),
+        ENC_ACTION(C_CP1251)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Japanese (ISO-2022-_JP)"),
+        ENC_ACTION(C_ISO_2022_JP)},
+       {N_("/_View/Character _encoding/Japanese (ISO-2022-JP-2)"),
+        ENC_ACTION(C_ISO_2022_JP_2)},
+       {N_("/_View/Character _encoding/Japanese (_EUC-JP)"),
+        ENC_ACTION(C_EUC_JP)},
+       {N_("/_View/Character _encoding/Japanese (_Shift__JIS)"),
+        ENC_ACTION(C_SHIFT_JIS)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Simplified Chinese (_GB2312)"),
+        ENC_ACTION(C_GB2312)},
+       {N_("/_View/Character _encoding/Traditional Chinese (_Big5)"),
+        ENC_ACTION(C_BIG5)},
+       {N_("/_View/Character _encoding/Traditional Chinese (EUC-_TW)"),
+        ENC_ACTION(C_EUC_TW)},
+       {N_("/_View/Character _encoding/Chinese (ISO-2022-_CN)"),
+        ENC_ACTION(C_ISO_2022_CN)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Korean (EUC-_KR)"),
+        ENC_ACTION(C_EUC_KR)},
+       {N_("/_View/Character _encoding/Korean (ISO-2022-KR)"),
+        ENC_ACTION(C_ISO_2022_KR)},
+       ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Thai (TIS-620)"),
+        ENC_ACTION(C_TIS_620)},
+       {N_("/_View/Character _encoding/Thai (Windows-874)"),
+        ENC_ACTION(C_WINDOWS_874)},
+
+#undef ENC_SEPARATOR
+#undef ENC_ACTION
+
+#define DEC_SEPARATOR \
        {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"}
        {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"}
-#define DECODE_ACTION(action) \
+#define DEC_ACTION(action) \
         NULL, set_decode_cb, action, "/View/Decode/Auto detect"
        {N_("/_View/Decode"),           NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Decode/_Auto detect"),
         NULL, set_decode_cb, 0, "<RadioItem>"},
        {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"},
         NULL, set_decode_cb, action, "/View/Decode/Auto detect"
        {N_("/_View/Decode"),           NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Decode/_Auto detect"),
         NULL, set_decode_cb, 0, "<RadioItem>"},
        {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"},
-       {N_("/_View/Decode/_8bit"),             DECODE_ACTION(ENC_8BIT)},
-       {N_("/_View/Decode/_Quoted printable"), DECODE_ACTION(ENC_QUOTED_PRINTABLE)},
-       {N_("/_View/Decode/_Base64"),           DECODE_ACTION(ENC_BASE64)},
-       {N_("/_View/Decode/_Uuencode"),         DECODE_ACTION(ENC_X_UUENCODE)},
+       {N_("/_View/Decode/_8bit"),             DEC_ACTION(ENC_8BIT)},
+       {N_("/_View/Decode/_Quoted printable"), DEC_ACTION(ENC_QUOTED_PRINTABLE)},
+       {N_("/_View/Decode/_Base64"),           DEC_ACTION(ENC_BASE64)},
+       {N_("/_View/Decode/_Uuencode"),         DEC_ACTION(ENC_X_UUENCODE)},
 
 
-#undef DECODE_SEPARATOR
-#undef DECODE_ACTION
+#undef DEC_SEPARATOR
+#undef DEC_ACTION
 
        {N_("/_View/---"),              NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Mess_age source"),  NULL, view_source_cb, 0, NULL},
 
        {N_("/_View/---"),              NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Mess_age source"),  NULL, view_source_cb, 0, NULL},
@@ -920,28 +919,17 @@ void messageview_copy_clipboard(MessageView *messageview)
 void messageview_select_all(MessageView *messageview)
 {
        TextView *text;
 void messageview_select_all(MessageView *messageview)
 {
        TextView *text;
-       GtkTextView *edit = NULL;
-       GtkTextBuffer *textbuf;
-       gint body_pos = 0;
-       GtkTextIter start, end;
-       
-       g_return_if_fail(messageview != NULL);
 
        text = messageview_get_current_textview(messageview);
 
        text = messageview_get_current_textview(messageview);
-       g_return_if_fail(text != NULL);
-
-       edit = GTK_TEXT_VIEW(text->text);
-       g_return_if_fail(edit != NULL);
-
-       textbuf = gtk_text_view_get_buffer(edit);
-       g_return_if_fail(textbuf != NULL);
+       if (text) {
+               GtkTextView *textview = GTK_TEXT_VIEW(text->text);
+               GtkTextBuffer *buffer;
+               GtkTextIter start, end;
 
 
-       gtk_text_buffer_get_bounds(textbuf, &start, &end);
-       
-       gtk_text_buffer_move_mark_by_name(textbuf, 
-               "selection_bound", &start);
-       gtk_text_buffer_move_mark_by_name(textbuf, 
-               "insert", &end);
+               buffer = gtk_text_view_get_buffer(textview);
+               gtk_text_buffer_get_bounds(buffer, &start, &end);
+               gtk_text_buffer_select_range(buffer, &start, &end);
+       }
 }
 
 void messageview_set_position(MessageView *messageview, gint pos)
 }
 
 void messageview_set_position(MessageView *messageview, gint pos)
index f1cbb62cd81855f4f390ceac68d7eecc00716c90..dc69112e595fa21b458ed244476987c004462b5f 100644 (file)
 
 #if USE_GPGME
 
 
 #if USE_GPGME
 
-#include <string.h>
-#include <sys/types.h>
-#include <sys/mman.h>
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <glib.h>
 #include <glib/gi18n.h>
+#include <gdk/gdktypes.h>
 #include <gdk/gdkkeysyms.h>
 #include <gdk/gdkkeysyms.h>
+#include <gdk/gdkdisplay.h>
+#ifdef GDK_WINDOWING_X11
+#  include <gdk/gdkx.h>
+#endif /* GDK_WINDOWING_X11 */
 #include <gtk/gtkmain.h>
 #include <gtk/gtkwidget.h>
 #include <gtk/gtkwindow.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtkwidget.h>
 #include <gtk/gtkwindow.h>
@@ -39,9 +41,9 @@
 #include <gtk/gtkbutton.h>
 #include <gtk/gtkfilesel.h>
 #include <gtk/gtksignal.h>
 #include <gtk/gtkbutton.h>
 #include <gtk/gtkfilesel.h>
 #include <gtk/gtksignal.h>
-#ifdef GDK_WINDOWING_X11
-#include <gdk/gdkx.h>  /* GDK_DISPLAY() */
-#endif /* GDK_WINDOWING_X11 */
+#include <string.h>
+#include <sys/types.h>
+#include <sys/mman.h>
 
 #include "passphrase.h"
 #include "prefs_common.h"
 
 #include "passphrase.h"
 #include "prefs_common.h"
@@ -49,7 +51,7 @@
 #include "utils.h"
 #include "prefs_gpg.h"
 
 #include "utils.h"
 #include "prefs_gpg.h"
 
-static int grab_all = 0;
+static gboolean grab_all = FALSE;
 
 static gboolean pass_ack;
 static gchar *last_pass = NULL;
 
 static gboolean pass_ack;
 static gchar *last_pass = NULL;
@@ -66,14 +68,9 @@ static gchar* passphrase_mbox (const gchar *desc);
 static GtkWidget *create_description (const gchar *desc);
 
 void
 static GtkWidget *create_description (const gchar *desc);
 
 void
-gpgmegtk_set_passphrase_grab (gint yes)
+gpgmegtk_set_passphrase_grab(gint yes)
 {
 {
-#warning "passphrase grab does not work"       
-#if 0
     grab_all = yes;
     grab_all = yes;
-#else
-    grab_all = FALSE;
-#endif
 }
 
 static gchar*
 }
 
 static gchar*
@@ -129,40 +126,37 @@ passphrase_mbox (const gchar *desc)
     g_signal_connect(G_OBJECT(cancel_button), "clicked",
                     G_CALLBACK(passphrase_cancel_cb), NULL);
 
     g_signal_connect(G_OBJECT(cancel_button), "clicked",
                     G_CALLBACK(passphrase_cancel_cb), NULL);
 
-    if (grab_all)
-        g_object_set (G_OBJECT(window), "type", GTK_WINDOW_POPUP, NULL);
     gtk_window_set_position (GTK_WINDOW(window), GTK_WIN_POS_CENTER);
     if (grab_all)   
         gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
     
     gtk_widget_show_all(window);
 
     gtk_window_set_position (GTK_WINDOW(window), GTK_WIN_POS_CENTER);
     if (grab_all)   
         gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
     
     gtk_widget_show_all(window);
 
-    /* don't use XIM on entering passphrase */
-    gtkut_editable_disable_im(GTK_EDITABLE(pass_entry));
-
     if (grab_all) {
     if (grab_all) {
+        /* make sure that window is viewable
+        * FIXME: this is still not enough */
+        gtk_widget_show_now(window);
+       gdk_flush();
 #ifdef GDK_WINDOWING_X11
 #ifdef GDK_WINDOWING_X11
-        XGrabServer(GDK_DISPLAY());
+       gdk_x11_display_grab(gdk_display_get_default());
 #endif /* GDK_WINDOWING_X11 */
 #endif /* GDK_WINDOWING_X11 */
-        if ( grab_result = gdk_pointer_grab ( window->window, TRUE, 0,
-                                NULL, NULL, GDK_CURRENT_TIME)) {
+        if (gdk_pointer_grab(window->window, TRUE, 0,
+                             window->window, NULL, GDK_CURRENT_TIME)) {
 #ifdef GDK_WINDOWING_X11
 #ifdef GDK_WINDOWING_X11
-            XUngrabServer ( GDK_DISPLAY() );
+            gdk_x11_display_ungrab(gdk_display_get_default());
 #endif /* GDK_WINDOWING_X11 */
 #endif /* GDK_WINDOWING_X11 */
-            g_warning ("OOPS: Could not grab mouse (grab status %d)\n",
-                       grab_result);
-            gtk_widget_destroy (window);
+            g_warning("OOPS: Could not grab mouse\n");
+            gtk_widget_destroy(window);
             return NULL;
         }
             return NULL;
         }
-        if ( grab_result = gdk_keyboard_grab( window->window, FALSE, 
-                                               GDK_CURRENT_TIME )) {
-            gdk_pointer_ungrab (GDK_CURRENT_TIME);
+        if (gdk_keyboard_grab(window->window, FALSE, GDK_CURRENT_TIME)) {
+            gdk_display_pointer_ungrab(gdk_display_get_default(),
+                                      GDK_CURRENT_TIME);
 #ifdef GDK_WINDOWING_X11
 #ifdef GDK_WINDOWING_X11
-            XUngrabServer ( GDK_DISPLAY() );
+            gdk_x11_display_ungrab(gdk_display_get_default());
 #endif /* GDK_WINDOWING_X11 */
 #endif /* GDK_WINDOWING_X11 */
-            g_warning ("OOPS: Could not grab keyboard (grab status %d)\n",
-                       grab_result);
-            gtk_widget_destroy (window);
+            g_warning("OOPS: Could not grab keyboard\n");
+            gtk_widget_destroy(window);
             return NULL;
         }
     }
             return NULL;
         }
     }
@@ -170,11 +164,12 @@ passphrase_mbox (const gchar *desc)
     gtk_main();
 
     if (grab_all) {
     gtk_main();
 
     if (grab_all) {
+        gdk_display_keyboard_ungrab(gdk_display_get_default(),
+                                   GDK_CURRENT_TIME);
+        gdk_display_pointer_ungrab(gdk_display_get_default(), GDK_CURRENT_TIME);
 #ifdef GDK_WINDOWING_X11
 #ifdef GDK_WINDOWING_X11
-        XUngrabServer (GDK_DISPLAY());
+        gdk_x11_display_ungrab(gdk_display_get_default());
 #endif /* GDK_WINDOWING_X11 */
 #endif /* GDK_WINDOWING_X11 */
-        gdk_pointer_ungrab (GDK_CURRENT_TIME);
-        gdk_keyboard_ungrab (GDK_CURRENT_TIME);
         gdk_flush();
     }
 
         gdk_flush();
     }
 
index 492fb74aac7be86f7b45c18f22a8a005a15901de..6ece36ad4881613eba639d91228cef206a47a6a4 100644 (file)
@@ -147,6 +147,7 @@ static struct Message {
        GtkWidget *chkbtn_mbalnum;
        GtkWidget *chkbtn_disphdrpane;
        GtkWidget *chkbtn_disphdr;
        GtkWidget *chkbtn_mbalnum;
        GtkWidget *chkbtn_disphdrpane;
        GtkWidget *chkbtn_disphdr;
+       GtkWidget *chkbtn_html;
        GtkWidget *spinbtn_linespc;
        GtkObject *spinbtn_linespc_adj;
 
        GtkWidget *spinbtn_linespc;
        GtkObject *spinbtn_linespc_adj;
 
@@ -603,6 +604,9 @@ static PrefParam param[] = {
        {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
         &message.chkbtn_disphdr,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
         &message.chkbtn_disphdr,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"render_html", "TRUE", &prefs_common.render_html, P_BOOL,
+        &message.chkbtn_html,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"line_space", "2", &prefs_common.line_space, P_INT,
         &message.spinbtn_linespc,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
        {"line_space", "2", &prefs_common.line_space, P_INT,
         &message.spinbtn_linespc,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
@@ -1219,7 +1223,7 @@ static void prefs_send_create(void)
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
 
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
 
-       label_outcharset = gtk_label_new (_("Outgoing codeset"));
+       label_outcharset = gtk_label_new (_("Outgoing encoding"));
        gtk_widget_show (label_outcharset);
        gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
 
        gtk_widget_show (label_outcharset);
        gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
 
@@ -1241,31 +1245,43 @@ static void prefs_send_create(void)
 }
 
        SET_MENUITEM(_("Automatic (Recommended)"),       CS_AUTO);
 }
 
        SET_MENUITEM(_("Automatic (Recommended)"),       CS_AUTO);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("7bit ascii (US-ASCII)"),         CS_US_ASCII);
        SET_MENUITEM(_("7bit ascii (US-ASCII)"),         CS_US_ASCII);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Unicode (UTF-8)"),               CS_UTF_8);
        SET_MENUITEM(_("Unicode (UTF-8)"),               CS_UTF_8);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Western European (ISO-8859-1)"),  CS_ISO_8859_1);
        SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
        SET_MENUITEM(_("Western European (ISO-8859-1)"),  CS_ISO_8859_1);
        SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Central European (ISO-8859-2)"),  CS_ISO_8859_2);
        SET_MENUITEM(_("Central European (ISO-8859-2)"),  CS_ISO_8859_2);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Baltic (ISO-8859-13)"),           CS_ISO_8859_13);
        SET_MENUITEM(_("Baltic (ISO-8859-4)"),            CS_ISO_8859_4);
        SET_MENUITEM(_("Baltic (ISO-8859-13)"),           CS_ISO_8859_13);
        SET_MENUITEM(_("Baltic (ISO-8859-4)"),            CS_ISO_8859_4);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Greek (ISO-8859-7)"),             CS_ISO_8859_7);
        SET_MENUITEM(_("Greek (ISO-8859-7)"),             CS_ISO_8859_7);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Turkish (ISO-8859-9)"),           CS_ISO_8859_9);
        SET_MENUITEM(_("Turkish (ISO-8859-9)"),           CS_ISO_8859_9);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),          CS_ISO_8859_5);
        SET_MENUITEM(_("Cyrillic (KOI8-R)"),             CS_KOI8_R);
        SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),          CS_ISO_8859_5);
        SET_MENUITEM(_("Cyrillic (KOI8-R)"),             CS_KOI8_R);
-       SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_WINDOWS_1251);
        SET_MENUITEM(_("Cyrillic (KOI8-U)"),             CS_KOI8_U);
        SET_MENUITEM(_("Cyrillic (KOI8-U)"),             CS_KOI8_U);
+       SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_WINDOWS_1251);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Japanese (ISO-2022-JP)"),        CS_ISO_2022_JP);
 #if 0
        SET_MENUITEM(_("Japanese (EUC-JP)"),             CS_EUC_JP);
        SET_MENUITEM(_("Japanese (Shift_JIS)"),          CS_SHIFT_JIS);
 #endif /* 0 */
        SET_MENUITEM(_("Japanese (ISO-2022-JP)"),        CS_ISO_2022_JP);
 #if 0
        SET_MENUITEM(_("Japanese (EUC-JP)"),             CS_EUC_JP);
        SET_MENUITEM(_("Japanese (Shift_JIS)"),          CS_SHIFT_JIS);
 #endif /* 0 */
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Simplified Chinese (GB2312)"),   CS_GB2312);
        SET_MENUITEM(_("Traditional Chinese (Big5)"),    CS_BIG5);
 #if 0
        SET_MENUITEM(_("Traditional Chinese (EUC-TW)"),  CS_EUC_TW);
        SET_MENUITEM(_("Chinese (ISO-2022-CN)"),         CS_ISO_2022_CN);
 #endif /* 0 */
        SET_MENUITEM(_("Simplified Chinese (GB2312)"),   CS_GB2312);
        SET_MENUITEM(_("Traditional Chinese (Big5)"),    CS_BIG5);
 #if 0
        SET_MENUITEM(_("Traditional Chinese (EUC-TW)"),  CS_EUC_TW);
        SET_MENUITEM(_("Chinese (ISO-2022-CN)"),         CS_ISO_2022_CN);
 #endif /* 0 */
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Korean (EUC-KR)"),               CS_EUC_KR);
        SET_MENUITEM(_("Korean (EUC-KR)"),               CS_EUC_KR);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Thai (TIS-620)"),                CS_TIS_620);
        SET_MENUITEM(_("Thai (Windows-874)"),            CS_WINDOWS_874);
 
        SET_MENUITEM(_("Thai (TIS-620)"),                CS_TIS_620);
        SET_MENUITEM(_("Thai (Windows-874)"),            CS_WINDOWS_874);
 
@@ -1753,6 +1769,7 @@ static void prefs_message_create(void)
        GtkWidget *chkbtn_disphdrpane;
        GtkWidget *chkbtn_disphdr;
        GtkWidget *button_edit_disphdr;
        GtkWidget *chkbtn_disphdrpane;
        GtkWidget *chkbtn_disphdr;
        GtkWidget *button_edit_disphdr;
+       GtkWidget *chkbtn_html;
        GtkWidget *hbox_linespc;
        GtkWidget *label_linespc;
        GtkObject *spinbtn_linespc_adj;
        GtkWidget *hbox_linespc;
        GtkWidget *label_linespc;
        GtkObject *spinbtn_linespc_adj;
@@ -1805,6 +1822,9 @@ static void prefs_message_create(void)
 
        SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
 
 
        SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
 
+       PACK_CHECK_BUTTON(vbox2, chkbtn_html,
+                         _("Render HTML messages as text"));
+
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
 
        hbox1 = gtk_hbox_new (FALSE, 32);
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
 
        hbox1 = gtk_hbox_new (FALSE, 32);
@@ -1883,6 +1903,7 @@ static void prefs_message_create(void)
        message.chkbtn_mbalnum     = chkbtn_mbalnum;
        message.chkbtn_disphdrpane = chkbtn_disphdrpane;
        message.chkbtn_disphdr     = chkbtn_disphdr;
        message.chkbtn_mbalnum     = chkbtn_mbalnum;
        message.chkbtn_disphdrpane = chkbtn_disphdrpane;
        message.chkbtn_disphdr     = chkbtn_disphdr;
+       message.chkbtn_html        = chkbtn_html;
        message.spinbtn_linespc    = spinbtn_linespc;
 
        message.chkbtn_smoothscroll    = chkbtn_smoothscroll;
        message.spinbtn_linespc    = spinbtn_linespc;
 
        message.chkbtn_smoothscroll    = chkbtn_smoothscroll;
@@ -2894,7 +2915,7 @@ static void prefs_common_charset_set_optmenu(PrefParam *pparam)
        g_return_if_fail(*((gchar **)pparam->data) != NULL);
 
        index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
        g_return_if_fail(*((gchar **)pparam->data) != NULL);
 
        index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
-                                           (GCompareFunc)strcmp);
+                                           (GCompareFunc)strcmp2);
        if (index >= 0)
                gtk_option_menu_set_history(optmenu, index);
        else {
        if (index >= 0)
                gtk_option_menu_set_history(optmenu, index);
        else {
index 081d408c61bf641cab05e6c28fe21fbe82540726..1944f134399744f7c2e5ef758401d1fdf5dd07a7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 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
  *
  * 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
@@ -231,6 +231,7 @@ struct _PrefsCommon
        gboolean display_header_pane;
        gboolean display_header;
        gint line_space;
        gboolean display_header_pane;
        gboolean display_header;
        gint line_space;
+       gboolean render_html;
        gboolean enable_smooth_scroll;
        gint scroll_step;
        gboolean scroll_halfpage;
        gboolean enable_smooth_scroll;
        gint scroll_step;
        gboolean scroll_halfpage;
index 398f93bf893bff8fb37eb37663f05e41633e6ac4..15b9e0bce833c1edfd61cb0f34d2f1d8fc619060 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 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
  *
  * 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
@@ -166,7 +166,7 @@ gint procheader_get_one_field_asis(gchar *buf, size_t len, FILE *fp)
 }
 
 #if 0
 }
 
 #if 0
-gchar *procheader_get_unfolded_line(gchar *buf, gint len, FILE *fp)
+gchar *procheader_get_unfolded_line(gchar *buf, size_t len, FILE *fp)
 {
        gboolean folded = FALSE;
        gint nexthead;
 {
        gboolean folded = FALSE;
        gint nexthead;
@@ -190,13 +190,13 @@ gchar *procheader_get_unfolded_line(gchar *buf, gint len, FILE *fp)
                else if (nexthead == EOF)
                        break;
                else if (folded == TRUE) {
                else if (nexthead == EOF)
                        break;
                else if (folded == TRUE) {
-                       if (nexthead == '\r' || nexthead == '\n') {
+                       if ((len - (bufp - buf)) <= 2) break;
+
+                       if (nexthead == '\n') {
                                folded = FALSE;
                                continue;
                        }
 
                                folded = FALSE;
                                continue;
                        }
 
-                       if ((len - (bufp - buf)) <= 2) break;
-
                        /* replace return code on the tail end
                           with space */
                        *bufp++ = ' ';
                        /* replace return code on the tail end
                           with space */
                        *bufp++ = ' ';
@@ -808,6 +808,10 @@ static gint procheader_scan_date_string(const gchar *str,
                        weekday, day, month, year, hh, mm, ss);
        if (result == 7) return 0;
 
                        weekday, day, month, year, hh, mm, ss);
        if (result == 7) return 0;
 
+       result = sscanf(str, "%d %9s %d %2d:%2d:%2d",
+                       day, month, year, hh, mm, ss);
+       if (result == 6) return 0;
+
        *ss = 0;
        result = sscanf(str, "%10s %d %9s %d %2d:%2d %5s",
                        weekday, day, month, year, hh, mm, zone);
        *ss = 0;
        result = sscanf(str, "%10s %d %9s %d %2d:%2d %5s",
                        weekday, day, month, year, hh, mm, zone);
@@ -817,6 +821,15 @@ static gint procheader_scan_date_string(const gchar *str,
                        day, month, year, hh, mm, zone);
        if (result == 6) return 0;
 
                        day, month, year, hh, mm, zone);
        if (result == 6) return 0;
 
+       *zone = '\0';
+       result = sscanf(str, "%10s %d %9s %d %2d:%2d",
+                       weekday, day, month, year, hh, mm);
+       if (result == 6) return 0;
+
+       result = sscanf(str, "%d %9s %d %2d:%2d",
+                       day, month, year, hh, mm);
+       if (result == 5) return 0;
+
        return -1;
 }
 
        return -1;
 }
 
index 3bc45cafcbdd5f5c7acaa724e89284e82f34bbf2..3e8ba50590ec17d73a9980291c7026270cb93aa0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 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
  *
  * 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
@@ -2401,12 +2401,13 @@ static void summary_display_msg_full(SummaryView *summaryview,
                msgview = summaryview->messageview;
 
                summaryview->displayed = row;
                msgview = summaryview->messageview;
 
                summaryview->displayed = row;
-               if (!messageview_is_visible(msgview))
+               if (!messageview_is_visible(msgview)) {
                        main_window_toggle_message_view(summaryview->mainwin);
                        main_window_toggle_message_view(summaryview->mainwin);
+                       GTK_EVENTS_FLUSH();
+               }
                val = messageview_show(msgview, msginfo, all_headers);
                if (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL)
                        gtk_widget_grab_focus(summaryview->ctree);
                val = messageview_show(msgview, msginfo, all_headers);
                if (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL)
                        gtk_widget_grab_focus(summaryview->ctree);
-               GTK_EVENTS_FLUSH();
                gtkut_ctree_node_move_if_on_the_edge(ctree, row);
        }
 
                gtkut_ctree_node_move_if_on_the_edge(ctree, row);
        }
 
@@ -2492,37 +2493,37 @@ void summary_reedit(SummaryView *summaryview)
        compose_reedit(msginfo);
 }
 
        compose_reedit(msginfo);
 }
 
-void summary_step(SummaryView *summaryview, GtkScrollType type)
+gboolean summary_step(SummaryView *summaryview, GtkScrollType type)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCTreeNode *node;
 
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCTreeNode *node;
 
-       if (summary_is_locked(summaryview)) return;
+       if (summary_is_locked(summaryview)) return FALSE;
 
        if (type == GTK_SCROLL_STEP_FORWARD) {
                node = gtkut_ctree_node_next(ctree, summaryview->selected);
                if (node)
                        gtkut_ctree_expand_parent_all(ctree, node);
                else
 
        if (type == GTK_SCROLL_STEP_FORWARD) {
                node = gtkut_ctree_node_next(ctree, summaryview->selected);
                if (node)
                        gtkut_ctree_expand_parent_all(ctree, node);
                else
-                       return;
+                       return FALSE;
        } else {
                if (summaryview->selected) {
                        node = GTK_CTREE_NODE_PREV(summaryview->selected);
        } else {
                if (summaryview->selected) {
                        node = GTK_CTREE_NODE_PREV(summaryview->selected);
-                       if (!node) return;
+                       if (!node) return FALSE;
                }
        }
 
        if (messageview_is_visible(summaryview->messageview))
                summaryview->display_msg = TRUE;
 
                }
        }
 
        if (messageview_is_visible(summaryview->messageview))
                summaryview->display_msg = TRUE;
 
-       g_signal_emit_by_name(G_OBJECT(ctree), "scroll_vertical",
-                             type, 0.0);
+       g_signal_emit_by_name(G_OBJECT(ctree), "scroll_vertical", type, 0.0);
 
        if (GTK_CLIST(ctree)->selection)
                gtk_sctree_set_anchor_row
                        (GTK_SCTREE(ctree),
                         GTK_CTREE_NODE(GTK_CLIST(ctree)->selection->data));
 
 
        if (GTK_CLIST(ctree)->selection)
                gtk_sctree_set_anchor_row
                        (GTK_SCTREE(ctree),
                         GTK_CTREE_NODE(GTK_CLIST(ctree)->selection->data));
 
+       return TRUE;
 }
 
 void summary_toggle_view(SummaryView *summaryview)
 }
 
 void summary_toggle_view(SummaryView *summaryview)
@@ -3256,6 +3257,8 @@ void summary_copy_selected_to(SummaryView *summaryview, FolderItem *to_folder)
        folder_item_update_thaw();
        gtk_clist_thaw(GTK_CLIST(summaryview->ctree));
 
        folder_item_update_thaw();
        gtk_clist_thaw(GTK_CLIST(summaryview->ctree));
 
+       summary_step(summaryview, GTK_SCROLL_STEP_FORWARD);
+
        if (prefs_common.immediate_exec)
                summary_execute(summaryview);
        else {
        if (prefs_common.immediate_exec)
                summary_execute(summaryview);
        else {
@@ -4398,7 +4401,7 @@ void summary_pass_key_press_event(SummaryView *summaryview, GdkEventKey *event)
        if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
 
 static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
 
 static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
-                               SummaryView *summaryview)
+                                   SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(widget);
        GtkCTreeNode *node;
 {
        GtkCTree *ctree = GTK_CTREE(widget);
        GtkCTreeNode *node;
@@ -4478,6 +4481,9 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        messageview = summaryview->messageview;
        textview = messageview->mimeview->textview;
 
        messageview = summaryview->messageview;
        textview = messageview->mimeview->textview;
 
+       mod_pressed =
+               ((event->state & (GDK_SHIFT_MASK|GDK_MOD1_MASK)) != 0);
+
        switch (event->keyval) {
        case GDK_space:         /* Page down or go to the next */
                if (event->state & GDK_SHIFT_MASK) 
        switch (event->keyval) {
        case GDK_space:         /* Page down or go to the next */
                if (event->state & GDK_SHIFT_MASK) 
@@ -4488,8 +4494,6 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                                    summaryview->selected);
                                break;
                        }
                                                    summaryview->selected);
                                break;
                        }
-                       mod_pressed = ((event->state & 
-                                       (GDK_SHIFT_MASK|GDK_MOD1_MASK)) != 0);
                        if (mod_pressed) {
                                if (!textview_scroll_page(textview, TRUE))
                                        summary_select_prev_unread(summaryview);
                        if (mod_pressed) {
                                if (!textview_scroll_page(textview, TRUE))
                                        summary_select_prev_unread(summaryview);
@@ -4508,9 +4512,7 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                            summaryview->selected);
                        break;
                }
                                            summaryview->selected);
                        break;
                }
-               textview_scroll_one_line
-                       (textview, (event->state &
-                                   (GDK_SHIFT_MASK|GDK_MOD1_MASK)) != 0);
+               textview_scroll_one_line(textview, mod_pressed);
                break;
        case GDK_Delete:
                BREAK_ON_MODIFIER_KEY();
                break;
        case GDK_Delete:
                BREAK_ON_MODIFIER_KEY();
index a8fc6a7da109322b948826018ddaa8152f722d9c..608210aad4c89990bc1cdf6b0b2078aec6d9f031 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 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
  *
  * 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
@@ -228,7 +228,7 @@ void summary_redisplay_msg    (SummaryView          *summaryview);
 void summary_open_msg            (SummaryView          *summaryview);
 void summary_view_source         (SummaryView          *summaryview);
 void summary_reedit              (SummaryView          *summaryview);
 void summary_open_msg            (SummaryView          *summaryview);
 void summary_view_source         (SummaryView          *summaryview);
 void summary_reedit              (SummaryView          *summaryview);
-void summary_step                (SummaryView          *summaryview,
+gboolean summary_step            (SummaryView          *summaryview,
                                   GtkScrollType         type);
 void summary_toggle_view         (SummaryView          *summaryview);
 void summary_set_marks_selected          (SummaryView          *summaryview);
                                   GtkScrollType         type);
 void summary_toggle_view         (SummaryView          *summaryview);
 void summary_set_marks_selected          (SummaryView          *summaryview);
index 6d8faf0d64e7d1b6932e035c6183e03e4f19c84d..a83eccb0054d83659c8860f82d7e35fc323634ea 100644 (file)
@@ -694,7 +694,8 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
 
        procmime_decode_content(mimeinfo);
 
 
        procmime_decode_content(mimeinfo);
 
-       if (!g_ascii_strcasecmp(mimeinfo->subtype, "html")) {
+       if (!g_ascii_strcasecmp(mimeinfo->subtype, "html") &&
+           prefs_common.render_html) {
                gchar *filename;
                
                filename = procmime_get_tmp_file_name(mimeinfo);
                gchar *filename;
                
                filename = procmime_get_tmp_file_name(mimeinfo);
@@ -758,6 +759,7 @@ static void textview_show_html(TextView *textview, FILE *fp,
                } else
                        textview_write_line(textview, str, NULL);
        }
                } else
                        textview_write_line(textview, str, NULL);
        }
+       textview_write_line(textview, "\n", NULL);
        html_parser_destroy(parser);
 }
 
        html_parser_destroy(parser);
 }