sync with sylpheed 0.5.3 release
authorPaul Mangan <paul@claws-mail.org>
Thu, 16 Aug 2001 11:28:10 +0000 (11:28 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 16 Aug 2001 11:28:10 +0000 (11:28 +0000)
28 files changed:
AUTHORS
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/addressbook.c
src/addressbook.h
src/folder.h
src/folderview.c
src/folderview.h
src/gtkutils.c
src/gtkutils.h
src/inc.c
src/inc.h
src/mainwindow.c
src/mainwindow.h
src/mbox_folder.c
src/pop.c
src/prefs_account.c
src/prefs_common.c
src/prefs_common.h
src/prefs_folder_item.c
src/procmsg.c
src/procmsg.h
src/summaryview.c
src/summaryview.h
src/textview.c
src/utils.c

diff --git a/AUTHORS b/AUTHORS
index 7fb46cf..1c6307f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,7 +7,7 @@ claws-branch (http://sylpheed-claws.sourceforge.net)
 
        Hoa viet Dinh           <dinh.viet.hoa@free.fr>
        Match Grun              <match@dimensional.com>
-        Christoph Hohmann       <reboot@gmx.ch>
+       Christoph Hohmann       <reboot@gmx.ch>
        Alfons Hoogervorst      <alfons@proteus.demon.nl>
        Darko Koruga            <darko.koruga@hermes.si>
        Paul Mangan             <claws@thewildbeast.co.uk>
@@ -77,3 +77,4 @@ contributors (beside the above; based on Changelog)
        Ricardo Mones Lastra
        Henrik Carlqvist
        Don Quijote
+       David Looney
index 34fbb9c..a74b082 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,143 @@
+2001-08-14
+
+       * version 0.5.3
+
+2001-08-14
+
+       * src/summaryview.c: summary_set_row_marks(): got the color of
+         unread row set properly.
+       * src/folderview.c: foldreview_update_node(): don't use
+         gtk_style_copy(), and reuse previously allocated styles.
+       * README, README.jp: modified.
+
+2001-08-14
+
+       * src/pop.c: pop3_getsize_list_recv(): fixed a remotly exploitable
+         memory corruption bug (thanks to David Looney).
+       * src/inc.c: inc_all_account_mail(): call inc_finished() even if
+         there are no enabled accounts, or local spool only.
+       * src/summaryview.c: applied the summary update improvement patch
+         from Sergey Vlasov (thanks!). It keeps the position of the
+         message displayed. Selected and displayed message are also kept.
+         summary_get_msgnum(): new.
+         summary_get_current_msgnum(): removed.
+         summary_select_by_msgnum(): don't display the message.
+       * src/account.c: added "Get all" column.
+         account_clist_set_row(): show default and get-all flags with the
+         mark icon.
+       * src/utils.c: to_human_readable(): increased the number of decimals
+         of MB and GB to 2.
+
+2001-08-13
+
+       * implemented the long-awaited :) "Add sender to address book" feature.
+       * src/address.[ch]: added the argument for remarks to
+         address_item_new().
+         address_get_folder_list(): new. It traverses the address tree and
+         returns the folder list.
+         address_delete_object(): modified so that it removes the node
+         from the tree.
+       * src/addressbook.[ch]: addressbook_add_submenu(): new. It creates
+         a address folder menu and attaches it to the menu item.
+         addressbook_refresh(): reload the address book folder tree.
+       * src/summaryview.c: summary_set_add_sender_menu(): new. It attaches
+         the menu to add sender to address book.
+         summary_button_pressed(): call summary_set_add_sender_menu()
+         before popup the menu.
+
+2001-08-12
+
+       * src/summaryview.c: summary_thread_build(): fixed a bug that locked
+         up the process. Optimized the initial thread build.
+
+2001-08-12
+
+       * src/summaryview.c: made many code cleanups.
+         summary_show(): block/unblock the signal handlers instead of
+         disconnect/connect them.
+         summary_set_row_marks(): made the font of collapsed node bold if
+         it has cnildren marked as unread.
+         summary_thread_build(): block tree_expand signals while processing.
+         Use loop instead of the recursive function. Mark collapsed nodes
+         correctly.
+         summary_unthread(): block tree_collapse signals while processing.
+         Use loop instead of the recursive function.
+         summary_thread_func(), summary_unthread_func(): removed.
+         summary_tree_expanded(), summary_tree_collapsed(): new callback
+         functions.
+       * src/inc.[ch]: inc_pop3_session_do(): don't show alert panel when
+         failed to connect. Show more detailed status on the dialog.
+
+2001-08-10
+
+       * src/folderview.c: folderview_update_all_node(): new. It updates
+         all local folders.
+       * src/inc.c: update all local folders after incorporation if
+         scan_all_after_inc option is set.
+       * src/prefs_common.[ch]: added scan_all_after_inc option.
+       * src/folder.h: FOLDER_IS_LOCAL(): new macro.
+
+2001-08-09
+
+       * src/defs.h
+         src/headerview.c
+         src/headerwindow.c
+         src/textview.c
+         src/prefs_common.c
+         src/prefs_common.h: made bold and small font configurable.
+         src/summaryview.c: display unread messages with bold font.
+       * src/prefs_common.c
+         src/prefs_common.h
+         src/summaryview.c: added an option to enable/disable the
+         emphasis of unread messages.
+
+2001-08-08
+
+       * src/pixmaps/mark.xpm: modified.
+       * src/gtkutils.[ch]: gtkut_ctree_expand_parent_all(): new.
+       * src/summaryview.c: summary_set_ctree_from_list(): don't expand
+         the root messages of threads for performance improvement.
+         summary_show()
+         summary_select_next_unread()
+         summary_step(): expand threads when opening messages.
+         summary_thread_build(): expand threads if the option is turned on.
+       * src/prefs_common.[ch]: added "Expand threads" option.
+
+2001-08-08
+
+       * src/prefs_common.c: removed "Emulate the behavior of mouse
+         operation of Emacs-based mailer".
+       * src/prefs_common.c
+         src/prefs_account.c: changed the value of VSPACING_NARROW to 3.
+       * src/pixmaps/new.xpm
+         src/pixmaps/unread.xpm: reverted.
+
+2001-08-07
+
+       * src/address.[ch]:
+         address_folder_new()
+         address_group_new()
+         address_item_new(): changed the return value to AddressObject.
+         address_build_tree(): don't put assertion for file.
+       * src/pixmaps/new.xpm
+         src/pixmaps/unread.xpm: modified a bit.
+
+2001-08-06
+
+       * src/addressbook.c: fixed some bugs.
+
+2001-08-06
+
+       * separated the logic part of addressbook into another module
+         (still in progress).
+       * src/address.[ch]: new. It contains the logic part of addressbook.
+       * src/addressbook.[ch]: removed the logic part.
+
+2001-08-04
+
+       * src/textview.c: textview_show_header(): fixed a bug that a garbage
+         character was shown after header names.
+
 2001-08-02
 
        * src/inc.c: inc_start(): don't abort with non-fatal error.
index ee1bc1d..e049bc7 100644 (file)
@@ -1,3 +1,33 @@
+2001-08-16 [paul]
+
+       * configure.in
+               change to version 0.5.3claws
+
+       * src/folder.h, src/folderview.[ch], src/gtkutils.[ch],
+         src/inc.[ch], src/mainwindow.c, src/pop.c, src/prefs_account.c,
+         src/prefs_common.[ch], src/summaryview.[ch], src/textview.c, src/utils.c
+
+               sync with sylpheed 0.5.3 release, but keep claws method of
+               configuring/saving fonts
+
+       * src/addressbook.[ch]
+               rename addressbook_add_contact_by_menu() to addressbook_add_submenu()
+               in line with a similar change in Hiroyuki's branch
+
+       * src/mainwindow.[ch]
+               disable main_window_set_thread_option()
+       * src/prefs_folder_item.c
+               comment out &tmps_prefs.enable_thread,
+       * src/mbox_folder.c, src/procmsg.[ch]
+               comment out MSG_IS_IGNORE_THREAD
+       * src/summaryview.c
+               comment out summary_ignore_thread() and summary_unignore_thread()
+               comment out MSG_IS_IGNORE_THREAD
+
+                use Hiroyuki's threading instead.
+
+
+
 2001-08-15 [paul]
 
        * src/account.c
index 44fe8ba..529b3f9 100644 (file)
@@ -1,3 +1,144 @@
+2001-08-14
+
+       * version 0.5.3
+
+2001-08-14
+
+       * src/summaryview.c: summary_set_row_marks(): Ì¤ÆɤιԤ理¬Àµ¤·¤¯
+         »ØÄꤵ¤ì¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/folderview.c: foldreview_update_node(): gtk_style_copy() ¤ò
+         »ÈÍѤ»¤º¡¢¤¢¤é¤«¤¸¤á³ä¤êÅö¤Æ¤é¤ì¤¿ style ¤òºÆ»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * README, README.jp: ½¤Àµ¡£
+
+2001-08-14
+
+       * src/pop.c: pop3_getsize_list_recv(): ¥ê¥â¡¼¥È¤«¤é¹¶·â²Äǽ¤Ê
+         ¥á¥â¥êÇ˲õ¥Ð¥°¤ò½¤Àµ(David Looney ¤µ¤ó thanks)¡£
+       * src/inc.c: inc_all_account_mail(): Í­¸ú¤Ê¥¢¥«¥¦¥ó¥È¤¬¤Ê¤¤¡¢
+         ¤¢¤ë¤¤¤Ï¥í¡¼¥«¥ë¥¹¥×¡¼¥ë¤Î¤ß¤Î¾ì¹ç¤Ç¤â inc_finished() ¤ò¸Æ¤Ö
+         ¤è¤¦¤Ë¤·¤¿¡£
+       * src/summaryview.c: ¥µ¥Þ¥ê¤Î¹¹¿·¤ò²þÎɤ¹¤ë Sergey Vlasov ¤µ¤ó
+         ¤«¤é¤Î¥Ñ¥Ã¥Á¤òŬÍÑ(thanks!)¡£É½¼¨¤µ¤ì¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤Î°ÌÃÖ¤¬
+         ÊÝ»ý¤µ¤ì¤ë¡£ÁªÂò¡¢É½¼¨¤µ¤ì¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤âƱÍͤËÊÝ»ý¤µ¤ì¤ë¡£
+         summary_get_msgnum(): ¿·µ¬¡£
+         summary_get_current_msgnum(): ºï½ü¡£
+         summary_select_by_msgnum(): ¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+       * src/account.c: ¡ÖÁ´¼õ¿®¡×¥«¥é¥à¤òÄɲá£
+         account_clist_set_row(): Ä̾ï»ÈÍѤÈÁ´¼õ¿®¤Î¥Õ¥é¥°¤ò¥Þ¡¼¥¯¥¢¥¤¥³¥ó
+         ¤Çɽ¼¨¡£
+       * src/utils.c: to_human_readable(): MB ¤È GB ¤Î¾®¿ôÅÀ°Ê²¼¤Î·å¿ô
+         ¤ò 2 ¤ËÁý²Ã¡£
+
+2001-08-13
+
+       * ÂÔ˾¤Î :)¡Öº¹½Ð¿Í¤ò¥¢¥É¥ì¥¹Ä¢¤ËÄɲá׵¡Ç½¤ò¼ÂÁõ¡£
+       * src/address.[ch]: address_item_new() ¤ËÈ÷¹Í¤Î¤¿¤á¤Î°ú¿ô¤òÄɲá£
+         address_get_folder_list(): ¿·µ¬¡£¥¢¥É¥ì¥¹¥Ä¥ê¡¼¤ò¥È¥é¥Ð¡¼¥¹¤·¡¢
+         ¥Õ¥©¥ë¥À¤Î¥ê¥¹¥È¤òÊÖ¤¹¡£
+         address_delete_object(): ¥Ä¥ê¡¼¤«¤é¥Î¡¼¥É¤òºï½ü¤¹¤ë¤è¤¦¤Ë½¤Àµ¡£
+       * src/addressbook.[ch]: addressbook_add_submenu(): ¿·µ¬¡£¥¢¥É¥ì¥¹
+         ¥Õ¥©¥ë¥À¤Î¥á¥Ë¥å¡¼¤òºîÀ®¤·¡¢¤½¤ì¤ò¥á¥Ë¥å¡¼¥¢¥¤¥Æ¥à¤ËÉղ乤롣
+         addressbook_refresh(): ¥¢¥É¥ì¥¹Ä¢¤Î¥Õ¥©¥ë¥À¥Ä¥ê¡¼¤òºÆÆɹþ¤¹¤ë¡£
+       * src/summaryview.c: summary_set_add_sender_menu(): ¿·µ¬¡£º¹½Ð¿Í
+         ¤ò¥¢¥É¥ì¥¹Ä¢¤ËÄɲ乤뤿¤á¤Î¥á¥Ë¥å¡¼¤òÉղ乤롣
+         summary_button_pressed(): ¥á¥Ë¥å¡¼¤ò¥Ý¥Ã¥×¥¢¥Ã¥×¤¹¤ëÁ°¤Ë
+         summary_set_add_sender_menu() ¤ò¸Æ¤Ö¤è¤¦¤Ë¤·¤¿¡£
+
+2001-08-12
+
+       * src/summaryview.c: summary_thread_build(): ¥×¥í¥»¥¹¤ò¸Ç¤Þ¤é¤»¤ë
+         ¥Ð¥°¤ò½¤Àµ¡£½é´ü¤Î¥¹¥ì¥Ã¥É¹½ÃÛ¤òºÇŬ²½¡£
+
+2001-08-12
+
+       * src/summaryview.c: Â¿¿ô¤Î¥³¡¼¥É¤ÎÀ°Íý¤ò¹Ô¤Ã¤¿¡£
+         summary_show(): ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤òÀÚÃÇ/Àܳ¤¹¤ëÂå¤ï¤ê¤Ë¥Ö¥í¥Ã¥¯/
+         ¥Ö¥í¥Ã¥¯²ò½ü¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         summary_set_row_marks(): ÊĤ¸¤¿¥Î¡¼¥É¤¬Ì¤ÆÉ¥Þ¡¼¥¯¤ÎÉÕ¤¤¤¿»Ò¤ò
+         »ý¤Ã¤Æ¤¤¤ì¤Ð¥Õ¥©¥ó¥È¤ò¥Ü¡¼¥ë¥É¤Çɽ¼¨¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         summary_thread_build(): ½èÍýÃæ¤Ë tree_expand ¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯
+         ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£ºÆµ¢´Ø¿ô¤ÎÂå¤ï¤ê¤Ë¥ë¡¼¥×¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         ÊĤ¸¤¿¥Î¡¼¥É¤òÀµ¤·¤¯¥Þ¡¼¥¯¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         summary_unthread(): ½èÍýÃæ¤Ë tree_collapse ¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯
+         ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£ºÆµ¢´Ø¿ô¤ÎÂå¤ï¤ê¤Ë¥ë¡¼¥×¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         summary_thread_func(), summary_unthread_func(): ºï½ü¡£
+         summary_tree_expanded(), summary_tree_collapsed(): ¿·µ¬¥³¡¼¥ë
+         ¥Ð¥Ã¥¯´Ø¿ô¡£
+       * src/inc.[ch]: inc_pop3_session_do(): Àܳ¤Ë¼ºÇÔ¤·¤¿¤È¤­¤Ë·Ù¹ð¥Ñ¥Í¥ë
+         ¤òɽ¼¨¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£¥À¥¤¥¢¥í¥°¤Ë¤è¤ê¾ÜºÙ¤Ê¾õÂÖ¤òɽ¼¨¤¹¤ë
+         ¤è¤¦¤Ë¤·¤¿¡£
+
+2001-08-10
+
+       * src/folderview.c: folderview_update_all_node(): ¿·µ¬¡£Á´¤Æ¤Î
+         ¥í¡¼¥«¥ë¥Õ¥©¥ë¥À¤ò¹¹¿·¤¹¤ë¡£
+       * src/inc.c: scan_all_after_inc ¥ª¥×¥·¥ç¥ó¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð
+         ¼õ¿®¸å¤Ë¥í¡¼¥«¥ë¥Õ¥©¥ë¥À¤ò¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/prefs_common.[ch]: scan_all_after_inc ¥ª¥×¥·¥ç¥ó¤òÄɲá£
+       * src/folder.h: FOLDER_IS_LOCAL(): ¿·µ¬¥Þ¥¯¥í¡£
+
+2001-08-09
+
+       * src/defs.h
+         src/headerview.c
+         src/headerwindow.c
+         src/textview.c
+         src/prefs_common.c
+         src/prefs_common.h: ¥Ü¡¼¥ë¥É¤È¾®¥Õ¥©¥ó¥È¤òÀßÄê²Äǽ¤Ë¤·¤¿¡£
+         src/summaryview.c: Ì¤ÆÉ¥á¥Ã¥»¡¼¥¸¤ò¥Ü¡¼¥ë¥É¥Õ¥©¥ó¥È¤Çɽ¼¨¤¹¤ë
+         ¤è¤¦¤Ë¤·¤¿¡£
+       * src/prefs_common.c
+         src/prefs_common.h
+         src/summaryview.c: Ì¤ÆÉ¥á¥Ã¥»¡¼¥¸¤Î¶¯Ä´¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¥ª¥×¥·¥ç¥ó
+         ¤òÄɲá£
+
+2001-08-08
+
+       * src/pixmaps/mark.xpm: ½¤Àµ¡£
+       * src/gtkutils.[ch]: gtkut_ctree_expand_parent_all(): ¿·µ¬¡£
+       * src/summaryview.c: summary_set_ctree_from_list(): ¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹
+         ¸þ¾å¤Î¤¿¤á¤Ë¥¹¥ì¥Ã¥É¤Î¥ë¡¼¥È¥á¥Ã¥»¡¼¥¸¤òŸ³«¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+         summary_show()
+         summary_select_next_unread()
+         summary_step(): ¥á¥Ã¥»¡¼¥¸¤ò³«¤¯¤È¤­¤Ë¥¹¥ì¥Ã¥É¤òŸ³«¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         summary_thread_build(): ¥ª¥×¥·¥ç¥ó¤¬ ON ¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤é¥¹¥ì¥Ã¥É¤ò
+         Å¸³«¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/prefs_common.[ch]: ¡Ö¥¹¥ì¥Ã¥É¤òŸ³«¤¹¤ë¡×¥ª¥×¥·¥ç¥ó¤òÄɲá£
+
+2001-08-08
+
+       * src/prefs_common.c: ¡ÖEmacs¾å¤Î¥á¡¼¥é¤Î¥Þ¥¦¥¹Áàºî»þ¤ÎµóÆ°¤ò
+         ¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¡×¤òºï½ü¡£
+       * src/prefs_common.c
+         src/prefs_account.c: VSPACING_NARROW ¤ÎÃͤò 3 ¤ËÊѹ¹¡£
+       * src/pixmaps/new.xpm
+         src/pixmaps/unread.xpm: ¸µ¤ËÌᤷ¤¿¡£
+
+2001-08-07
+
+       * src/address.[ch]:
+         address_folder_new()
+         address_group_new()
+         address_item_new(): Ìá¤êÃͤò AddressObject ¤ËÊѹ¹¡£
+         address_build_tree(): file ¤Î assertion ¤ò½Ð¤µ¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+       * src/pixmaps/new.xpm
+         src/pixmaps/unread.xpm: ¾¯¤·½¤Àµ¡£
+
+2001-08-06
+
+       * src/addressbook.c: ¤¤¤¯¤Ä¤«¤Î¥Ð¥°¤ò½¤Àµ¡£
+
+2001-08-06
+
+       * ¥¢¥É¥ì¥¹Ä¢¤Î¥í¥¸¥Ã¥¯Éôʬ¤òÊ̥⥸¥å¡¼¥ë¤ËʬΥ(¸½ºß¿Ê¹ÔÃæ)¡£
+       * src/address.[ch]: ¿·µ¬¡£¥¢¥É¥ì¥¹Ä¢¤Î¥í¥¸¥Ã¥¯Éôʬ¤ò´Þ¤à¡£
+       * src/addressbook.[ch]: ¥í¥¸¥Ã¥¯Éôʬ¤òºï½ü¡£
+
+2001-08-04
+
+       * src/textview.c: textview_show_header(): ¥Ø¥Ã¥À̾¤Î¸å¤Ë¥´¥ßʸ»ú¤¬
+         É½¼¨¤µ¤ì¤ë¥Ð¥°¤ò½¤Àµ¡£
+
 2001-08-02
 
        * src/inc.c: inc_start(): Ã×̿Ū¤Ç¤Ê¤¤¥¨¥é¡¼¤ÇÃæÃǤ·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
index 69ee4dc..bdf7a48 100644 (file)
@@ -8,7 +8,7 @@ PACKAGE=sylpheed
 dnl version number
 MAJOR_VERSION=0
 MINOR_VERSION=5
-MICRO_VERSION=2
+MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=claws1
index ffa42ca..53ee299 100644 (file)
@@ -3622,10 +3622,10 @@ static void addressbook_group_menu_selected(GtkMenuItem *menuitem,
 
 /* addressbook_add_contact_by_meny() - launches menu with group items. submenu may be
  * the menu item in the parent menu, or NULL for a normal right-click context menu */
-gboolean addressbook_add_contact_by_menu(GtkWidget   *submenu,
-                                                                                const gchar *name, 
-                                                                                const gchar *address, 
-                                                                                const gchar *remarks)
+gboolean addressbook_add_submenu(GtkWidget   *submenu,
+                                const gchar *name,
+                                const gchar *address,
+                                const gchar *remarks)
 {
        GtkWidget       *menu, *menuitem;
        GList           *groups, *tmp;
index 2cfcfab..d459510 100644 (file)
@@ -184,9 +184,9 @@ GList *addressbook_get_group_list (void);
 gint addressbook_add_contact  (const gchar *group, const gchar *name, 
                                const gchar *address, const gchar *remarks); 
 
-gboolean addressbook_add_contact_by_menu(GtkWidget   *submenu,
-                                        const gchar *name, 
-                                        const gchar *address, 
-                                        const gchar *remarks);
+gboolean addressbook_add_submenu(GtkWidget   *submenu,
+                                const gchar *name,
+                                const gchar *address,
+                                const gchar *remarks);
 
 #endif /* __ADDRESSBOOK_H__ */
index 420f2e0..7ebfdbc 100644 (file)
@@ -44,6 +44,10 @@ typedef struct _FolderItem   FolderItem;
 #define LOCAL_FOLDER(obj)      ((LocalFolder *)obj)
 #define REMOTE_FOLDER(obj)     ((RemoteFolder *)obj)
 
+#define FOLDER_IS_LOCAL(obj)   (FOLDER_TYPE(obj) == F_MH      || \
+                                FOLDER_TYPE(obj) == F_MBOX    || \
+                                FOLDER_TYPE(obj) == F_MAILDIR)
+
 #define MH_FOLDER(obj)         ((MHFolder *)obj)
 #define MBOX_FOLDER(obj)       ((MboxFolder *)obj)
 #define MAILDIR_FOLDER(obj)    ((MaildirFolder *)obj)
index bf7de4b..a2c9bdd 100644 (file)
@@ -91,6 +91,9 @@ static GList *folderview_list = NULL;
 static GdkFont *normalfont;
 static GdkFont *boldfont;
 
+static GtkStyle *bold_style;
+static GtkStyle *bold_color_style;
+
 static GdkPixmap *inboxxpm;
 static GdkBitmap *inboxxpmmask;
 static GdkPixmap *outboxxpm;
@@ -429,6 +432,13 @@ void folderview_init(FolderView *folderview)
                normalfont = gdk_fontset_load(NORMAL_FONT);
        if (!boldfont)
                boldfont = gdk_fontset_load(BOLD_FONT);
+
+       if (!bold_style) {
+               bold_style = gtk_style_copy(gtk_widget_get_style(ctree));
+               bold_style->font = boldfont;
+               bold_color_style = gtk_style_copy(bold_style);
+               bold_color_style->fg[GTK_STATE_NORMAL] = folderview->color_new;
+       }
 }
 
 void folderview_set(FolderView *folderview)
@@ -493,9 +503,7 @@ static void folderview_select_node(FolderView *folderview, GtkCTreeNode *node)
        else
                gtk_widget_grab_focus(folderview->ctree);
 
-       while ((node = gtkut_ctree_find_collapsed_parent(ctree, node))
-              != NULL)
-               gtk_ctree_expand(ctree, node);
+       gtkut_ctree_expand_parent_all(ctree, node);
 }
 
 void folderview_unselect(FolderView *folderview)
@@ -587,8 +595,7 @@ static void folderview_scan_tree_func(Folder *folder, FolderItem *item,
        GList *list;
        gchar *rootpath;
 
-       if (folder->type == F_MH || folder->type == F_MBOX ||
-           folder->type == F_MAILDIR)
+       if (FOLDER_IS_LOCAL(folder))
                rootpath = LOCAL_FOLDER(folder)->rootpath;
        else if (folder->type == F_IMAP && folder->account &&
                 folder->account->recv_server)
@@ -677,7 +684,37 @@ void folderview_update_all(void)
 
        folder_write_list();
        folderview_set_all();
+       gtk_widget_destroy(window);
+}
+
+void folderview_update_all_node(void)
+{
+       GList *list;
+       FolderItem *item;
+       FolderView *folderview;
+       GtkCTree *ctree;
+       GtkCTreeNode *node;
+       GtkWidget *window;
+
+       window = label_window_create(_("Updating all folders..."));
+
+       for (list = folderview_list; list != NULL; list = list->next) {
+               folderview = (FolderView *)list->data;
+               ctree = GTK_CTREE(folderview->ctree);
 
+               for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
+                    node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
+                       item = gtk_ctree_node_get_row_data(ctree, node);
+                       if (!item || !FOLDER_IS_LOCAL(item->folder) ||
+                           !item->path)
+                               continue;
+                       folderview_scan_tree_func(item->folder, item, NULL);
+                       folder_item_scan(item);
+                       folderview_update_node(folderview, node);
+               }
+       }
+
+       folder_write_list();
        gtk_widget_destroy(window);
 }
 
@@ -906,29 +943,15 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                         folderview_have_new_children(folderview, node));
        }
 
-       if (use_bold && boldfont)
-               style->font = boldfont;
-       else
-               style->font = normalfont;
+       gtk_ctree_node_set_foreground(ctree, node, NULL);
 
-       if (use_color) {
-               style->fg[GTK_STATE_NORMAL]   = folderview->color_new;
-               style->fg[GTK_STATE_SELECTED] = folderview->color_new;
-       } else {
-               if (item->op_count > 0) {
-                       if (boldfont)
-                               style->font = boldfont;
-                       style->fg[GTK_STATE_NORMAL]   =
-                               folderview->color_op;
-                       style->fg[GTK_STATE_SELECTED] =
-                               folderview->color_op;
-               } else {
-                       style->fg[GTK_STATE_NORMAL] =
-                               ctree_style->fg[GTK_STATE_NORMAL];
-                       style->fg[GTK_STATE_SELECTED] =
-                               ctree_style->fg[GTK_STATE_SELECTED];
-               }
-       }
+       if (use_bold && use_color)
+               style = bold_color_style;
+       else if (use_bold)
+               style = bold_style;
+       else if (use_color)
+               gtk_ctree_node_set_foreground(ctree, node,
+                                             &folderview->color_new);
 
        gtk_ctree_node_set_row_style(ctree, node, style);
 
@@ -1194,19 +1217,19 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
        menu_set_insensitive_all(GTK_MENU_SHELL(folderview->news_popup));
        menu_set_insensitive_all(GTK_MENU_SHELL(folderview->mbox_popup));
 
-       if (folder->type == F_MH && item->parent == NULL) {
+       if (FOLDER_IS_LOCAL(folder) && item->parent == NULL) {
                menu_set_sensitive(folderview->mail_factory,
                                   "/Create new folder...", TRUE);
                menu_set_sensitive(folderview->mail_factory,
                                   "/Update folder tree", TRUE);
                menu_set_sensitive(folderview->mail_factory,
                                   "/Remove mailbox", TRUE);
-       } else if (folder->type == F_MH && item->stype != F_NORMAL) {
+       } else if (FOLDER_IS_LOCAL(folder) && item->stype != F_NORMAL) {
                menu_set_sensitive(folderview->mail_factory,
                                   "/Create new folder...", TRUE);
                menu_set_sensitive(folderview->mail_factory,
                                   "/Scoring...", TRUE);
-       } else if (folder->type == F_MH) {
+       } else if (FOLDER_IS_LOCAL(folder)) {
                menu_set_sensitive(folderview->mail_factory,
                                   "/Create new folder...", TRUE);
                menu_set_sensitive(folderview->mail_factory,
@@ -1268,7 +1291,7 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
                                   "/Scoring...", TRUE);
        }
 
-       if (folder->type == F_MH)
+       if (FOLDER_IS_LOCAL(folder))
                gtk_menu_popup(GTK_MENU(folderview->mail_popup), NULL, NULL,
                               NULL, NULL, event->button, event->time);
        else if (folder->type == F_IMAP)
@@ -1379,7 +1402,6 @@ static void folderview_selected(GtkCTree *ctree, GtkCTreeNode *row,
 
        folderview->open_folder = FALSE;
        can_select = TRUE;
-
 }
 
 static void folderview_tree_expanded(GtkCTree *ctree, GtkCTreeNode *node,
index f76ddbc..0cfd888 100644 (file)
@@ -72,6 +72,7 @@ void folderview_update_msg_num                (FolderView     *folderview,
                                         gint            total);
 void folderview_update_tree            (Folder         *folder);
 void folderview_update_all             (void);
+void folderview_update_all_node                (void);
 
 void folderview_update_item            (FolderItem     *item,
                                         gboolean        update_summary);
index d4b42b9..f01f588 100644 (file)
@@ -201,6 +201,12 @@ GtkCTreeNode *gtkut_ctree_find_collapsed_parent(GtkCTree *ctree,
        return NULL;
 }
 
+void gtkut_ctree_expand_parent_all(GtkCTree *ctree, GtkCTreeNode *node)
+{
+       while ((node = gtkut_ctree_find_collapsed_parent(ctree, node)) != NULL)
+               gtk_ctree_expand(ctree, node);
+}
+
 void gtkut_ctree_set_focus_row(GtkCTree *ctree, GtkCTreeNode *node)
 {
        gtkut_clist_set_focus_row(GTK_CLIST(ctree),
index 9022cf8..9670626 100644 (file)
@@ -80,6 +80,8 @@ GtkCTreeNode *gtkut_ctree_node_next   (GtkCTree       *ctree,
 GtkCTreeNode *gtkut_ctree_find_collapsed_parent
                                        (GtkCTree       *ctree,
                                         GtkCTreeNode   *node);
+void gtkut_ctree_expand_parent_all     (GtkCTree       *ctree,
+                                        GtkCTreeNode   *node);
 void gtkut_ctree_set_focus_row         (GtkCTree       *ctree,
                                         GtkCTreeNode   *node);
 void gtkut_clist_set_focus_row         (GtkCList       *clist,
index 18841d4..cd1ccc5 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -120,6 +120,8 @@ static void inc_finished(MainWindow *mainwin)
 {
        FolderItem *item;
 
+       if (prefs_common.scan_all_after_inc)
+               folderview_update_all_node();
        /* XXX: major problems right here. if we change marks after
         * incorporation of mail, folderview_select() rewrites it
         * right under our nose. folderview_select() eventually
@@ -137,6 +139,7 @@ static void inc_finished(MainWindow *mainwin)
 
        /* XXX: filtering_happened is reset by summary_show() */
 
+
        if (prefs_common.open_inbox_on_inc) {
                item = cur_account && cur_account->inbox
                        ? folder_find_item_from_path(cur_account->inbox)
@@ -225,6 +228,7 @@ void inc_all_account_mail(MainWindow *mainwin)
 
        list = account_get_list();
        if (!list) {
+               inc_finished(mainwin);
                inc_autocheck_timer_set();
                return;
        }
@@ -241,6 +245,7 @@ void inc_all_account_mail(MainWindow *mainwin)
        }
 
        if (!queue_list) {
+               inc_finished(mainwin);
                inc_autocheck_timer_set();
                return;
        }
@@ -445,12 +450,22 @@ static void inc_start(IncProgressDialog *inc_dialog)
                /* begin POP3 session */
                inc_state = inc_pop3_session_do(session);
 
-               if (inc_state == INC_SUCCESS || inc_state == INC_CANCEL) {
+               if (inc_state == INC_SUCCESS) {
                        gtk_clist_set_pixmap(clist, num, 0, okxpm, okxpmmask);
                        gtk_clist_set_text(clist, num, 2, _("Done"));
+               } else if (inc_state == INC_CANCEL) {
+                       gtk_clist_set_pixmap(clist, num, 0, okxpm, okxpmmask);
+                       gtk_clist_set_text(clist, num, 2, _("Cancelled"));
                } else {
                        gtk_clist_set_pixmap(clist, num, 0, errorxpm, errorxpmmask);
-                       gtk_clist_set_text(clist, num, 2, _("Error"));
+                       if (inc_state == INC_CONNECT_ERROR)
+                               gtk_clist_set_text(clist, num, 2,
+                                                  _("Connection failed"));
+                       else if (inc_state == INC_AUTH_FAILED)
+                               gtk_clist_set_text(clist, num, 2,
+                                                  _("Auth failed"));
+                       else
+                               gtk_clist_set_text(clist, num, 2, _("Error"));
                }
 
                if (pop3_state->error_val == PS_AUTHFAIL) {
@@ -472,8 +487,11 @@ static void inc_start(IncProgressDialog *inc_dialog)
                        manage_window_focus_in(inc_dialog->mainwin->window, NULL, NULL);
                }
                
-               folder_item_scan_foreach(pop3_state->folder_table);
-               folderview_update_item_foreach(pop3_state->folder_table);
+               if (!prefs_common.scan_all_after_inc) {
+                       folder_item_scan_foreach(pop3_state->folder_table);
+                       folderview_update_item_foreach
+                               (pop3_state->folder_table);
+               }
 
                if (pop3_state->error_val == PS_AUTHFAIL &&
                    pop3_state->ac_prefs->tmp_pass) {
@@ -483,7 +501,7 @@ static void inc_start(IncProgressDialog *inc_dialog)
 
                inc_write_uidl_list(pop3_state);
 
-               if (inc_state != INC_SUCCESS) {
+               if (inc_state != INC_SUCCESS && inc_state != INC_CANCEL) {
                        error_num++;
                        if (inc_state == INC_NOSPACE) {
                                inc_put_error(inc_state);
@@ -498,9 +516,10 @@ static void inc_start(IncProgressDialog *inc_dialog)
                num++;
        }
 
-       if(!prefs_common.noerrorpanel) {
-               if (error_num)
-                       alertpanel_error(_("Some errors occured while getting mail."));
+       if (error_num) {
+               manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
+               alertpanel_error(_("Some errors occured while getting mail."));
+               manage_window_focus_out(inc_dialog->dialog->window, NULL, NULL);
        }
 
        while (inc_dialog->queue_list != NULL) {
@@ -597,7 +616,7 @@ static IncState inc_pop3_session_do(IncSession *session)
                pop3_automaton_terminate(NULL, atm);
                automaton_destroy(atm);
 
-               return INC_ERROR;
+               return INC_CONNECT_ERROR;
        }
 
        /* :WK: Hmmm, with the later sock_gdk_input, we have 2 references
@@ -611,13 +630,14 @@ static IncState inc_pop3_session_do(IncSession *session)
                        pop3_automaton_terminate(NULL, atm);
                        automaton_destroy(atm);
                        
-                       return INC_ERROR;
+                       return INC_CONNECT_ERROR;
                }
        } else {
                sockinfo->ssl = NULL;
        }
 #endif
 
+
        recv_set_ui_func(inc_pop3_recv_func, session);
 
 #if USE_THREADS
@@ -1032,12 +1052,14 @@ static gint get_spool(FolderItem *dest, const gchar *mbox)
        unlock_mbox(mbox, lockfd, LOCK_FLOCK);
 
        if (folder_table) {
+               if (!prefs_common.scan_all_after_inc) {
                g_hash_table_insert(folder_table, dest,
                                    GINT_TO_POINTER(1));
-               folder_item_scan_foreach(folder_table);
-               folderview_update_item_foreach(folder_table);
+                       folder_item_scan_foreach(folder_table);
+                       folderview_update_item_foreach(folder_table);
+               }
                g_hash_table_destroy(folder_table);
-       } else {
+       } else if (!prefs_common.scan_all_after_inc) {
                folder_item_scan(dest);
                folderview_update_item(dest, FALSE);
        }
index 6dc7ff6..0513b42 100644 (file)
--- a/src/inc.h
+++ b/src/inc.h
@@ -40,6 +40,8 @@ typedef struct _Pop3State             Pop3State;
 typedef enum
 {
        INC_SUCCESS,
+       INC_CONNECT_ERROR,
+       INC_AUTH_FAILED,
        INC_ERROR,
        INC_NOSPACE,
        INC_CANCEL
index 8032f6b..4740b27 100644 (file)
@@ -75,7 +75,6 @@
 #include "about.h"
 #include "manual.h"
 
-
 #define AC_LABEL_WIDTH 240
 
 #define STATUSBAR_PUSH(mainwin, str) \
@@ -204,7 +203,9 @@ static void toggle_toolbar_cb        (MainWindow    *mainwin,
 static void toggle_statusbar_cb         (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
-static void separate_widget_cb(GtkCheckMenuItem *checkitem, guint action);
+static void separate_widget_cb (GtkCheckMenuItem *checkitem,
+                                guint action,
+                                GtkWidget *widget);
 
 static void addressbook_open_cb        (MainWindow     *mainwin,
                                 guint           action,
@@ -593,8 +594,8 @@ MainWindow *main_window_create(SeparateType type)
        SummaryView *summaryview;
        MessageView *messageview;
        GdkColormap *colormap;
-       GdkColor color[4];
-       gboolean success[4];
+       GdkColor color[3];
+       gboolean success[3];
        guint n_menu_entries;
        GtkItemFactory *ifactory;
        GtkWidget *ac_menu;
@@ -717,8 +718,8 @@ MainWindow *main_window_create(SeparateType type)
        color[3] = folderview->color_op;
 
        colormap = gdk_window_get_colormap(window->window);
-       gdk_colormap_alloc_colors(colormap, color, 4, FALSE, TRUE, success);
-       for (i = 0; i < 4; i++) {
+       gdk_colormap_alloc_colors(colormap, color, 3, FALSE, TRUE, success);
+       for (i = 0; i < 3; i++) {
                if (success[i] == FALSE)
                        g_warning(_("MainWindow: color allocation %d failed\n"), i);
        }
@@ -773,13 +774,13 @@ MainWindow *main_window_create(SeparateType type)
        gtk_signal_connect(GTK_OBJECT(menuitem), "toggled", GTK_SIGNAL_FUNC(separate_widget_cb), 
                                           GUINT_TO_POINTER(SEPARATE_MESSAGE));
 
-       /*
+
        menu_set_sensitive(ifactory, "/Summary/Thread view",
                           prefs_common.enable_thread ? FALSE : TRUE);
        menu_set_sensitive(ifactory, "/Summary/Unthread view",
                           prefs_common.enable_thread ? TRUE : FALSE);
-       */
-       main_window_set_thread_option(mainwin);
+       
+       /*main_window_set_thread_option(mainwin);*/
 
 
        /* set account selection menu */
@@ -1054,12 +1055,10 @@ void main_window_add_mailbox(MainWindow *mainwin)
                g_free(path);
                return;
        }
-
        if (!strcmp(path, "Mail"))
                folder = folder_new(F_MH, _("Mailbox"), path);
        else
                folder = folder_new(F_MH, g_basename(path), path);
-
        g_free(path);
 
        if (folder->create_tree(folder) < 0) {
@@ -2087,7 +2086,8 @@ static void toggle_statusbar_cb(MainWindow *mainwin, guint action,
        }
 }
 
-static void separate_widget_cb(GtkCheckMenuItem *checkitem, guint action)
+static void separate_widget_cb(GtkCheckMenuItem *checkitem, guint action, GtkWidget *widget)
+
 {
        MainWindow *mainwin;
        SeparateType type;
@@ -2334,7 +2334,7 @@ static void set_charset_cb(MainWindow *mainwin, guint action,
        debug_print(_("forced charset: %s\n"), str ? str : "Auto-Detect");
 }
 
-void main_window_set_thread_option(MainWindow *mainwin)
+/*void main_window_set_thread_option(MainWindow *mainwin)
 {
        GtkItemFactory *ifactory;
        gboolean no_item = FALSE;
@@ -2356,7 +2356,7 @@ void main_window_set_thread_option(MainWindow *mainwin)
                                           "/Summary/Thread view",   FALSE);
                        menu_set_sensitive(ifactory,
                                           "/Summary/Unthread view", TRUE);
-                       summary_thread_build(mainwin->summaryview);
+                       summary_thread_build(mainwin->summaryview, TRUE);
                }
                else {
                        menu_set_sensitive(ifactory,
@@ -2367,29 +2367,31 @@ void main_window_set_thread_option(MainWindow *mainwin)
                }
                prefs_folder_item_save_config(mainwin->summaryview->folder_item);
        }
-}
+}*/
 
 static void thread_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 {
-       mainwin->summaryview->folder_item->prefs->enable_thread =
+       /*mainwin->summaryview->folder_item->prefs->enable_thread =
                !mainwin->summaryview->folder_item->prefs->enable_thread;
        main_window_set_thread_option(mainwin);
+        */
+
+        GtkItemFactory *ifactory;
+
+       ifactory = gtk_item_factory_from_widget(widget);
 
-       /*
        if (0 == action) {
-               summary_thread_build(mainwin->summaryview);
-               mainwin->summaryview->folder_item->prefs->enable_thread =
-                       TRUE;
+               summary_thread_build(mainwin->summaryview, FALSE);
+               prefs_common.enable_thread = TRUE;
                menu_set_sensitive(ifactory, "/Summary/Thread view",   FALSE);
                menu_set_sensitive(ifactory, "/Summary/Unthread view", TRUE);
        } else {
                summary_unthread(mainwin->summaryview);
-               mainwin->summaryview->folder_item->prefs->enable_thread =
-                       FALSE;
+               prefs_common.enable_thread = FALSE;
                menu_set_sensitive(ifactory, "/Summary/Thread view",   TRUE);
                menu_set_sensitive(ifactory, "/Summary/Unthread view", FALSE);
        }
-       */
+       
 }
 
 static void set_display_item_cb(MainWindow *mainwin, guint action,
index 20161bc..aaeb940 100644 (file)
@@ -149,6 +149,6 @@ void main_window_set_toolbar_sensitive      (MainWindow     *mainwin,
 void main_window_set_menu_sensitive    (MainWindow     *mainwin,
                                         gint            selection);
 void main_window_popup                 (MainWindow     *mainwin);
-void main_window_set_thread_option      (MainWindow *mainwin);
+/*void main_window_set_thread_option      (MainWindow *mainwin);*/
 
 #endif /* __MAINWINDOW_H__ */
index e125383..8c5f7ec 100644 (file)
@@ -1717,9 +1717,9 @@ void mbox_scan_folder(Folder *folder, FolderItem *item)
                        struct _message * msg = (struct _message *) l->data;
                        if (!MSG_IS_REALLY_DELETED(msg->flags))
                                total ++;
-                       if (MSG_IS_NEW(msg->flags) && !MSG_IS_IGNORE_THREAD(msg->flags))
+                       if (MSG_IS_NEW(msg->flags) /*&& !MSG_IS_IGNORE_THREAD(msg->flags)*/)
                                new ++;
-                       if (MSG_IS_UNREAD(msg->flags) && !MSG_IS_IGNORE_THREAD(msg->flags))
+                       if (MSG_IS_UNREAD(msg->flags) /*&& !MSG_IS_IGNORE_THREAD(msg->flags)*/)
                                unread ++;
                }
                
index 0bd7d89..51beec7 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 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
@@ -97,6 +97,7 @@ gint pop3_getauth_pass_recv(SockInfo *sock, gpointer data)
        else {
                log_warning(_("error occurred on authentication\n"));
                state->error_val = PS_AUTHFAIL;
+               state->inc_state = INC_AUTH_FAILED;
                return -1;
        }
 }
@@ -144,6 +145,7 @@ gint pop3_getauth_apop_recv(SockInfo *sock, gpointer data)
        else {
                log_warning(_("error occurred on authentication\n"));
                state->error_val = PS_AUTHFAIL;
+               state->inc_state = INC_AUTH_FAILED;
                return -1;
        }
 }
@@ -299,12 +301,12 @@ gint pop3_getsize_list_recv(SockInfo *sock, gpointer data)
                gint num, size;
 
                if (buf[0] == '.') break;
-               if (sscanf(buf, "%d %d", &num, &size) != 2)
+               if (sscanf(buf, "%u %u", &num, &size) != 2)
                        break;
 
-               if (num <= state->count)
+               if (num > 0 && num <= state->count)
                        state->sizes[num] = size;
-               if (num < state->cur_msg)
+               if (num > 0 && num < state->cur_msg)
                        state->cur_total_bytes += size;
        }
 
index c24edb2..2218a66 100644 (file)
@@ -387,7 +387,7 @@ static gint prefs_account_apply                     (void);
 static void prefs_account_cancel               (void);
 
 #define VSPACING               12
-#define VSPACING_NARROW                4
+#define VSPACING_NARROW                3
 #define BOX_BORDER             16
 #define DEFAULT_ENTRY_WIDTH    80
 
index a0f434a..e474df5 100644 (file)
@@ -72,6 +72,8 @@ static struct Receive {
 
        GtkWidget *checkbtn_chkonstartup;
        GtkWidget *checkbtn_noerrorpanel;
+       GtkWidget *checkbtn_scan_after_inc;
+
 
        GtkWidget *spinbtn_maxarticle;
        GtkObject *spinbtn_maxarticle_adj;
@@ -131,6 +133,8 @@ static struct Display {
        GtkWidget *chkbtn_swapfrom;
        GtkWidget *chkbtn_hscrollbar;
        GtkWidget *chkbtn_useaddrbook;
+       GtkWidget *chkbtn_expand_thread;
+       GtkWidget *chkbtn_bold_unread;
 
        GtkWidget *entry_datefmt;
 } display;
@@ -250,7 +254,9 @@ static PrefParam param[] = {
        {"noerrorpanel", "FALSE", &prefs_common.noerrorpanel, P_BOOL,
         &receive.checkbtn_noerrorpanel,
         prefs_set_data_from_toggle, prefs_set_toggle},
-
+       {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
+        P_BOOL, &receive.checkbtn_scan_after_inc,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"max_news_articles", "300", &prefs_common.max_articles, P_INT,
         &receive.spinbtn_maxarticle,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
@@ -280,6 +286,7 @@ static PrefParam param[] = {
        {"quote_mark", "> ", &prefs_common.quotemark, P_STRING,
         &compose.entry_quotemark, prefs_set_data_from_entry, prefs_set_entry},
        {"quote_format", "On %d\\n%f wrote:\\n\\n%Q",
+
         &prefs_common.quotefmt, P_STRING, &compose.text_quotefmt,
         prefs_set_data_from_text, prefs_set_text},
        {"fw_quote_mark", "> ", &prefs_common.fw_quotemark, P_STRING,
@@ -348,6 +355,7 @@ static PrefParam param[] = {
         &display.entry_normalfont, 
         prefs_set_data_from_entry, prefs_set_entry},
 
+
        {"display_folder_unread_num", "TRUE",
         &prefs_common.display_folder_unread, P_BOOL,
         &display.chkbtn_folder_unread,
@@ -370,11 +378,16 @@ static PrefParam param[] = {
        {"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
         P_STRING, &display.entry_datefmt,
         prefs_set_data_from_entry, prefs_set_entry},
+       {"expand_thread", "TRUE", &prefs_common.expand_thread, P_BOOL,
+        &display.chkbtn_expand_thread,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
+        &display.chkbtn_bold_unread,
+        prefs_set_data_from_toggle, prefs_set_toggle},
 
-       /*
        {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
         NULL, NULL, NULL},
-       */
+       
        {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
         NULL, NULL, NULL},
        {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
@@ -552,8 +565,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
 
        {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
-        &interface.checkbtn_emacs,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
+
        {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
         P_BOOL, &interface.checkbtn_openunread,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -606,7 +619,8 @@ static PrefParam param[] = {
 };
 
 #define VSPACING               12
-#define VSPACING_NARROW                4
+#define VSPACING_NARROW                3
+
 #define VBOX_BORDER            16
 #define DEFAULT_ENTRY_WIDTH    80
 #define PREFSBUFSIZE           1024
@@ -680,6 +694,7 @@ static void display_item_key_pressed        (GtkWidget      *widget,
                                         gboolean       *cancelled);
 
 static void prefs_font_select  (GtkButton *button, GtkEntry *entry);
+
 static void prefs_font_selection_key_pressed   (GtkWidget      *widget,
                                                 GdkEventKey    *event,
                                                 gpointer        data);
@@ -803,6 +818,8 @@ static void prefs_receive_create(void)
        GtkWidget *label_autochk2;
        GtkWidget *checkbtn_chkonstartup;
        GtkWidget *checkbtn_noerrorpanel;
+       GtkWidget *checkbtn_scan_after_inc;
+
 
        GtkWidget *frame_news;
        GtkWidget *label_maxarticle;
@@ -838,7 +855,8 @@ static void prefs_receive_create(void)
        gtk_widget_show (entry_incext);
        gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
 
-       button_incext = gtk_button_new_with_label (" ... ");
+       button_incext = gtk_button_new_with_label ("... ");
+
        gtk_widget_show (button_incext);
        gtk_box_pack_start (GTK_BOX (hbox), button_incext, FALSE, FALSE, 0);
 
@@ -908,6 +926,9 @@ static void prefs_receive_create(void)
 
        PACK_CHECK_BUTTON (vbox2, checkbtn_noerrorpanel,
                           _("No error popup on receive error"));
+       PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
+                          _("Update all local folders after incorporation"));
+
 
        PACK_FRAME(vbox1, frame_news, _("News"));
 
@@ -948,6 +969,8 @@ static void prefs_receive_create(void)
 
        receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
        receive.checkbtn_noerrorpanel = checkbtn_noerrorpanel;
+       receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
+
 
        receive.spinbtn_maxarticle     = spinbtn_maxarticle;
        receive.spinbtn_maxarticle_adj = spinbtn_maxarticle_adj;
@@ -1201,6 +1224,7 @@ static void prefs_compose_create(void)
 
        GtkWidget *checkbtn_reply_account_autosel;
        GtkWidget *vbox_linewrap;
+
        GtkWidget *hbox3;
        GtkWidget *hbox4;
        GtkWidget *label_linewrap;
@@ -1262,11 +1286,13 @@ static void prefs_compose_create(void)
        gtk_box_pack_start (GTK_BOX (hbox2), label_quotefmt, FALSE, FALSE, 0);
 
        btn_quotedesc =
-               gtk_button_new_with_label (_(" Quote format "));
+               gtk_button_new_with_label (_(" Description of symbols "));
+
        gtk_widget_show (btn_quotedesc);
        gtk_box_pack_end (GTK_BOX (hbox2), btn_quotedesc, FALSE, FALSE, 0);
        gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
-                          GTK_SIGNAL_FUNC(compose_prefs_fmt_open), &cancelled);
+                          GTK_SIGNAL_FUNC(prefs_quote_description), NULL);
+
 
        scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
        gtk_widget_show (scrolledwin_quotefmt);
@@ -1305,7 +1331,6 @@ static void prefs_compose_create(void)
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
-
        label_sigsep = gtk_label_new (_("Signature separator"));
        gtk_widget_show (label_sigsep);
        gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
@@ -1313,6 +1338,7 @@ static void prefs_compose_create(void)
        entry_sigsep = gtk_entry_new ();
        gtk_widget_show (entry_sigsep);
        gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
+
        gtk_widget_set_usize (entry_sigsep, 64, -1);
 
        /* line-wrapping */
@@ -1324,6 +1350,7 @@ static void prefs_compose_create(void)
        gtk_widget_show (hbox3);
        gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
 
+
        label_linewrap = gtk_label_new (_("Wrap messages at"));
        gtk_widget_show (label_linewrap);
        gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
@@ -1450,6 +1477,8 @@ static void prefs_display_create(void)
        GtkWidget *chkbtn_swapfrom;
        GtkWidget *chkbtn_hscrollbar;
        GtkWidget *chkbtn_useaddrbook;
+       GtkWidget *chkbtn_expand_thread;
+       GtkWidget *chkbtn_bold_unread;
        GtkWidget *hbox1;
        GtkWidget *label_datefmt;
        GtkWidget *button_datefmt;
@@ -1466,6 +1495,7 @@ static void prefs_display_create(void)
        PACK_FRAME(vbox1, frame_font, _("Font"));
 
        table1 = gtk_table_new (4, 3, FALSE);
+
        gtk_widget_show (table1);
        gtk_container_add (GTK_CONTAINER (frame_font), table1);
        gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
@@ -1483,7 +1513,8 @@ static void prefs_display_create(void)
        gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
 
-       button_textfont = gtk_button_new_with_label (" ... ");
+       button_textfont = gtk_button_new_with_label ("... ");
+
        gtk_widget_show (button_textfont);
        gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
                          0, 0, 0, 0);
@@ -1545,7 +1576,7 @@ static void prefs_display_create(void)
                          0, 0, 0, 0);
        gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
                                GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
-       display.entry_boldfont = tmpentry;                        
+       display.entry_boldfont = tmpentry;
 
        vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
        gtk_widget_show (vbox2);
@@ -1575,6 +1606,11 @@ static void prefs_display_create(void)
                 _("Display sender using address book"));
        PACK_CHECK_BUTTON
                (vbox2, chkbtn_hscrollbar, _("Enable horizontal scroll bar"));
+       PACK_CHECK_BUTTON
+               (vbox2, chkbtn_expand_thread, _("Expand threads"));
+       PACK_CHECK_BUTTON
+               (vbox2, chkbtn_bold_unread,
+                _("Display unread messages with bold font"));
 
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
@@ -1588,7 +1624,8 @@ static void prefs_display_create(void)
        gtk_widget_show (entry_datefmt);
        gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
 
-       button_datefmt = gtk_button_new_with_label (_("... "));
+       button_datefmt = gtk_button_new_with_label ("... ");
+
        gtk_widget_show (button_datefmt);
        gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
        gtk_signal_connect (GTK_OBJECT (button_datefmt), "clicked",
@@ -1617,10 +1654,12 @@ static void prefs_display_create(void)
        display.chkbtn_folder_unread = chkbtn_folder_unread;
        display.chkbtn_transhdr   = chkbtn_transhdr;
 
-       display.chkbtn_swapfrom    = chkbtn_swapfrom;
-       display.chkbtn_hscrollbar  = chkbtn_hscrollbar;
-       display.chkbtn_useaddrbook = chkbtn_useaddrbook;
-       display.entry_datefmt      = entry_datefmt;
+       display.chkbtn_swapfrom      = chkbtn_swapfrom;
+       display.chkbtn_hscrollbar    = chkbtn_hscrollbar;
+       display.chkbtn_expand_thread = chkbtn_expand_thread;
+       display.chkbtn_bold_unread   = chkbtn_bold_unread;
+       display.chkbtn_useaddrbook   = chkbtn_useaddrbook;
+       display.entry_datefmt        = entry_datefmt;
 }
 
 static void prefs_message_create(void)
@@ -1974,6 +2013,7 @@ static void prefs_interface_create(void)
                (vbox2, checkbtn_addaddrbyclick,
                 _("Add address to destination when double-clicked"));
 
+
        /* Receive Dialog */
        hbox = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox);
@@ -2206,7 +2246,8 @@ static void date_format_select_row(GtkWidget *date_format_list, gint row,
        GtkWidget *datefmt_sample;
 
        /* only on double click */
-       if (!event ||event->type != GDK_2BUTTON_PRESS) return;
+       if (!event || event->type != GDK_2BUTTON_PRESS) return;
+
 
        datefmt_sample = GTK_WIDGET(gtk_object_get_data
                                    (GTK_OBJECT(date_format), "datefmt_sample"));
@@ -2305,6 +2346,7 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        gtk_widget_show(datefmt_clist);
        gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
 /*     gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80);   */
+
        gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
                                     GTK_SELECTION_BROWSE);
 
@@ -2444,6 +2486,7 @@ static void prefs_quote_colors_dialog_create(void)
        gtk_table_set_row_spacings (GTK_TABLE (table), 2);
        gtk_table_set_col_spacings (GTK_TABLE (table), 5);
 
+
        color_buttons.quote_level1_btn = gtk_button_new();
        gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
                          0, 1, 0, 1, 0, 0, 0, 0);
@@ -3016,6 +3059,7 @@ static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
 
        if (fontname) {
                gtk_entry_set_text(entry, fontname);
+
                g_free(fontname);
        }
 
index e89a90a..0e32033 100644 (file)
@@ -47,6 +47,7 @@ struct _PrefsCommon
        gboolean inc_local;
        gboolean filter_on_inc;
        gchar *spool_path;
+       gboolean scan_all_after_inc;
        gboolean autochk_newmail;
        gint autochk_itv;
        gboolean chk_on_startup;
@@ -82,15 +83,17 @@ struct _PrefsCommon
        /* Display */
        gchar *widgetfont;
        gchar *textfont;
-       gchar *smallfont;
-       gchar *boldfont;
        gchar *normalfont;
+       gchar *boldfont;
+       gchar *smallfont;
        gboolean display_folder_unread;
        ToolbarStyle toolbar_style;
        gboolean show_statusbar;
        gboolean trans_hdr;
-       /* gboolean enable_thread; */
+       gboolean enable_thread;
        gboolean enable_hscrollbar;
+       gboolean expand_thread;
+       gboolean bold_unread;
        gboolean swap_from;
        gboolean use_addr_book;
        gchar *date_format;
index 757928a..b6a0104 100644 (file)
@@ -53,8 +53,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"sort_descending", "FALSE", &tmp_prefs.sort_descending, P_BOOL,
         NULL, NULL, NULL},
-       {"enable_thread", "TRUE", &tmp_prefs.enable_thread, P_BOOL,
-        NULL, NULL, NULL},
+       /*{"enable_thread", "TRUE", &tmp_prefs.enable_thread, P_BOOL,
+        NULL, NULL, NULL},*/
        {"kill_score", "-9999", &tmp_prefs.kill_score, P_INT,
         NULL, NULL, NULL},
        {"important_score", "1", &tmp_prefs.important_score, P_INT,
index a22c92e..394722e 100644 (file)
@@ -401,8 +401,10 @@ static void mark_sum_func(gpointer key, gpointer value, gpointer data)
        MsgFlags *flags = value;
        struct MarkSum *marksum = data;
 
-       if (MSG_IS_NEW(*flags) && !MSG_IS_IGNORE_THREAD(*flags)) (*marksum->new)++;
-       if (MSG_IS_UNREAD(*flags) && !MSG_IS_IGNORE_THREAD(*flags)) (*marksum->unread)++;
+       /*if (MSG_IS_NEW(*flags) && !MSG_IS_IGNORE_THREAD(*flags)) (*marksum->new)++;*/
+        if (MSG_IS_NEW(*flags)) (*marksum->new)++;
+       /*if (MSG_IS_UNREAD(*flags) && !MSG_IS_IGNORE_THREAD(*flags)) (*marksum->unread)++;*/
+       if (MSG_IS_UNREAD(*flags)) (*marksum->unread)++;
        (*marksum->total)++;
 }
 
index 60795bd..585ab49 100644 (file)
@@ -65,7 +65,7 @@ typedef enum
 #define MSG_LABEL_GREEN    (MSG_LABEL_6)
 #define MSG_LABEL_BROWN    (MSG_LABEL_7)
 
-       MSG_IGNORE_THREAD   = 1 << 10,   /* ignore threads */
+       /*MSG_IGNORE_THREAD   = 1 << 10,*/   /* ignore threads */
 
        /* RESERVED */
        MSG_RESERVED_CLAWS  = 1 << 30,  /* for sylpheed-claws */
@@ -122,7 +122,7 @@ typedef enum
 
 /* Claws related flags */
 #define MSG_IS_REALLY_DELETED(msg)     (((msg).perm_flags & MSG_REALLY_DELETED) != 0)
-#define MSG_IS_IGNORE_THREAD(msg)      (((msg).perm_flags & MSG_IGNORE_THREAD) != 0)
+/*#define MSG_IS_IGNORE_THREAD(msg)    (((msg).perm_flags & MSG_IGNORE_THREAD) != 0)*/
 #define MSG_GET_LABEL(msg)             (((msg).perm_flags & MSG_LABEL))
 #define MSG_GET_LABEL_VALUE(msg)       (MSG_GET_LABEL(msg) >> MSG_LABEL_SBIT)
 /* 7 == nr. of colors excl. none */
index a2063da..6ebe8f2 100644 (file)
 #define SUMMARY_COL_UNREAD_WIDTH       13
 #define SUMMARY_COL_MIME_WIDTH         10
 
+static GdkFont *boldfont;
 static GdkFont *smallfont;
 
+static GtkStyle *bold_style;
+static GtkStyle *bold_marked_style;
+static GtkStyle *bold_deleted_style;
+
 static GdkPixmap *folderxpm;
 static GdkBitmap *folderxpmmask;
 
@@ -123,8 +128,8 @@ static GdkPixmap *repliedxpm;
 static GdkBitmap *repliedxpmmask;
 static GdkPixmap *forwardedxpm;
 static GdkBitmap *forwardedxpmmask;
-static GdkPixmap *ignorethreadxpm;
-static GdkBitmap *ignorethreadxpmmask;
+/*static GdkPixmap *ignorethreadxpm;
+static GdkBitmap *ignorethreadxpmmask;*/
 
 static GdkPixmap *clipxpm;
 static GdkBitmap *clipxpmmask;
@@ -140,6 +145,10 @@ static void summary_write_cache_func       (GtkCTree               *ctree,
                                         gpointer                data);
 
 static void summary_set_menu_sensitive (SummaryView            *summaryview);
+static void summary_set_add_sender_menu        (SummaryView            *summaryview);
+
+static guint summary_get_msgnum                (SummaryView            *summaryview,
+                                        GtkCTreeNode           *node);
 
 static GtkCTreeNode *summary_find_next_unread_msg
                                        (SummaryView            *summaryview,
@@ -209,16 +218,9 @@ static void summary_execute_delete (SummaryView            *summaryview);
 static void summary_execute_delete_func        (GtkCTree               *ctree,
                                         GtkCTreeNode           *node,
                                         gpointer                data);
-static void summary_ignore_thread(SummaryView *summaryview);
-static void summary_unignore_thread(SummaryView *summaryview);
+/*static void summary_ignore_thread(SummaryView *summaryview);
+static void summary_unignore_thread(SummaryView *summaryview);*/
 
-/* thread functions */
-static void summary_thread_func                        (GtkCTree       *ctree,
-                                                GtkCTreeNode   *node,
-                                                gpointer        data);
-static void summary_unthread_func              (GtkCTree       *ctree,
-                                                GtkCTreeNode   *node,
-                                                gpointer        data);
 static void summary_unthread_for_exec          (SummaryView    *summaryview);
 static void summary_unthread_for_exec_func     (GtkCTree       *ctree,
                                                 GtkCTreeNode   *node,
@@ -243,6 +245,12 @@ static void summary_key_pressed            (GtkWidget              *ctree,
                                         SummaryView            *summaryview);
 static void summary_open_row           (GtkSCTree              *sctree,
                                         SummaryView            *summaryview);
+static void summary_tree_expanded      (GtkCTree               *ctree,
+                                        GtkCTreeNode           *node,
+                                        SummaryView            *summaryview);
+static void summary_tree_collapsed     (GtkCTree               *ctree,
+                                        GtkCTreeNode           *node,
+                                        SummaryView            *summaryview);
 static void summary_selected           (GtkCTree               *ctree,
                                         GtkCTreeNode           *row,
                                         gint                    column,
@@ -257,9 +265,6 @@ static void summary_reply_cb                (SummaryView            *summaryview,
 static void summary_show_all_header_cb (SummaryView            *summaryview,
                                         guint                   action,
                                         GtkWidget              *widget);
-static void summary_add_sender_to_cb (SummaryView                      *summaryview,
-                                        guint                   action,
-                                        GtkWidget              *widget);
 
 static void summary_num_clicked                (GtkWidget              *button,
                                         SummaryView            *summaryview);
@@ -335,8 +340,8 @@ static GtkItemFactoryEntry summary_popup_entries[] =
 #if MARK_ALL_READ      
        {N_("/_Mark/Mark all read"),    NULL, summary_mark_all_read, 0, NULL},
 #endif 
-       {N_("/_Mark/Ignore thread"),    NULL, summary_ignore_thread, 0, NULL},
-       {N_("/_Mark/Unignore thread"),  NULL, summary_unignore_thread, 0, NULL},
+/*     {N_("/_Mark/Ignore thread"),    NULL, summary_ignore_thread, 0, NULL},
+       {N_("/_Mark/Unignore thread"),  NULL, summary_unignore_thread, 0, NULL},*/
 
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/_Reply"),                 NULL, summary_reply_cb, COMPOSE_REPLY, NULL},
@@ -347,6 +352,9 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/Forward as a_ttachment"),
                                        NULL, summary_reply_cb, COMPOSE_FORWARD_AS_ATTACH, NULL},
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
+       {N_("/Add sender to address _book"),
+                                       NULL, NULL,             0, NULL},
+       {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/Open in new _window"),    NULL, summary_open_msg, 0, NULL},
        {N_("/View so_urce"),           NULL, summary_view_source, 0, NULL},
        {N_("/Show all _header"),       NULL, summary_show_all_header_cb, 0, NULL},
@@ -713,6 +721,21 @@ SummaryView *summary_create(void)
                           GTK_SIGNAL_FUNC(summary_col_resized), summaryview);
         gtk_signal_connect(GTK_OBJECT(ctree), "open_row",
                           GTK_SIGNAL_FUNC(summary_open_row), summaryview);
+
+       gtk_signal_connect_after(GTK_OBJECT(ctree), "tree_expand",
+                                GTK_SIGNAL_FUNC(summary_tree_expanded),
+                                summaryview);
+       gtk_signal_connect_after(GTK_OBJECT(ctree), "tree_collapse",
+                                GTK_SIGNAL_FUNC(summary_tree_collapsed),
+                                summaryview);
+
+       gtk_signal_connect(GTK_OBJECT(ctree), "start_drag",
+                          GTK_SIGNAL_FUNC(summary_start_drag),
+                          summaryview);
+       gtk_signal_connect(GTK_OBJECT(ctree), "drag_data_get",
+                          GTK_SIGNAL_FUNC(summary_drag_data_get),
+                          summaryview);
+
        gtk_signal_connect(GTK_OBJECT(toggle_eventbox), "button_press_event",
                           GTK_SIGNAL_FUNC(summary_toggle_pressed),
                           summaryview);
@@ -753,8 +776,8 @@ void summary_init(SummaryView *summaryview)
                      replied_xpm);
        PIXMAP_CREATE(summaryview->ctree, forwardedxpm, forwardedxpmmask,
                      forwarded_xpm);
-       PIXMAP_CREATE(summaryview->ctree, ignorethreadxpm, ignorethreadxpmmask,
-                     ignorethread_xpm);
+       /*PIXMAP_CREATE(summaryview->ctree, ignorethreadxpm, ignorethreadxpmmask,
+                     ignorethread_xpm);*/
        PIXMAP_CREATE(summaryview->ctree, clipxpm, clipxpmmask, clip_xpm);
        PIXMAP_CREATE(summaryview->hbox, folderxpm, folderxpmmask,
                      DIRECTORY_OPEN_XPM);
@@ -764,6 +787,20 @@ void summary_init(SummaryView *summaryview)
                                    S_COL_MIME, pixmap);
        gtk_widget_show(pixmap);
 
+       if (!bold_style) {
+               bold_style = gtk_style_copy
+                       (gtk_widget_get_style(summaryview->ctree));
+               if (!boldfont)
+                       boldfont = gdk_fontset_load(prefs_common.boldfont);
+               bold_style->font = boldfont;
+               bold_marked_style = gtk_style_copy(bold_style);
+               bold_marked_style->fg[GTK_STATE_NORMAL] =
+                       summaryview->color_marked;
+               bold_deleted_style = gtk_style_copy(bold_style);
+               bold_deleted_style->fg[GTK_STATE_NORMAL] =
+                       summaryview->color_dim;
+       }
+
        if (!smallfont)
                smallfont = gdk_fontset_load(SMALL_FONT);
 
@@ -852,9 +889,13 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCTreeNode *node;
-       GSList *mlist = NULL; gchar *buf;
+       GSList *mlist = NULL;
+       gchar *buf;
        gboolean is_refresh;
        guint prev_msgnum = 0;
+       guint selected_msgnum = 0;
+       guint displayed_msgnum = 0;
+
        GtkCTreeNode *selected_node = summaryview->folderview->selected;
        GSList *cur;
        gint sort_mode;
@@ -864,11 +905,11 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        is_refresh = (!prefs_common.open_inbox_on_inc &&
                      item == summaryview->folder_item) ? TRUE : FALSE;
-
        if (is_refresh) {
-               prev_msgnum = summary_get_current_msgnum(summaryview);
-               if (prev_msgnum < 1)
-                       is_refresh = FALSE;
+               selected_msgnum = summary_get_msgnum(summaryview,
+                                                    summaryview->selected);
+               displayed_msgnum = summary_get_msgnum(summaryview,
+                                                     summaryview->displayed);
        }
 
        /* process the marks if any */
@@ -897,7 +938,8 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        summary_clear_list(summaryview);
        summary_set_menu_sensitive(summaryview);
-       messageview_clear(summaryview->messageview);
+       if (!is_refresh)
+               messageview_clear(summaryview->messageview);
 
        buf = NULL;
        if (!item || !item->path || !item->parent || item->no_select ||
@@ -906,6 +948,8 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
              change_dir(buf) < 0))) {
                g_free(buf);
                debug_print(_("empty folder\n\n"));
+               if (is_refresh)
+                       messageview_clear(summaryview->messageview);
                summary_clear_all(summaryview);
                summaryview->folder_item = item;
                gtk_clist_thaw(GTK_CLIST(ctree));
@@ -915,7 +959,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        summaryview->folder_item = item;
 
-       gtk_signal_disconnect_by_data(GTK_OBJECT(ctree), summaryview);
+       gtk_signal_handler_block_by_data(GTK_OBJECT(ctree), summaryview);
 
        buf = g_strdup_printf(_("Scanning folder (%s)..."), item->path);
        debug_print("%s\n", buf);
@@ -971,30 +1015,9 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        summary_write_cache(summaryview);
 
-       gtk_signal_connect(GTK_OBJECT(ctree), "tree_select_row",
-                          GTK_SIGNAL_FUNC(summary_selected), summaryview);
-       gtk_signal_connect(GTK_OBJECT(ctree), "button_press_event",
-                          GTK_SIGNAL_FUNC(summary_button_pressed),
-                          summaryview);
-       gtk_signal_connect(GTK_OBJECT(ctree), "button_release_event",
-                          GTK_SIGNAL_FUNC(summary_button_released),
-                          summaryview);
-       gtk_signal_connect(GTK_OBJECT(ctree), "key_press_event",
-                          GTK_SIGNAL_FUNC(summary_key_pressed), summaryview);
-       gtk_signal_connect(GTK_OBJECT(ctree), "resize_column",
-                          GTK_SIGNAL_FUNC(summary_col_resized), summaryview);
-        gtk_signal_connect(GTK_OBJECT(ctree), "open_row",
-                          GTK_SIGNAL_FUNC(summary_open_row), summaryview);
-
-       /*connect drag and drop signal*/
-       gtk_signal_connect(GTK_OBJECT (ctree),"start_drag",
-                          GTK_SIGNAL_FUNC (summary_start_drag),
-                          summaryview);
-       gtk_signal_connect(GTK_OBJECT (ctree),"drag_data_get",
-                          GTK_SIGNAL_FUNC (summary_drag_data_get),
-                          summaryview);
+       gtk_signal_handler_unblock_by_data(GTK_OBJECT(ctree), summaryview);
 
-        gtk_clist_thaw(GTK_CLIST(ctree));
+       gtk_clist_thaw(GTK_CLIST(ctree));
 
        /* sort before */
        sort_mode = prefs_folder_item_get_sort_mode(item);
@@ -1011,7 +1034,12 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
        }
 
        if (is_refresh) {
-               summary_select_by_msgnum(summaryview, prev_msgnum);
+               summaryview->displayed =
+                       summary_find_msg_by_msgnum(summaryview,
+                                                  displayed_msgnum);
+               if (!summaryview->displayed)
+                       messageview_clear(summaryview->messageview);
+               summary_select_by_msgnum(summaryview, selected_msgnum);
        } else {
                /* select first unread message */
                if (sort_mode == SORT_BY_SCORE)
@@ -1024,6 +1052,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                        node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list_end);
                if (node) {
                        GTK_EVENTS_FLUSH();
+                       gtkut_ctree_expand_parent_all(ctree, node);
                        gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0);
                        gtk_widget_grab_focus(GTK_WIDGET(ctree));
                        if (prefs_common.open_unread_on_enter)
@@ -1175,8 +1204,8 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
 #if MARK_ALL_READ      
        menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE);
 #endif 
-       menu_set_sensitive(ifactory, "/Mark/Ignore thread",   TRUE);
-       menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);
+       /*menu_set_sensitive(ifactory, "/Mark/Ignore thread",   TRUE);
+       menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);*/
 
        menu_set_sensitive(ifactory, "/Select all", TRUE);
 
@@ -1188,6 +1217,32 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        menu_set_sensitive(ifactory, "/Follow-up and reply to", sens);
 }
 
+static void summary_set_add_sender_menu(SummaryView *summaryview)
+{
+       GtkWidget *menu;
+       GtkWidget *submenu;
+       MsgInfo *msginfo;
+       gchar *from;
+
+       menu = gtk_item_factory_get_item(summaryview->popupfactory,
+                                        "/Add sender to address book");
+       msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
+                                             summaryview->selected);
+       if (!msginfo || !msginfo->from) {
+               gtk_widget_set_sensitive(menu, FALSE);
+               submenu = gtk_menu_new();
+               gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), submenu);
+               return;
+       }
+
+       gtk_widget_set_sensitive(menu, TRUE);
+       Xstrdup_a(from, msginfo->from, return);
+       eliminate_address_comment(from);
+       extract_address(from);
+       addressbook_add_submenu(menu, msginfo->fromname, from, NULL);
+
+}
+
 void summary_select_next_unread(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
@@ -1197,6 +1252,7 @@ void summary_select_next_unread(SummaryView *summaryview)
                                            summaryview->selected);
 
        if (node) {
+               gtkut_ctree_expand_parent_all(ctree, node);
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
                gtk_sctree_select(GTK_SCTREE(ctree), node);
 
@@ -1294,28 +1350,23 @@ void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
 
        if (node) {
                GTK_EVENTS_FLUSH();
+               gtkut_ctree_expand_parent_all(ctree, node);
                gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0);
                gtk_widget_grab_focus(GTK_WIDGET(ctree));
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
+               summaryview->display_msg = FALSE;
                gtk_sctree_select(GTK_SCTREE(ctree), node);
-               if (summaryview->msg_is_toggled_on) {
-                       if (summaryview->displayed == node)
-                               summaryview->displayed = NULL;
-                       summary_display_msg(summaryview, node, FALSE);
-               }
        }
 }
 
-guint summary_get_current_msgnum(SummaryView *summaryview)
+static guint summary_get_msgnum(SummaryView *summaryview, GtkCTreeNode *node)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        MsgInfo *msginfo;
 
-       if (!summaryview->selected)
-               return 0;
-       msginfo = gtk_ctree_node_get_row_data(ctree, summaryview->selected);
-       if (!msginfo)
+       if (!node)
                return 0;
+       msginfo = gtk_ctree_node_get_row_data(ctree, node);
        return msginfo->msgnum;
 }
 
@@ -1328,13 +1379,12 @@ static GtkCTreeNode *summary_find_next_unread_msg(SummaryView *summaryview,
 
        if (current_node)
                node = current_node;
-               /*node = GTK_CTREE_NODE_NEXT(current_node);*/
        else
                node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
-       for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+       for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) break;
+               if (MSG_IS_UNREAD(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/) break;
        }
 
        return node;
@@ -1524,9 +1574,9 @@ static void summary_set_marks_func(GtkCTree *ctree, GtkCTreeNode *node,
 
        msginfo = gtk_ctree_node_get_row_data(ctree, node);
 
-       if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
+       if (MSG_IS_NEW(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
                summaryview->newmsgs++;
-       if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
+       if (MSG_IS_UNREAD(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
                summaryview->unread++;
        if (MSG_IS_DELETED(msginfo->flags))
                summaryview->deleted++;
@@ -1551,9 +1601,9 @@ static void summary_update_status(SummaryView *summaryview)
             node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
                msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
 
-               if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
+               if (MSG_IS_NEW(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
                        summaryview->newmsgs++;
-               if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
+               if (MSG_IS_UNREAD(msginfo->flags)/* && !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
                        summaryview->unread++;
                if (MSG_IS_DELETED(msginfo->flags))
                        summaryview->deleted++;
@@ -1637,7 +1687,7 @@ static void summary_status_show(SummaryView *summaryview)
        g_free(cp);
 
        if (summaryview->folder_item &&
-           summaryview->folder_item->folder->type == F_MH) {
+           FOLDER_IS_LOCAL(summaryview->folder_item->folder)) {
                str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
                                      summaryview->newmsgs,
                                      summaryview->unread,
@@ -1764,6 +1814,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
        debug_print(_("\tSetting summary from message data..."));
        STATUSBAR_PUSH(summaryview->mainwin,
                       _("Setting summary from message data..."));
+       gdk_flush();
 
        msgid_table = g_hash_table_new(g_str_hash, g_str_equal);
        summaryview->msgid_table = msgid_table;
@@ -1773,7 +1824,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
        if (prefs_common.use_addr_book)
                start_address_completion();
        
-       main_window_set_thread_option(summaryview->mainwin);
+       /*main_window_set_thread_option(summaryview->mainwin)*/;
 
        for (cur = mlist ; cur != NULL; cur = cur->next) {
                msginfo = (MsgInfo *)cur->data;
@@ -1788,8 +1839,8 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                                summaryview->folder_item->prefs->important_score;
        }
        
-       /*      if (prefs_common.enable_thread) { */
-       if (summaryview->folder_item->prefs->enable_thread) {
+               if (prefs_common.enable_thread) {
+       /*if (summaryview->folder_item->prefs->enable_thread) { */
                for (; mlist != NULL; mlist = mlist->next) {
                        msginfo = (MsgInfo *)mlist->data;
                        parent = NULL;
@@ -1808,22 +1859,22 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                        }
                        if(parent) {
                                parentinfo = gtk_ctree_node_get_row_data(ctree, parent);
-                               if(parentinfo && MSG_IS_IGNORE_THREAD(parentinfo->flags)) {
+                               /*if(parentinfo && MSG_IS_IGNORE_THREAD(parentinfo->flags)) {*/
 /*
                                        if (MSG_IS_NEW(msginfo->flags))
                                                summaryview->newmsgs--;
                                        if (MSG_IS_UNREAD(msginfo->flags))
                                                summaryview->unread--;
 */
-                                       MSG_SET_PERM_FLAGS(msginfo->flags, MSG_IGNORE_THREAD);
-                               }
+                                       /*MSG_SET_PERM_FLAGS(msginfo->flags, MSG_IGNORE_THREAD);
+                               }*/
                        }
 
                        node = gtk_ctree_insert_node
                                (ctree, parent, NULL, text, 2,
-                                NULL, NULL, NULL, NULL, FALSE, TRUE);
+                                NULL, NULL, NULL, NULL, FALSE,
+                                parent ? TRUE : FALSE);
                        GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
-
                        summary_set_marks_func(ctree, node, summaryview);
                        
                        if (MSG_GET_LABEL(msginfo->flags))
@@ -1878,7 +1929,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                }
 
                /* complete the thread */
-               summary_thread_build(summaryview);
+               summary_thread_build(summaryview, TRUE);
        } else {
                for (; mlist != NULL; mlist = mlist->next) {
                        msginfo = (MsgInfo *)mlist->data;
@@ -1887,7 +1938,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
 
                        node = gtk_ctree_insert_node
                                (ctree, NULL, NULL, text, 2,
-                                NULL, NULL, NULL, NULL, FALSE, TRUE);
+                                NULL, NULL, NULL, NULL, FALSE, FALSE);
                        GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
                        summary_set_marks_func(ctree, node, summaryview);
 
@@ -2130,6 +2181,7 @@ static void summary_display_msg(SummaryView *summaryview, GtkCTreeNode *row,
        lock = TRUE;
 
        STATUSBAR_POP(summaryview->mainwin);
+       GTK_EVENTS_FLUSH();
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
 
@@ -2140,9 +2192,9 @@ static void summary_display_msg(SummaryView *summaryview, GtkCTreeNode *row,
        }
        g_free(filename);
 
-       if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
+       if (MSG_IS_NEW(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
                summaryview->newmsgs--;
-       if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
+       if (MSG_IS_UNREAD(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
                summaryview->unread--;
        if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
                MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_NEW | MSG_UNREAD);
@@ -2233,6 +2285,13 @@ void summary_step(SummaryView *summaryview, GtkScrollType type)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
+       if (type == GTK_SCROLL_STEP_FORWARD) {
+               GtkCTreeNode *node;
+               node = gtkut_ctree_node_next(ctree, summaryview->selected);
+               if (node)
+                       gtkut_ctree_expand_parent_all(ctree, node);
+       }
+
        gtk_signal_emit_by_name(GTK_OBJECT(ctree), "scroll_vertical",
                                type, 0.0);
 
@@ -2281,9 +2340,50 @@ static void summary_toggle_view(SummaryView *summaryview)
        gtk_widget_grab_focus(summaryview->ctree);
 }
 
+static gboolean summary_search_unread_recursive(GtkCTree *ctree,
+                                               GtkCTreeNode *node)
+{
+       MsgInfo *msginfo;
+
+       if (node) {
+               msginfo = gtk_ctree_node_get_row_data(ctree, node);
+               if (msginfo && MSG_IS_UNREAD(msginfo->flags))
+                       return TRUE;
+               node = GTK_CTREE_ROW(node)->children;
+       } else
+               node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
+
+       while (node) {
+               if (summary_search_unread_recursive(ctree, node) == TRUE)
+                       return TRUE;
+               node = GTK_CTREE_ROW(node)->sibling;
+       }
+
+       return FALSE;
+}
+
+static gboolean summary_have_unread_children(SummaryView *summaryview,
+                                            GtkCTreeNode *node)
+{
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+
+       if (!node) return FALSE;
+
+       node = GTK_CTREE_ROW(node)->children;
+
+       while (node) {
+               if (summary_search_unread_recursive(ctree, node) == TRUE)
+                       return TRUE;
+               node = GTK_CTREE_ROW(node)->sibling;
+       }
+
+       return FALSE;
+}
+
 static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GtkStyle *style = NULL;
        MsgInfo *msginfo;
        MsgFlags flags;
 
@@ -2295,10 +2395,10 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
        gtk_ctree_node_set_foreground(ctree, row, NULL);
 
        /* set new/unread column */
-       if (MSG_IS_IGNORE_THREAD(flags)) {
+       /*if (MSG_IS_IGNORE_THREAD(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
                                          ignorethreadxpm, ignorethreadxpmmask);
-       } else if (MSG_IS_NEW(flags)) {
+       } else*/ if (MSG_IS_NEW(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
                                          newxpm, newxpmmask);
        } else if (MSG_IS_UNREAD(flags)) {
@@ -2314,21 +2414,37 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                gtk_ctree_node_set_text(ctree, row, S_COL_UNREAD, NULL);
        }
 
+       if (prefs_common.bold_unread &&
+           (MSG_IS_UNREAD(flags) ||
+            (!GTK_CTREE_ROW(row)->expanded &&
+             GTK_CTREE_ROW(row)->children &&
+             summary_have_unread_children(summaryview, row))))
+               style = bold_style;
+
        /* set mark column */
        if (MSG_IS_DELETED(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, S_COL_MARK,
                                          deletedxpm, deletedxpmmask);
-               gtk_ctree_node_set_foreground(ctree, row,
-                                             &summaryview->color_dim);
+               if (style)
+                       style = bold_deleted_style;
+               else
+                       gtk_ctree_node_set_foreground
+                               (ctree, row, &summaryview->color_dim);
        } else if (MSG_IS_MARKED(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, S_COL_MARK,
                                          markxpm, markxpmmask);
        } else if (MSG_IS_MOVE(flags)) {
                gtk_ctree_node_set_text(ctree, row, S_COL_MARK, "o");
-               gtk_ctree_node_set_foreground(ctree, row,
-                                             &summaryview->color_marked);
+               if (style)
+                       style = bold_marked_style;
+               else
+                       gtk_ctree_node_set_foreground
+                               (ctree, row, &summaryview->color_marked);
        } else if (MSG_IS_COPY(flags)) {
                gtk_ctree_node_set_text(ctree, row, S_COL_MARK, "O");
+                if (style)
+                       style = bold_marked_style;
+               else
                gtk_ctree_node_set_foreground(ctree, row,
                                              &summaryview->color_marked);
        }
@@ -2349,6 +2465,8 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
        } else {
                gtk_ctree_node_set_text(ctree, row, S_COL_MIME, NULL);
        }
+
+       gtk_ctree_node_set_row_style(ctree, row, style);
 }
 
 void summary_set_marks_selected(SummaryView *summaryview)
@@ -2363,6 +2481,7 @@ static void summary_mark_row(SummaryView *summaryview, GtkCTreeNode *row)
        MsgInfo *msginfo;
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
+       msginfo->to_folder = NULL;
        if (MSG_IS_DELETED(msginfo->flags))
                summaryview->deleted--;
        if (MSG_IS_MOVE(msginfo->flags)) {
@@ -2406,9 +2525,9 @@ static void summary_mark_row_as_read(SummaryView *summaryview,
        MsgInfo *msginfo;
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
-       if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
+       if (MSG_IS_NEW(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
                summaryview->newmsgs--;
-       if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
+       if (MSG_IS_UNREAD(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
                summaryview->unread--;
        if (MSG_IS_NEW(msginfo->flags) ||
            MSG_IS_UNREAD(msginfo->flags)) {
@@ -2588,6 +2707,7 @@ static void summary_unmark_row(SummaryView *summaryview, GtkCTreeNode *row)
        MsgInfo *msginfo;
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
+       msginfo->to_folder = NULL;
        if (MSG_IS_DELETED(msginfo->flags))
                summaryview->deleted--;
        if (MSG_IS_MOVE(msginfo->flags)) {
@@ -2889,8 +3009,8 @@ void summary_execute(SummaryView *summaryview)
 
        gtk_clist_freeze(clist);
 
-       if (summaryview->folder_item->prefs->enable_thread)
-               /*      if (prefs_common.enable_thread) */
+       /*if (summaryview->folder_item->prefs->enable_thread) */
+                       if (prefs_common.enable_thread)
                summary_unthread_for_exec(summaryview);
 
        summary_execute_move(summaryview);
@@ -2913,9 +3033,9 @@ void summary_execute(SummaryView *summaryview)
                node = next;
        }
 
-       if (summaryview->folder_item->prefs->enable_thread)
-               /*      if (prefs_common.enable_thread) */
-               summary_thread_build(summaryview);
+       /*if (summaryview->folder_item->prefs->enable_thread) */
+       if (prefs_common.enable_thread) 
+               summary_thread_build(summaryview, FALSE);
 
        summaryview->selected = clist->selection ?
                GTK_CTREE_NODE(clist->selection->data) : NULL;
@@ -3097,20 +3217,74 @@ static void summary_execute_delete_func(GtkCTree *ctree, GtkCTreeNode *node,
 
 /* thread functions */
 
-void summary_thread_build(SummaryView *summaryview)
+void summary_thread_build(SummaryView *summaryview, gboolean init)
 {
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GtkCTreeNode *node;
+       GtkCTreeNode *next;
+       GtkCTreeNode *parent;
+       MsgInfo *msginfo;
+
        debug_print(_("Building threads..."));
        STATUSBAR_PUSH(summaryview->mainwin, _("Building threads..."));
        main_window_cursor_wait(summaryview->mainwin);
 
-       gtk_clist_freeze(GTK_CLIST(summaryview->ctree));
+       gtk_signal_handler_block_by_func(GTK_OBJECT(ctree),
+                                        summary_tree_expanded, summaryview);
+       gtk_clist_freeze(GTK_CLIST(ctree));
 
-       gtk_ctree_pre_recursive_to_depth
-               (GTK_CTREE(summaryview->ctree), NULL, 1,
-                GTK_CTREE_FUNC(summary_thread_func),
-                summaryview);
+       node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
+       while (node) {
+               next = GTK_CTREE_ROW(node)->sibling;
+
+               msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
+               if (msginfo && msginfo->inreplyto) {
+                       parent = g_hash_table_lookup(summaryview->msgid_table,
+                                                    msginfo->inreplyto);
+                       if (parent && parent != node) {
+                               gtk_ctree_move(ctree, node, parent, NULL);
+                               gtk_ctree_expand(ctree, node);
+                       }
+               }
+
+               node = next;
+       }
+
+       node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
+
+       /* for optimization */
+       if (init) {
+               if (prefs_common.expand_thread) {
+                       while (node) {
+                               next = GTK_CTREE_ROW(node)->sibling;
+                               if (GTK_CTREE_ROW(node)->children)
+                                       gtk_ctree_expand(ctree, node);
+                               node = next;
+                       }
+               } else if (prefs_common.bold_unread) {
+                       while (node) {
+                               next = GTK_CTREE_ROW(node)->sibling;
+                               if (GTK_CTREE_ROW(node)->children)
+                                       summary_set_row_marks
+                                               (summaryview, node);
+                               node = next;
+                       }
+               }
+       } else {
+               while (node) {
+                       next = GTK_CTREE_NODE_NEXT(node);
+                       if (prefs_common.expand_thread)
+                               gtk_ctree_expand(ctree, node);
+                       if (prefs_common.bold_unread &&
+                           GTK_CTREE_ROW(node)->children)
+                               summary_set_row_marks(summaryview, node);
+                       node = next;
+               }
+       }
 
-       gtk_clist_thaw(GTK_CLIST(summaryview->ctree));
+       gtk_clist_thaw(GTK_CLIST(ctree));
+       gtk_signal_handler_unblock_by_func(GTK_OBJECT(ctree),
+                                          summary_tree_expanded, summaryview);
 
        debug_print(_("done.\n"));
        STATUSBAR_POP(summaryview->mainwin);
@@ -3119,21 +3293,35 @@ void summary_thread_build(SummaryView *summaryview)
 
 void summary_unthread(SummaryView *summaryview)
 {
-       GtkCTreeNode *node;
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GtkCTreeNode *node;
+       GtkCTreeNode *child;
+       GtkCTreeNode *sibling;
+       GtkCTreeNode *next_child;
 
        debug_print(_("Unthreading..."));
        STATUSBAR_PUSH(summaryview->mainwin, _("Unthreading..."));
        main_window_cursor_wait(summaryview->mainwin);
 
+       gtk_signal_handler_block_by_func(GTK_OBJECT(ctree),
+                                        summary_tree_collapsed, summaryview);
        gtk_clist_freeze(GTK_CLIST(ctree));
 
        for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
             node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
-               summary_unthread_func(ctree, node, NULL);
+               child = GTK_CTREE_ROW(node)->children;
+               sibling = GTK_CTREE_ROW(node)->sibling;
+
+               while (child != NULL) {
+                       next_child = GTK_CTREE_ROW(child)->sibling;
+                       gtk_ctree_move(ctree, child, NULL, sibling);
+                       child = next_child;
+               }
        }
 
        gtk_clist_thaw(GTK_CLIST(ctree));
+       gtk_signal_handler_unblock_by_func(GTK_OBJECT(ctree),
+                                          summary_tree_collapsed, summaryview);
 
        debug_print(_("done.\n"));
        STATUSBAR_POP(summaryview->mainwin);
@@ -3159,52 +3347,6 @@ static void summary_unthread_for_exec(SummaryView *summaryview)
        debug_print(_("done.\n"));
 }
 
-static void summary_thread_func(GtkCTree *ctree, GtkCTreeNode *node,
-                               gpointer data)
-{
-       MsgInfo *msginfo;
-       GtkCTreeNode *parent = NULL;
-       
-       SummaryView * summaryview = (SummaryView *) data;
-       GHashTable *msgid_table = summaryview->msgid_table;
-       GHashTable *subject_table = summaryview->subject_table;
-
-       msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
-
-       if (!msginfo) return;
-
-       if(msginfo->inreplyto) {
-           parent = g_hash_table_lookup(msgid_table, msginfo->inreplyto);
-       }
-       if (parent == NULL && msginfo->subject &&
-           g_strncasecmp(msginfo->subject, "Re: ", 4) == 0) {
-               parent = subject_table_lookup(subject_table, msginfo->subject);
-       }
-
-       if (parent && parent != node) {
-               gtk_ctree_move(ctree, node, parent, NULL);
-               gtk_ctree_expand(ctree, parent);
-       }
-}
-
-static void summary_unthread_func(GtkCTree *ctree, GtkCTreeNode *node,
-                                 gpointer data)
-{
-       GtkCTreeNode *child;
-       GtkCTreeNode *sibling;
-
-       child = GTK_CTREE_ROW(node)->children;
-       sibling = GTK_CTREE_ROW(node)->sibling;
-
-       while (child != NULL) {
-               GtkCTreeNode *next_child;
-
-               next_child = GTK_CTREE_ROW(child)->sibling;
-               gtk_ctree_move(ctree, child, NULL, sibling);
-               child = next_child;
-       }
-}
-
 static void summary_unthread_for_exec_func(GtkCTree *ctree, GtkCTreeNode *node,
                                           gpointer data)
 {
@@ -3326,7 +3468,7 @@ static void summary_button_pressed(GtkWidget *ctree, GdkEventButton *event,
 
        if (event->button == 3) {
                /* right clicked */
-               summary_add_sender_to_cb(summaryview, 0, 0);    
+               summary_set_add_sender_menu(summaryview);
                gtk_menu_popup(GTK_MENU(summaryview->popupmenu), NULL, NULL,
                               NULL, NULL, event->button, event->time);
        } else if (event->button == 2) {
@@ -3539,6 +3681,18 @@ static void summary_open_row(GtkSCTree *sctree, SummaryView *summaryview)
        summaryview->display_msg = FALSE;
 }
 
+static void summary_tree_expanded(GtkCTree *ctree, GtkCTreeNode *node,
+                                 SummaryView *summaryview)
+{
+       summary_set_row_marks(summaryview, node);
+}
+
+static void summary_tree_collapsed(GtkCTree *ctree, GtkCTreeNode *node,
+                                  SummaryView *summaryview)
+{
+       summary_set_row_marks(summaryview, node);
+}
+
 static void summary_selected(GtkCTree *ctree, GtkCTreeNode *row,
                             gint column, SummaryView *summaryview)
 {
@@ -3698,65 +3852,6 @@ static void summary_show_all_header_cb(SummaryView *summaryview,
        header_window_show_cb(summaryview->mainwin, action, widget);
 }
 
-static void summary_add_sender_to_cb (SummaryView                      *summaryview,
-                                        guint                   action,
-                                        GtkWidget              *widget_)
-{
-       const gint       ADD_SENDER_TO_ADDRESSBOOK_MENU_POS = 13;
-       GtkWidget       *submenu;                                               
-       GList           *groups, *tmp;
-       GtkMenuShell    *menushell;
-       GtkWidget       *menu;
-       GtkWidget       *menuitem;
-       GList           *child;
-       gboolean        found = FALSE;
-       MsgInfo        *msginfo;
-       gchar          *from_address;
-
-       menushell = GTK_MENU_SHELL(summaryview->popupmenu);
-       g_return_if_fail(menushell != NULL);
-       child = menushell->children;
-       g_return_if_fail(child);
-
-       /* we're iterating each menu item searching for the one with 
-        * a "contacts" object data. if not found add the menu,
-        * else update it */
-       for (child = g_list_first(menushell->children); child; child = g_list_next(child)) {
-               if (gtk_object_get_data(GTK_OBJECT(child->data), "contacts")) {
-                       found = TRUE;
-                       break;
-               }
-       }
-
-       /* add item to default context menu if not present */
-       if (!found) {
-               submenu = gtk_menu_item_new_with_label(_("Add sender to address book"));
-               gtk_object_set_data(GTK_OBJECT(submenu), "contacts", (gpointer)1);
-               gtk_menu_insert(GTK_MENU(summaryview->popupmenu), submenu, ADD_SENDER_TO_ADDRESSBOOK_MENU_POS);
-               gtk_widget_show(submenu);
-       }
-       else {
-               submenu = (GtkWidget *) child->data;
-       }
-
-       /* get the address info from the summary view */
-       msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
-                                                                                                  summaryview->selected);
-
-       if (msginfo != NULL && msginfo->fromname != NULL && msginfo->from != NULL) {
-               gtk_widget_set_sensitive(GTK_WIDGET(submenu), TRUE);
-               from_address = g_strdup(msginfo->from);
-               eliminate_address_comment(from_address);
-               extract_address(from_address);
-               log_message("adding %s %s\n", msginfo->fromname, from_address);
-               addressbook_add_contact_by_menu(submenu, msginfo->fromname, from_address, NULL);
-               g_free(from_address);
-       }               
-       else {
-               gtk_widget_set_sensitive(GTK_WIDGET(submenu), FALSE);
-       }
-}
-
 static void summary_num_clicked(GtkWidget *button, SummaryView *summaryview)
 {
        summary_sort(summaryview, SORT_BY_NUMBER);
@@ -3810,10 +3905,8 @@ void summary_change_display_item(SummaryView *summaryview)
        gtk_clist_set_column_visibility(clist, S_COL_SUBJECT, prefs_common.show_subject);
 }
 
-static void summary_start_drag (GtkWidget   *widget,
-                               gint         button,
-                               GdkEvent    *event,
-                               SummaryView *summaryview)
+static void summary_start_drag(GtkWidget *widget, gint button, GdkEvent *event,
+                              SummaryView *summaryview)
 {
        GtkTargetList *list;
        GdkDragContext *context;
@@ -3961,7 +4054,7 @@ static gint summary_cmp_by_score(GtkCList *clist,
                return summary_cmp_by_date(clist, ptr1, ptr2);
 }
 
-static void summary_ignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
+/*static void summary_ignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
 {
        SummaryView *summaryview = (SummaryView *) data;
        MsgInfo *msginfo;
@@ -4021,5 +4114,5 @@ static void summary_unignore_thread(SummaryView *summaryview)
        }
 
        summary_status_show(summaryview);
-}
+} */
 
index 2d9d27f..55b5df3 100644 (file)
@@ -168,7 +168,8 @@ void summary_select_prev_marked   (SummaryView              *summaryview);
 void summary_select_by_msgnum    (SummaryView          *summaryview,
                                   guint                 msgnum);
 guint summary_get_current_msgnum  (SummaryView         *summaryview);
-void summary_thread_build        (SummaryView          *summaryview);
+void summary_thread_build        (SummaryView          *summaryview,
+                                  gboolean             init);
 void summary_unthread            (SummaryView          *summaryview);
 void summary_filter              (SummaryView          *summaryview);
 void summary_sort                (SummaryView          *summaryview,
index 13b018b..dbed263 100644 (file)
@@ -1271,7 +1271,7 @@ static void textview_button_pressed(GtkWidget *widget, GdkEventButton *event,
                                                fromname = procheader_get_fromname(fromaddress);
                                                extract_address(fromaddress);
                                                g_message("adding from textview %s <%s>", fromname, fromaddress);
-                                               addressbook_add_contact_by_menu(NULL, fromname, fromaddress, NULL);
+                                               addressbook_add_submenu(NULL, fromname, fromaddress, NULL);
                                                g_free(fromaddress);
                                                g_free(fromname);
                                        } else {
index 43d6a3b..e12d18a 100644 (file)
@@ -135,7 +135,7 @@ gchar *itos(gint n)
 
 gchar *to_human_readable(off_t size)
 {
-       static gchar str[9];
+       static gchar str[10];
        gint count;
        guint32 div = 1;
 
@@ -150,10 +150,10 @@ gchar *to_human_readable(off_t size)
        case 0: g_snprintf(str, sizeof(str), "%dB",    (gint)size);   break;
        case 1: g_snprintf(str, sizeof(str), "%.1fKB", (gfloat)size / div);
                break;
-       case 2: g_snprintf(str, sizeof(str), "%.1fMB", (gfloat)size / div);
+       case 2: g_snprintf(str, sizeof(str), "%.2fMB", (gfloat)size / div);
                break;
        default:
-               g_snprintf(str, sizeof(str), "%.1fGB", (gfloat)size / div);
+               g_snprintf(str, sizeof(str), "%.2fGB", (gfloat)size / div);
                break;
        }