From 72042fc35ab0b4fe40f8dfa4c8fbf55758bd3663 Mon Sep 17 00:00:00 2001 From: Alfons Hoogervorst Date: Sun, 15 Jul 2001 13:42:30 +0000 Subject: [PATCH] sync with Hiroyuki's 0.5.0claws2-3 --- ChangeLog | 56 +++++ ChangeLog.claws | 6 + ChangeLog.jp | 60 +++++ INSTALL | 6 +- INSTALL.jp | 4 +- README | 14 +- README.jp | 14 +- TODO | 4 +- TODO.jp | 6 +- configure.in | 2 +- src/Makefile.am | 6 +- src/account.c | 10 +- src/defs.h | 3 +- src/folder.c | 4 +- src/folderview.c | 4 +- src/{grouplist_dialog.c => grouplistdialog.c} | 212 +++++++++++------- src/{grouplist_dialog.h => grouplistdialog.h} | 5 +- src/inc.c | 5 +- src/news.c | 183 ++++++++------- src/news.h | 6 +- src/recv.c | 14 +- src/recv.h | 1 + src/send.c | 2 +- 23 files changed, 394 insertions(+), 233 deletions(-) rename src/{grouplist_dialog.c => grouplistdialog.c} (53%) rename src/{grouplist_dialog.h => grouplistdialog.h} (90%) diff --git a/ChangeLog b/ChangeLog index 1f648a37b..8d78e0ef7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,59 @@ +2001-07-15 + + * README + README.jp + INSTALL + INSTALL.jp + TODO + TODO.jp: updated. + * src/grouplistdialog.c: grouplist_dialog_set_list(): update UI + while retrieving newsgroup list. + grouplist_dialog_create(): added entry widget and status label. + grouplist_recv_func(): new. + refresh_clicked(): added exclusive lock variable. + clist_selected(): set text entry when the CList is selected. + renamed from group_clist_select(). + entry_activated(): new. + grouplist_clear(): renamed from grouplist_free(). Also clears + list and entry widget. + * src/news.c: news_get_group_list(): sped up the list appending + (g_slist_append() becomes very slow if list size is large). + * src/defs.h: added UI_REFRESH_INTERVAL definition. + Changed the definition of NEWSGROUP_LIST. + * src/recv.c: recv_write() + src/send.c: send_message_smtp(): changed the UI refresh interval + to UI_REFRESH_INTERVAL (50msec). + * src/account.c: account_add(): fixed a bug that didn't update + folder tree when a news account was added. + * src/grouplistdialog.c: made exclusive lock variable global, and + lock at grouplist_dialog_set_list(). + +2001-07-15 + + * src/grouplistdialog.c: ok_clicked(), cancel_clicked(): don't + quit main loop if gtk_main_level() is 1. + grouplist_dialog_set_list(): freeze CList while appending the list. + grouplist_dialog(): show dialog before updating the list. + +2001-07-14 + + * src/folder.c: folder_write_list_recursive(): add the attribute + `collapsed' if a node have some children. + * src/grouplistdialog.[ch]: new. Newsgroups can be selected from + the list. + * src/news.[ch]: + news_get_group_list(): new. It returns newsgroup list. + news_remove_group_list(): new. It removes newsgroup list cache. + * src/folderview.c: folderview_new_news_group_cb(): call + grouplist_dialog() instead of input_dialog(). + +2001-07-12 + + * autogen.sh: modified. + * src/folder.[ch] + src/folderview.c: made expand/collapse state of folders persistent + (thanks to Alfons). + 2001-07-06 * version 0.5.0 diff --git a/ChangeLog.claws b/ChangeLog.claws index 26a3b67ce..391c7c6da 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,9 @@ +2001-07-15 [alfons] + + 0.5.1claws2 + + sync with Hiroyuki's 0.5.0cvs2-3 + 2001-07-15 [christoph] * src/procmsg.c diff --git a/ChangeLog.jp b/ChangeLog.jp index 684ae6047..021b97604 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,63 @@ +2001-07-15 + + * README + README.jp + INSTALL + INSTALL.jp + TODO + TODO.jp: ¹¹¿·¡£ + * src/grouplistdialog.c: grouplist_dialog_set_list(): ¥Ë¥å¡¼¥¹ + ¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤ò¼õ¿®Ãæ¤Ë UI ¤ò¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£ + grouplist_dialog_create(): ¥¨¥ó¥È¥ê¥¦¥£¥¸¥§¥Ã¥È¤È¥¹¥Æ¡¼¥¿¥¹¥é¥Ù¥ë + ¤òÄɲᣠ+ grouplist_recv_func(): ¿·µ¬¡£ + refresh_clicked(): ÇÓ¾¥í¥Ã¥¯ÊÑ¿ô¤òÄɲᣠ+ clist_selected(): CList ¤¬ÁªÂò¤µ¤ì¤¿¤é¥Æ¥­¥¹¥È¥¨¥ó¥È¥ê¤ò¥»¥Ã¥È¤¹¤ë + ¤è¤¦¤Ë¤·¤¿¡£ group_clist_select() ¤«¤é²þ̾¡£ + entry_activated(): ¿·µ¬¡£ + grouplist_clear(): grouplist_free() ¤«¤é²þ̾¡£¥ê¥¹¥È¤È¥¨¥ó¥È¥ê + ¥¦¥£¥¸¥§¥Ã¥È¤â¥¯¥ê¥¢¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£ + * src/news.c: news_get_group_list(): ¥ê¥¹¥È¤ÎÄɲäò¹â®²½ + (g_slist_append() ¤Ï¥ê¥¹¥È¤Î¥µ¥¤¥º¤¬Â礭¤¯¤Ê¤ë¤ÈÈó¾ï¤ËÃÙ¤¯¤Ê¤ë)¡£ + * src/defs.h: UI_REFRESH_INTERVAL ¤ÎÄêµÁ¤òÄɲᣠ+ NEWSGROUP_LIST ¤ÎÄêµÁ¤òÊѹ¹¡£ + * src/recv.c: recv_write() + src/send.c: send_message_smtp(): UI ¤Î¹¹¿·´Ö³Ö¤ò UI_REFRESH_INTERVAL + (50msec) ¤ËÊѹ¹¡£ + * src/account.c: account_add(): ¥Ë¥å¡¼¥¹¥¢¥«¥¦¥ó¥È¤òÄɲä·¤¿¤È¤­¤Ë + ¥Õ¥©¥ë¥À¥Ä¥ê¡¼¤ò¹¹¿·¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¥Ð¥°¤ò½¤Àµ¡£ + * src/grouplistdialog.c: ÇÓ¾¥í¥Ã¥¯ÊÑ¿ô¤ò¥°¥í¡¼¥Ð¥ë¤Ë¤·¡¢ + grouplist_dialog_set_list() ¤Ç¥í¥Ã¥¯¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£ + +2001-07-15 + + * src/grouplistdialog.c: ok_clicked(), cancel_clicked(): + gtk_main_level() ¤¬ 1 ¤Ê¤é¥á¥¤¥ó¥ë¡¼¥×¤òÈ´¤±¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£ + grouplist_dialog_set_list(): ¥ê¥¹¥È¤ÎÄɲÃÃæ¤Ë CList ¤ò¥Õ¥ê¡¼¥º + ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£ + grouplist_dialog(): ¥ê¥¹¥È¤ò¹¹¿·¤¹¤ëÁ°¤Ë¥À¥¤¥¢¥í¥°¤òɽ¼¨¤¹¤ë + ¤è¤¦¤Ë¤·¤¿¡£ + +2001-07-14 + + * src/folder.c: folder_write_list_recursive(): ¥Î¡¼¥É¤¬»Ò¤ò»ý¤Ã¤Æ + ¤¤¤ì¤Ð `collapsed' °À­¤òÄɲ乤ë¤è¤¦¤Ë¤·¤¿¡£ + * src/grouplistdialog.[ch]: ¿·µ¬¡£¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤ò°ìÍ÷¤«¤éÁªÂò + ²Äǽ¡£ + * src/news.[ch] + news_get_group_list(): ¿·µ¬¡£¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤Î¥ê¥¹¥È¤òÊÖ¤¹¡£ + news_remove_group_list(): ¿·µ¬¡£¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¥ê¥¹¥È¤Î¥­¥ã¥Ã¥·¥å + ¤òºï½ü¤¹¤ë¡£ + * src/folderview.c: folderview_new_news_group_cb(): input_dialog() + ¤ÎÂå¤ï¤ê¤Ë grouplist_dialog() ¤ò¸Æ¤Ö¤è¤¦¤Ë¤·¤¿¡£ + +2001-07-12 + + * autogen.sh: ½¤Àµ¡£ + * src/folder.[ch] + src/folderview.c: ¥Õ¥©¥ë¥À¤Î³«ÊľõÂÖ¤¬Êݸ¤µ¤ì¤ë¤è¤¦¤Ë¤·¤¿ + (Alfons ¤µ¤ó thanks)¡£ + 2001-07-06 * version 0.5.0 diff --git a/INSTALL b/INSTALL index 8d18fd172..a5ee42d6d 100644 --- a/INSTALL +++ b/INSTALL @@ -3,13 +3,13 @@ Installation This program requires GTK+ 1.2.6 or higher to be compiled. -This program is developed on Debian GNU/Linux (woody) -(Linux 2.2.x + glibc 2.2), so it is possible not to work correctly +This program is developed on Debian GNU/Linux (woody/sid) +(Linux 2.4.x + glibc 2.2), so it is possible not to work correctly on the other environment. It is confirmed to work on the following environments: -o Debian GNU/Linux (woody/sid) (glibc 2.2) +o Debian GNU/Linux (woody/sid) (glibc 2.2.x) o Kondara MNU/Linux (glibc 2.1.x) o Vine Linux 1.1 (glibc 2.0.x + libwcsmbs) o Vine Linux 2.0 (glibc 2.1.x) (Intel, PPC) diff --git a/INSTALL.jp b/INSTALL.jp index a8104e7c7..247eec45b 100644 --- a/INSTALL.jp +++ b/INSTALL.jp @@ -3,12 +3,12 @@ ¤³¤Î¥×¥í¥°¥é¥à¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤Ë¤Ï GTK+ 1.2.6 °Ê¹ß¤¬É¬ÍפǤ¹¡£ -¤³¤Î¥×¥í¥°¥é¥à¤Ï Debian GNU/Linux (woody) (Linux 2.2.x + glibc 2.2) +¤³¤Î¥×¥í¥°¥é¥à¤Ï Debian GNU/Linux (woody/sid) (Linux 2.4.x + glibc 2.2.x) ¾å¤Ç³«È¯¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢Â¾¤Î´Ä¶­¤Ç¤Ï¤¦¤Þ¤¯Æ°ºî¤·¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ °Ê²¼¤Î´Ä¶­¤ÇÆ°ºî¤¬³Îǧ¤µ¤ì¤Æ¤¤¤Þ¤¹: -o Debian GNU/Linux (woody/sid) (glibc 2.2) +o Debian GNU/Linux (woody/sid) (glibc 2.2.x) o Kondara MNU/Linux (glibc 2.1.x) o Vine Linux 1.1 (glibc 2.0.x + libwcsmbs) o Vine Linux 2.0 (glibc 2.1.x) (Intel, PPC) diff --git a/README b/README index 70759a4a0..93d946fe2 100644 --- a/README +++ b/README @@ -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 @@ -25,10 +25,10 @@ What's Sylpheed Sylpheed is an e-mail client (and news reader) based on GTK+, running on X Window System, and aiming for - * Quick response - * Graceful, and sophisticated interface - * Easy configuration, intuitive operation - * Abundant features + * Quick response + * Graceful, and sophisticated interface + * Easy configuration, intuitive operation + * Abundant features The appearance and interface are similar to some popular e-mail clients for Windows, such as Outlook Express, Becky!, and Datula. The interface is also @@ -47,6 +47,7 @@ Currently implemented features are: o ability of keyboard-only operation o Mew/Wanderlust-like key bind (most of normally used keys have been implemented) + o IMAP4rev1 support o multipart MIME o built-in image view o X-Face support @@ -64,7 +65,7 @@ Currently implemented features are: o IPv6 support o GnuPG support (currently implementing) o multithread support (experimental) - o mbox importing + o mbox importing / exporting o drag & drop (partially implemented) o fast thread display o high-speed message processing @@ -72,7 +73,6 @@ Currently implemented features are: o easily customizable configuration o supports automake + autoconf, and internationalization of message by gettext - o IMAP4 support (currently implementing) You'll figure out the usage if you have used a mailer on Windows, or Mew or Wanderlust. diff --git a/README.jp b/README.jp index 83f19f40b..dcd9861c9 100644 --- a/README.jp +++ b/README.jp @@ -1,6 +1,6 @@ Sylpheed - GTK+ ¥Ù¡¼¥¹¤Î·ÚÎ̤ǹ⮤ÊÅŻҥ᡼¥ë¥¯¥é¥¤¥¢¥ó¥È - 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 @@ -42,10 +42,10 @@ What's Sylpheed Sylpheed¤ÏGTK+¤ò»ÈÍѤ·¤¿¡¢X Window System¾å¤ÇÆ°ºî¤¹¤ë - * ·Ú²÷¤ÊÆ°ºî - * Èþ¤·¤¯¡¢ÀöÎý¤µ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹ - * ÍưפÊÀßÄꡦľ´ÑŪ¤ÊÁàºî - * Ë­É٤ʵ¡Ç½ + * ·Ú²÷¤ÊÆ°ºî + * Èþ¤·¤¯¡¢ÀöÎý¤µ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹ + * ÍưפÊÀßÄꡦľ´ÑŪ¤ÊÁàºî + * Ë­É٤ʵ¡Ç½ ¤òÌܻؤ·¤¿ÅŻҥ᡼¥ë¥¯¥é¥¤¥¢¥ó¥È(& ¥Ë¥å¡¼¥¹¥ê¡¼¥À¡¼)¤Ç¤¹¡£ @@ -64,6 +64,7 @@ Sylpheed o ¥­¡¼¥Ü¡¼¥É¤Î¤ß¤Ë¤è¤ëÁàºî¤¬²Äǽ o Mew/Wanderlust ¥é¥¤¥¯¤Ê¥­¡¼¥Ð¥¤¥ó¥É (Ä̾ï»È¤ï¤ì¤ë¥­¡¼¤ÎÂçÉôʬ¤Ï ¼ÂÁõºÑ) + o IMAP4rev1 Âбþ o ¥Þ¥ë¥Á¥Ñ¡¼¥È MIME o ²èÁüɽ¼¨µ¡Ç½¤òÆ⢠o X-Face Âбþ @@ -81,14 +82,13 @@ Sylpheed o IPv6 Âбþ o GnuPG Âбþ (¸½ºß¼ÂÁõÃæ) o ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÂбþ (¼Â¸³Åª) - o mbox ¥Õ¥¡¥¤¥ë¤Î¥¤¥ó¥Ý¡¼¥È + o mbox ¥Õ¥¡¥¤¥ë¤Î¥¤¥ó¥Ý¡¼¥È / ¥¨¥¯¥¹¥Ý¡¼¥È o ¥É¥é¥Ã¥° & ¥É¥í¥Ã¥× (°ìÉô¼ÂÁõ) o ¹â®¤Ê¥¹¥ì¥Ã¥Éɽ¼¨ o ¹â®¤Ê¥á¥Ã¥»¡¼¥¸½èÍý o Äã¾ÃÈñ¥ê¥½¡¼¥¹ o Íưפ˥«¥¹¥¿¥Þ¥¤¥º¤Ç¤­¤ëÀßÄê o automake + autoconf ¤È gettext ¤Ë¤è¤ë¥á¥Ã¥»¡¼¥¸¤Î¹ñºÝ²½¤ËÂбþ - o IMAP4 Âбþ (¸½ºß¼ÂÁõÃæ) Windows ¾å¤Î¥á¡¼¥é¡¢¤¢¤ë¤¤¤Ï Mew ¤ä Wanderlust ¤ò»ÈÍѤ·¤¿¤³¤È¤Î¤¢¤ë¿Í¤Ê¤é ¤¹¤°¤Ë»È¤¤Êý¤Ïʬ¤«¤ë¤È»×¤¤¤Þ¤¹¡£ diff --git a/TODO b/TODO index 0c5226ac5..b3790c572 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ TODO (The upper item has the greater priority or feasibility... maybe :-) o POP before SMTP -o list view of newsgroups and subscription of groups from there o full-text search of messages (plain, or hooking up with Namazu) o original icons and logos o template function @@ -15,7 +14,6 @@ o parallel processing between sending-receiving and others o support for some formats other than MH and mbox (ex. Maildir) o priority (Priority:, X-Priority:, X-MSMail-Priority:) o notification of reception (Disposition-Notification-To:) -o modification of display color o customization of key bindings o customization of toolbar o virtual folder @@ -41,6 +39,7 @@ Partially implemented features . PGP/GPG support . display of HTML messages (composition of HTML message is not scheduled :-P) . progress display of time-consuming processes +. modification of display color Implemented features ==================== @@ -64,3 +63,4 @@ Implemented features * periodical check of newly arrived mails * designate the displayed headers * user-defined headers +* list view of newsgroups and subscription of groups from there diff --git a/TODO.jp b/TODO.jp index 61abf0332..c2d8adc1e 100644 --- a/TODO.jp +++ b/TODO.jp @@ -4,18 +4,16 @@ TODO (¾å¤Î¤â¤Î¤Û¤É½ÅÍ×ÅÙ¡¢¼Â¸½²ÄǽÀ­¤¬¹â¤¯¤Ê¤ë¡¢¤«¤â(^^;) o POP before SMTP -o ¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤Î¥ê¥¹¥Èɽ¼¨¤È¤½¤³¤«¤é¤Î¹ØÆÉ¥°¥ë¡¼¥×Äɲà o ¥á¥Ã¥»¡¼¥¸¤ÎÁ´Ê¸¸¡º÷ (¥Ù¥¿¡¢ Namazu ¤È¤ÎÏ¢·È) o ¥ª¥ê¥¸¥Ê¥ë¤Î¥¢¥¤¥³¥ó¤È¥í¥´ o ¥Æ¥ó¥×¥ì¡¼¥Èµ¡Ç½ -o ¿¶¤êʬ¤±½èÍý¤Î¹â®²½ +o ¿¶¤êʬ¤±½èÍý¤Î¶¯²½ o ¿¶¤êʬ¤±¤ÇÀµµ¬É½¸½¤ËÂбþ¤¹¤ë o LDAPÂбþ o Á÷¼õ¿®¤È¤½¤ì°Ê³°¤È¤ÎʹԽèÍý o MH, mbox °Ê³°¤Î·Á¼°¤Ø¤ÎÂбþ(Maildir Åù) o ½ÅÍ×ÅÙ (Priority:, X-Priority:, X-MSMail-Priority:) o ¼õ¿®³Îǧ (Disposition-Notification-To:) -o ɽ¼¨¿§¤ÎÊѹ¹ o ¥­¡¼¥Ð¥¤¥ó¥É¤Î¥«¥¹¥¿¥Þ¥¤¥º o ¥Ä¡¼¥ë¥Ð¡¼¤Î¥«¥¹¥¿¥Þ¥¤¥º o ²¾ÁÛ¥Õ¥©¥ë¥À @@ -41,6 +39,7 @@ o . PGP/GPGÂбþ . HTML¥á¡¼¥ë¤Îɽ¼¨ (HTML¥á¡¼¥ë¤ÎºîÀ®¤ÏͽÄê¤Ê¤·:-P) . »þ´Ö¤¬³Ý¤«¤ë½èÍý¤Î¿ÊĽ¾õ¶·É½¼¨ +. ɽ¼¨¿§¤ÎÊѹ¹ ¼ÂÁõºÑ¤Îµ¡Ç½ ============ @@ -65,3 +64,4 @@ o * ¿·Ãå¥á¡¼¥ë¤ÎÄê´üŪ¥Á¥§¥Ã¥¯ * ɽ¼¨¤µ¤ì¤ë¥Ø¥Ã¥À¤Î»ØÄê * ¥æ¡¼¥¶ÄêµÁ¤Î¥Ø¥Ã¥À +* ¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤Î¥ê¥¹¥Èɽ¼¨¤È¤½¤³¤«¤é¤Î¹ØÆÉ¥°¥ë¡¼¥×Äɲà diff --git a/configure.in b/configure.in index 608cb1b77..276fc595c 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=5 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws1 +EXTRA_VERSION=claws2 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl diff --git a/src/Makefile.am b/src/Makefile.am index cee52c1d1..198cbf175 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,9 +28,10 @@ sylpheed_SOURCES = \ prefs_display_header.c prefs_display_header.h \ prefs_customheader.c prefs_customheader.h \ account.c account.h \ - displayheader.c displayheader.h \ + displayheader.c displayheader.h \ customheader.c customheader.h \ addressbook.c addressbook.h \ + addr_compl.c addr_compl.h \ filesel.c filesel.h \ foldersel.c foldersel.h \ statusbar.c statusbar.h \ @@ -41,6 +42,7 @@ sylpheed_SOURCES = \ alertpanel.c alertpanel.h \ inputdialog.c inputdialog.h \ progressdialog.c progressdialog.h \ + grouplistdialog.c grouplistdialog.h \ about.c about.h \ setup.c setup.h \ utils.c utils.h \ @@ -76,9 +78,7 @@ sylpheed_SOURCES = \ sigstatus.c sigstatus.h \ simple-gettext.c \ manual.c manual.h \ - addr_compl.c addr_compl.h \ gtkstext.c gtkstext.h \ - grouplist_dialog.c grouplist_dialog.h \ scoring.c scoring.h \ prefs_folder_item.c prefs_folder_item.h \ matcher.c matcher.h \ diff --git a/src/account.c b/src/account.c index 1c74f3103..46a81f618 100644 --- a/src/account.c +++ b/src/account.c @@ -275,8 +275,6 @@ void account_add(void) if (ac_prefs->protocol == A_IMAP4) { folder = folder_new(F_IMAP, ac_prefs->account_name, ac_prefs->recv_server); - folder_item_append(FOLDER_ITEM(folder->node->data), - folder_item_new("INBOX", "INBOX")); } else { folder = folder_new(F_NEWS, ac_prefs->account_name, ac_prefs->nntp_server); @@ -285,10 +283,9 @@ void account_add(void) folder->account = ac_prefs; ac_prefs->folder = REMOTE_FOLDER(folder); folder_add(folder); - if (ac_prefs->protocol == A_IMAP4) { + if (ac_prefs->protocol == A_IMAP4) folder->create_tree(folder); - folderview_set_all(); - } + folderview_set_all(); } } @@ -334,9 +331,6 @@ void account_set_missing_folder(void) if (ap->protocol == A_IMAP4) { folder = folder_new(F_IMAP, ap->account_name, ap->recv_server); - folder_item_append - (FOLDER_ITEM(folder->node->data), - folder_item_new("INBOX", "INBOX")); } else { folder = folder_new(F_NEWS, ap->account_name, ap->nntp_server); diff --git a/src/defs.h b/src/defs.h index 40b607e70..a25360424 100644 --- a/src/defs.h +++ b/src/defs.h @@ -40,7 +40,6 @@ #define TRASH_DIR "trash" #define RC_DIR ".sylpheed" #define NEWS_CACHE_DIR "newscache" -#define GROUPLIST_FILE "grouplist" #define IMAP_CACHE_DIR "imapcache" #define MBOX_CACHE_DIR "mboxcache" #define MIME_TMP_DIR "mimetmp" @@ -53,6 +52,7 @@ #define SCORING_RC "scoringrc" #define FILTERING_RC "filteringrc" #define MENU_RC "menurc" +#define NEWSGROUP_LIST ".newsgroup_list" #define ADDRESS_BOOK "addressbook.xml" #define MANUAL_HTML_INDEX "sylpheed.html" #define HOMEPAGE_URI "http://sylpheed.good-day.net/" @@ -90,6 +90,7 @@ #define CTREE_INDENT 18 #define FOLDER_SPACING 4 #define COLOR_DIM 35000 +#define UI_REFRESH_INTERVAL 50000 #define NORMAL_FONT prefs_common.normalfont #define BOLD_FONT prefs_common.boldfont diff --git a/src/folder.c b/src/folder.c index 1391dd12e..8f070672b 100644 --- a/src/folder.c +++ b/src/folder.c @@ -1228,7 +1228,7 @@ static void folder_write_list_recursive(GNode *node, gpointer data) if (folder->account) fprintf(fp, " account_id=\"%d\"", folder->account->account_id); - if (item->collapsed) + if (item->collapsed && node->children) fputs(" collapsed=\"1\"", fp); } else { fprintf(fp, "no_select) fputs(" no_select=\"1\"", fp); - if (item->collapsed) + if (item->collapsed && node->children) fputs(" collapsed=\"1\"", fp); fprintf(fp, " mtime=\"%ld\" new=\"%d\" unread=\"%d\" total=\"%d\"", diff --git a/src/folderview.c b/src/folderview.c index d5d2826c5..4b781a72a 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -43,6 +43,7 @@ #include "folderview.h" #include "summaryview.h" #include "inputdialog.h" +#include "grouplistdialog.h" #include "manage_window.h" #include "alertpanel.h" #include "menu.h" @@ -53,7 +54,6 @@ #include "prefs_account.h" #include "account.h" #include "folder.h" -#include "grouplist_dialog.h" #include "pixmaps/inbox.xpm" #include "pixmaps/outbox.xpm" @@ -1927,7 +1927,7 @@ static void folderview_new_news_group_cb(FolderView *folderview, guint action, g_return_if_fail(item->folder->type == F_NEWS); g_return_if_fail(item->folder->account != NULL); - new_group = grouplist_dialog(item); + new_group = grouplist_dialog(item->folder); if (!new_group) return; if (GTK_CTREE_ROW(folderview->selected)->parent != NULL) diff --git a/src/grouplist_dialog.c b/src/grouplistdialog.c similarity index 53% rename from src/grouplist_dialog.c rename to src/grouplistdialog.c index 32931c069..4e8ac5aec 100644 --- a/src/grouplist_dialog.c +++ b/src/grouplistdialog.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 @@ -21,6 +21,8 @@ # include "config.h" #endif +#include "defs.h" + #include #include #include @@ -31,49 +33,62 @@ #include #include #include +#include #include #include #include #include #include "intl.h" -#include "grouplist_dialog.h" +#include "grouplistdialog.h" #include "manage_window.h" #include "gtkutils.h" #include "utils.h" #include "news.h" #include "folder.h" #include "alertpanel.h" +#include "recv.h" +#include "socket.h" #define GROUPLIST_DIALOG_WIDTH 420 #define GROUPLIST_DIALOG_HEIGHT 400 static gboolean ack; +static gboolean locked; static GtkWidget *dialog; -static GtkWidget *msg_label; -static GtkWidget *group_clist; +static GtkWidget *entry; +static GtkWidget *clist; +static GtkWidget *status_label; static GtkWidget *ok_button; -static gchar * group_selected; -static GSList * group_list; -static FolderItem * item; +static GSList *group_list; +static Folder *news_folder; static void grouplist_dialog_create (void); -static void grouplist_dialog_set (void); -static void grouplist_free (void); +static void grouplist_dialog_set_list (void); +static void grouplist_clear (void); +static void grouplist_recv_func (SockInfo *sock, + gint count, + gint read_bytes, + gpointer data); static void ok_clicked (GtkWidget *widget, gpointer data); static void cancel_clicked (GtkWidget *widget, gpointer data); -static void refresh_clicked(GtkWidget *widget, gpointer data); +static void refresh_clicked (GtkWidget *widget, + gpointer data); static void key_pressed (GtkWidget *widget, GdkEventKey *event, gpointer data); -static void group_clist_select(GtkCList *clist, gint row, gint column, - GdkEventButton *event, gpointer user_data); - -gchar *grouplist_dialog(FolderItem * i) +static void clist_selected (GtkCList *clist, + gint row, + gint column, + GdkEventButton *event, + gpointer user_data); +static void entry_activated (GtkEditable *editable); + +gchar *grouplist_dialog(Folder *folder) { gchar *str; @@ -82,12 +97,14 @@ gchar *grouplist_dialog(FolderItem * i) if (!dialog) grouplist_dialog_create(); - item = i; + news_folder = folder; - grouplist_dialog_set(); gtk_widget_show(dialog); gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); manage_window_set_transient(GTK_WINDOW(dialog)); + GTK_EVENTS_FLUSH(); + + grouplist_dialog_set_list(); gtk_main(); @@ -95,30 +112,26 @@ gchar *grouplist_dialog(FolderItem * i) gtk_widget_hide(dialog); if (ack) { - if (group_selected != NULL) - str = g_strdup(group_selected); - else - str = NULL; - if (str && *str == '\0') + str = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); + if (str && *str == '\0') { + g_free(str); str = NULL; + } } else str = NULL; - grouplist_free(); - + grouplist_clear(); GTK_EVENTS_FLUSH(); debug_print("return string = %s\n", str ? str : "(none)"); return str; } -static void grouplist_free(void) +static void grouplist_clear(void) { - GSList * group_elt; - - for(group_elt = group_list ; group_elt != NULL ; - group_elt = group_elt->next) - g_free(group_elt->data); + gtk_clist_clear(GTK_CLIST(clist)); + gtk_entry_set_text(GTK_ENTRY(entry), ""); + slist_free_strings(group_list); g_slist_free(group_list); } @@ -126,17 +139,20 @@ static void grouplist_dialog_create(void) { GtkWidget *vbox; GtkWidget *hbox; + GtkWidget *msg_label; GtkWidget *confirm_area; GtkWidget *cancel_button; GtkWidget *refresh_button; GtkWidget *scrolledwin; dialog = gtk_dialog_new(); - gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, FALSE); - gtk_widget_set_usize(dialog, GROUPLIST_DIALOG_WIDTH, GROUPLIST_DIALOG_HEIGHT); + gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE); + gtk_widget_set_usize(dialog, + GROUPLIST_DIALOG_WIDTH, GROUPLIST_DIALOG_HEIGHT); gtk_container_set_border_width (GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 5); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); + gtk_window_set_title(GTK_WINDOW(dialog), _("Subscribe to newsgroup")); gtk_signal_connect(GTK_OBJECT(dialog), "delete_event", GTK_SIGNAL_FUNC(cancel_clicked), NULL); gtk_signal_connect(GTK_OBJECT(dialog), "key_press_event", @@ -155,31 +171,38 @@ static void grouplist_dialog_create(void) hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); - msg_label = gtk_label_new(""); + msg_label = gtk_label_new(_("Input subscribing newsgroup:")); gtk_box_pack_start(GTK_BOX(hbox), msg_label, FALSE, FALSE, 0); - gtk_label_set_justify(GTK_LABEL(msg_label), GTK_JUSTIFY_LEFT); - - - scrolledwin = gtk_scrolled_window_new (NULL, NULL); - gtk_box_pack_start (GTK_BOX (vbox), scrolledwin, - TRUE, TRUE, 0); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwin), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - - group_clist = gtk_clist_new(1); - gtk_container_add (GTK_CONTAINER (scrolledwin), group_clist); - gtk_clist_set_column_width (GTK_CLIST (group_clist), 0, 80); - gtk_clist_set_selection_mode (GTK_CLIST (group_clist), - GTK_SELECTION_BROWSE); - GTK_WIDGET_UNSET_FLAGS (GTK_CLIST (group_clist)->column[0].button, - GTK_CAN_FOCUS); - gtk_signal_connect (GTK_OBJECT (group_clist), "select_row", - GTK_SIGNAL_FUNC (group_clist_select), NULL); + + entry = gtk_entry_new(); + gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0); + gtk_signal_connect(GTK_OBJECT(entry), "activate", + GTK_SIGNAL_FUNC(entry_activated), NULL); + + scrolledwin = gtk_scrolled_window_new(NULL, NULL); + gtk_box_pack_start(GTK_BOX (vbox), scrolledwin, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolledwin), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + clist = gtk_clist_new(1); + gtk_container_add(GTK_CONTAINER(scrolledwin), clist); + gtk_clist_set_column_width(GTK_CLIST(clist), 0, 80); + gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_BROWSE); + GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(clist)->column[0].button, + GTK_CAN_FOCUS); + gtk_signal_connect(GTK_OBJECT(clist), "select_row", + GTK_SIGNAL_FUNC(clist_selected), NULL); + + hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + + status_label = gtk_label_new(""); + gtk_box_pack_start(GTK_BOX(hbox), status_label, FALSE, FALSE, 0); gtkut_button_set_create(&confirm_area, - &ok_button, _("OK"), - &cancel_button, _("Cancel"), + &ok_button, _("OK"), + &cancel_button, _("Cancel"), &refresh_button, _("Refresh")); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), confirm_area); @@ -192,76 +215,93 @@ static void grouplist_dialog_create(void) gtk_signal_connect(GTK_OBJECT(refresh_button), "clicked", GTK_SIGNAL_FUNC(refresh_clicked), NULL); - gtk_widget_show_all(GTK_DIALOG(dialog)->vbox); } static void grouplist_dialog_set_list(void) { - GSList * elt; + GSList *cur; gint row; - group_selected = NULL; - group_list = news_get_group_list(item); + if (locked) return; + locked = TRUE; + + recv_set_ui_func(grouplist_recv_func, NULL); + group_list = news_get_group_list(news_folder); + recv_set_ui_func(NULL, NULL); if (group_list == NULL) { - alertpanel_error(_("Can't retrieve group list.")); + alertpanel_error(_("Can't retrieve newsgroup list.")); + locked = FALSE; return; } - gtk_clist_clear(GTK_CLIST(group_clist)); - for(elt = group_list; elt != NULL ; elt = elt->next) - { - row = gtk_clist_append(GTK_CLIST(group_clist), - (void *) &(elt->data)); - gtk_clist_set_row_data(GTK_CLIST(group_clist), row, elt->data); - } + gtk_clist_freeze(GTK_CLIST(clist)); + for (cur = group_list; cur != NULL ; cur = cur->next) { + row = gtk_clist_append(GTK_CLIST(clist), + (gchar **)&(cur->data)); + gtk_clist_set_row_data(GTK_CLIST(clist), row, cur->data); + } + gtk_clist_thaw(GTK_CLIST(clist)); gtk_widget_grab_focus(ok_button); - gtk_widget_grab_focus(group_clist); + gtk_widget_grab_focus(clist); - if (group_list != NULL) - group_selected = group_list->data; - else - group_selected = NULL; + gtk_label_set_text(GTK_LABEL(status_label), _("Done.")); + + locked = FALSE; } -static void grouplist_dialog_set(void) +static void grouplist_recv_func(SockInfo *sock, gint count, gint read_bytes, + gpointer data) { - gtk_window_set_title(GTK_WINDOW(dialog), _("Subscribe newsgroup")); - gtk_label_set_text(GTK_LABEL(msg_label), _("Input subscribing newsgroup:")); - grouplist_dialog_set_list(); + gchar buf[BUFFSIZE]; + + g_snprintf(buf, sizeof(buf), + _("%d newsgroups received (%d bytes read)"), + count, read_bytes); + gtk_label_set_text(GTK_LABEL(status_label), buf); + GTK_EVENTS_FLUSH(); } static void ok_clicked(GtkWidget *widget, gpointer data) { ack = TRUE; - gtk_main_quit(); + if (gtk_main_level() > 1) + gtk_main_quit(); } static void cancel_clicked(GtkWidget *widget, gpointer data) { ack = FALSE; - gtk_main_quit(); + if (gtk_main_level() > 1) + gtk_main_quit(); } static void refresh_clicked(GtkWidget *widget, gpointer data) { - grouplist_free(); - news_reset_group_list(item); + if (locked) return; + + grouplist_clear(); + news_remove_group_list(news_folder); grouplist_dialog_set_list(); } static void key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data) { - if (event && event->keyval == GDK_Escape) { - ack = FALSE; - gtk_main_quit(); - } + if (event && event->keyval == GDK_Escape) + cancel_clicked(NULL, NULL); +} + +static void clist_selected(GtkCList *clist, gint row, gint column, + GdkEventButton *event, gpointer user_data) +{ + gchar *group; + + group = (gchar *)gtk_clist_get_row_data(GTK_CLIST(clist), row); + gtk_entry_set_text(GTK_ENTRY(entry), group ? group : ""); } -static void group_clist_select(GtkCList *clist, gint row, gint column, - GdkEventButton *event, gpointer user_data) +static void entry_activated(GtkEditable *editable) { - group_selected = (gchar *) - gtk_clist_get_row_data(GTK_CLIST(group_clist), row); + ok_clicked(NULL, NULL); } diff --git a/src/grouplist_dialog.h b/src/grouplistdialog.h similarity index 90% rename from src/grouplist_dialog.h rename to src/grouplistdialog.h index 75ad71b15..6cd0bcb7c 100644 --- a/src/grouplist_dialog.h +++ b/src/grouplistdialog.h @@ -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 @@ -21,8 +21,9 @@ #define __GROUPLISTDIALOG_H__ #include + #include "folder.h" -gchar *grouplist_dialog (FolderItem * item); +gchar *grouplist_dialog (Folder *folder); #endif /* __GROUPLISTDIALOG_H__ */ diff --git a/src/inc.c b/src/inc.c index 24edcdc85..85791abe0 100644 --- a/src/inc.c +++ b/src/inc.c @@ -99,6 +99,7 @@ static gint connection_check_cb (Automaton *atm); #endif static void inc_pop3_recv_func (SockInfo *sock, + gint count, gint read_bytes, gpointer data); @@ -664,7 +665,6 @@ static IncState inc_pop3_session_do(IncSession *session) SSL_free(sockinfo->ssl); } #endif - automaton_destroy(atm); return pop3_state->inc_state; @@ -788,7 +788,8 @@ static gint connection_check_cb(Automaton *atm) } #endif -static void inc_pop3_recv_func(SockInfo *sock, gint read_bytes, gpointer data) +static void inc_pop3_recv_func(SockInfo *sock, gint count, gint read_bytes, + gpointer data) { gchar buf[MSGBUFSIZE]; IncSession *session = (IncSession *)data; diff --git a/src/news.c b/src/news.c index e2a69052e..973909a7f 100644 --- a/src/news.c +++ b/src/news.c @@ -172,6 +172,7 @@ NNTPSession *news_session_get(Folder *folder) if (!REMOTE_FOLDER(folder)->session) { REMOTE_FOLDER(folder)->session = news_session_new_for_folder(folder); + statusbar_pop_all(); return NNTP_SESSION(REMOTE_FOLDER(folder)->session); } @@ -188,6 +189,7 @@ NNTPSession *news_session_get(Folder *folder) news_session_new_for_folder(folder); } + statusbar_pop_all(); return NNTP_SESSION(REMOTE_FOLDER(folder)->session); } @@ -239,6 +241,7 @@ GSList *news_get_article_list(Folder *folder, FolderItem *item, gchar *news_fetch_msg(Folder *folder, FolderItem *item, gint num) { gchar *path, *filename; + NNTPSession *session; gint ok; g_return_val_if_fail(folder != NULL, NULL); @@ -256,13 +259,14 @@ gchar *news_fetch_msg(Folder *folder, FolderItem *item, gint num) return filename; } - if (!REMOTE_FOLDER(folder)->session) { + session = news_session_get(folder); + if (!session) { g_free(filename); return NULL; } - ok = news_select_group(NNTP_SESSION(REMOTE_FOLDER(folder)->session), - item->path); + ok = news_select_group(session, item->path); + statusbar_pop_all(); if (ok != NN_SUCCESS) { g_warning(_("can't select group %s\n"), item->path); g_free(filename); @@ -286,6 +290,89 @@ void news_scan_group(Folder *folder, FolderItem *item) { } +GSList *news_get_group_list(Folder *folder) +{ + gchar *path, *filename; + FILE *fp; + GSList *list = NULL; + GSList *last = NULL; + gchar buf[NNTPBUFSIZE]; + + g_return_val_if_fail(folder != NULL, NULL); + g_return_val_if_fail(folder->type == F_NEWS, NULL); + + path = folder_item_get_path(FOLDER_ITEM(folder->node->data)); + filename = g_strconcat(path, G_DIR_SEPARATOR_S, NEWSGROUP_LIST, NULL); + g_free(path); + + if ((fp = fopen(filename, "r")) == NULL) { + NNTPSession *session; + + session = news_session_get(folder); + if (!session) { + g_free(filename); + return NULL; + } + + if (nntp_list(session->nntp_sock) != NN_SUCCESS) { + g_free(filename); + statusbar_pop_all(); + return NULL; + } + statusbar_pop_all(); + if (recv_write_to_file(SESSION(session)->sock, filename) < 0) { + log_warning(_("can't retrieve newsgroup list\n")); + g_free(filename); + return NULL; + } + + if ((fp = fopen(filename, "r")) == NULL) { + FILE_OP_ERROR(filename, "fopen"); + g_free(filename); + return NULL; + } + } + + while (fgets(buf, sizeof(buf), fp) != NULL) { + gchar *p = buf; + while (*p != '\0' && *p != ' ') p++; + *p = '\0'; + if (!last) + last = list = g_slist_append(NULL, g_strdup(buf)); + else { + last = g_slist_append(last, g_strdup(buf)); + last = last->next; + } + } + + fclose(fp); + g_free(filename); + + list = g_slist_sort(list, (GCompareFunc)g_strcasecmp); + + statusbar_pop_all(); + + return list; +} + +void news_remove_group_list(Folder *folder) +{ + gchar *path, *filename; + + g_return_if_fail(folder != NULL); + g_return_if_fail(folder->type == F_NEWS); + + path = folder_item_get_path(FOLDER_ITEM(folder->node->data)); + filename = g_strconcat(path, G_DIR_SEPARATOR_S, NEWSGROUP_LIST, NULL); + g_free(path); + + if (is_file_exist(filename)) { + if (remove(filename) < 0) + FILE_OP_ERROR(filename, "remove"); + } + g_free(filename); +} + gint news_post(Folder *folder, const gchar *file) { NNTPSession *session; @@ -586,7 +673,6 @@ static MsgInfo *news_parse_xover(const gchar *xover_str) static gchar *news_parse_xhdr(const gchar *xhdr_str, MsgInfo *msginfo) { - gchar buf[NNTPBUFSIZE]; gchar *p; gchar *tmp; gint num; @@ -661,92 +747,3 @@ static void news_delete_all_articles(FolderItem *item) debug_print(_("done.\n")); } - -/* - news_get_group_list returns a strings list. - These strings are the names of the newsgroups of a server. - item is the FolderItem of the news server. - The names of the newsgroups are cached into a file so that - when the function is called again, there is no need to make - a request to the server. - */ - -GSList * news_get_group_list(FolderItem *item) -{ - gchar *path, *filename; - gint ok; - NNTPSession *session; - GSList * group_list = NULL; - FILE * f; - gchar buf[NNTPBUFSIZE]; - int len; - - if (item == NULL) - return NULL; - - path = folder_item_get_path(item); - - if (!is_dir_exist(path)) - make_dir_hier(path); - - filename = g_strconcat(path, G_DIR_SEPARATOR_S, GROUPLIST_FILE, NULL); - g_free(path); - - session = news_session_get(item->folder); - - if (session == NULL) - return NULL; - - if (is_file_exist(filename)) { - debug_print(_("group list has been already cached.\n")); - } - else { - ok = nntp_list(session->nntp_sock); - if (ok != NN_SUCCESS) - return NULL; - - if (recv_write_to_file(SESSION(session)->sock, filename) < 0) { - log_warning(_("can't retrieve group list\n")); - return NULL; - } - } - - f = fopen(filename, "r"); - while (fgets(buf, NNTPBUFSIZE, f)) { - char * s; - - len = 0; - while ((buf[len] != 0) && (buf[len] != ' ')) - len++; - buf[len] = 0; - s = g_strdup(buf); - - group_list = g_slist_append(group_list, s); - } - fclose(f); - g_free(filename); - - group_list = g_slist_sort(group_list, (GCompareFunc) g_strcasecmp); - - return group_list; -} - -/* - remove the cache file of the names of the newsgroups. - */ - -void news_reset_group_list(FolderItem *item) -{ - gchar *path, *filename; - - debug_print(_("\tDeleting cached group list... ")); - path = folder_item_get_path(item); - if (!is_dir_exist(path)) - make_dir_hier(path); - - filename = g_strconcat(path, G_DIR_SEPARATOR_S, GROUPLIST_FILE, NULL); - g_free(path); - if (remove(filename) != 0) - log_warning(_("can't delete cached group list %s\n"), filename); - g_free(filename); -} diff --git a/src/news.h b/src/news.h index 8bd2b6dc4..4dfe84574 100644 --- a/src/news.h +++ b/src/news.h @@ -52,10 +52,10 @@ gchar *news_fetch_msg (Folder *folder, void news_scan_group (Folder *folder, FolderItem *item); +GSList *news_get_group_list (Folder *folder); +void news_remove_group_list (Folder *folder); + gint news_post (Folder *folder, const gchar *file); -GSList * news_get_group_list(FolderItem *item); -void news_reset_group_list(); - #endif /* __NEWS_H__ */ diff --git a/src/recv.c b/src/recv.c index 4ed3e0cf5..eac580421 100644 --- a/src/recv.c +++ b/src/recv.c @@ -21,6 +21,8 @@ # include "config.h" #endif +#include "defs.h" + #include #include #include @@ -32,8 +34,6 @@ #include "socket.h" #include "utils.h" -#define BUFFSIZE 8192 - static RecvUIFunc recv_ui_func; static gpointer recv_ui_func_data; @@ -101,6 +101,7 @@ gint recv_write(SockInfo *sock, FILE *fp) { gchar buf[BUFFSIZE]; gint len; + gint count = 0; gint bytes = 0; struct timeval tv_prev, tv_cur; @@ -115,9 +116,11 @@ gint recv_write(SockInfo *sock, FILE *fp) len = strlen(buf); if (len > 1 && buf[0] == '.' && buf[1] == '\r') { if (recv_ui_func) - recv_ui_func(sock, bytes, recv_ui_func_data); + recv_ui_func(sock, count, bytes, + recv_ui_func_data); break; } + count++; bytes += len; if (recv_ui_func) { @@ -125,8 +128,9 @@ gint recv_write(SockInfo *sock, FILE *fp) /* if elapsed time from previous update is greater than 10msec, update UI */ if (tv_cur.tv_sec - tv_prev.tv_sec > 0 || - tv_cur.tv_usec - tv_prev.tv_usec > 10000) { - recv_ui_func(sock, bytes, recv_ui_func_data); + tv_cur.tv_usec - tv_prev.tv_usec > UI_REFRESH_INTERVAL) { + recv_ui_func(sock, count, bytes, + recv_ui_func_data); gettimeofday(&tv_prev, NULL); } } diff --git a/src/recv.h b/src/recv.h index dd59ea57d..bc1dd89dd 100644 --- a/src/recv.h +++ b/src/recv.h @@ -25,6 +25,7 @@ #include "socket.h" typedef void (*RecvUIFunc) (SockInfo *sock, + gint count, gint read_bytes, gpointer data); diff --git a/src/send.c b/src/send.c index 51e818f9b..ad182fda4 100644 --- a/src/send.c +++ b/src/send.c @@ -339,7 +339,7 @@ static gint send_message_smtp(GSList *to_list, const gchar *from, gettimeofday(&tv_cur, NULL); if (tv_cur.tv_sec - tv_prev.tv_sec > 0 || - tv_cur.tv_usec - tv_prev.tv_usec > 10000) { + tv_cur.tv_usec - tv_prev.tv_usec > UI_REFRESH_INTERVAL) { g_snprintf(str, sizeof(str), _("Sending message (%d / %d bytes)"), bytes, size); -- 2.25.1