sync with 0.9.11cvs17 HEAD
authorPaul Mangan <paul@claws-mail.org>
Fri, 25 Jun 2004 08:05:09 +0000 (08:05 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 25 Jun 2004 08:05:09 +0000 (08:05 +0000)
60 files changed:
AUTHORS
ChangeLog
ChangeLog-gtk2.claws
ChangeLog.claws
ChangeLog.jp
NEWS
configure.ac
po/POTFILES.in
src/Makefile.am
src/account.c
src/action.c
src/action.h
src/addressbook.c
src/addrindex.h
src/common/Makefile.am
src/common/defs.h
src/common/session.c
src/common/session.h
src/common/ssl.c
src/common/version.h.in
src/compose.c
src/compose.h
src/folder.c
src/folder.h
src/folder_item_prefs.c
src/gtk/Makefile.am
src/gtk/menu.c
src/gtk/menu.h
src/headerview.c
src/imap.c
src/imap_gtk.c
src/inc.c
src/inc.h
src/main.c
src/mainwindow.c
src/messageview.c
src/mh_gtk.c
src/mimeview.c
src/msgcache.c
src/news.c
src/noticeview.c
src/plugins/image_viewer/viewer.c
src/plugins/spamassassin/spamassassin.c
src/plugins/trayicon/trayicon.c
src/pop.c
src/pop.h
src/prefs_common.c
src/prefs_themes.c
src/procheader.c
src/procmime.c
src/procmsg.h
src/quote_fmt.h
src/send_message.c
src/stock_pixmap.c
src/stock_pixmap.h
src/summaryview.c
src/summaryview.h
src/textview.c
src/toolbar.c
tools/launch_firebird [deleted file]

diff --git a/AUTHORS b/AUTHORS
index 2893b1e..add183a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -18,6 +18,7 @@ claws-branch (http://sylpheed-claws.sourceforge.net)
        Leandro A. F. Pereira   <leandro@linuxmag.com.br>
        Luke Plant              <L.Plant.98@cantab.net>
        Martin Schaaf           <mascha@ma-scha.de>
+       Jesper Schultz          <jesper@schultz-net.dk>
        Carsten Schurig         <Carsten.Schurig@web.de>
        Sergey Vlasov           <vsu@users.sourceforge.net>
        Hiroyuki Yamamoto       <hiro-y@kcn.ne.jp>
@@ -44,8 +45,8 @@ sylpheed-claws translation team
        [ru]    Ruslan N. Balkin        <baron@voices.ru>
        [ru]    Pavlo Bohmat            <bohm@ukr.net>
        [sk]    Andrej Kacian           <andrej@kacian.sk>
-       [sr]    Urke MMI                <urke@gmx.net>
-       [zh_CN] Hansom Young            <hansom_young@yahoo.com>
+       [sr]    Urke MMI                <urke@users.sourceforge.net>
+       [zh_CN] Hansom Young            <hyoung@operamail.com>
        
 sylpheed documentation (http://sylpheeddoc.sourceforge.net)
 
@@ -203,3 +204,5 @@ contributors (beside the above; based on Changelog)
        Chad Robinson
        Edgar Toernig
        Fabien Vantard
+       Reza Pakdel
+       Stephan Sachse
index a34f438..f10a5a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,68 @@
+2004-06-23
+
+       * src/prefs_common.c: made the default of confirm_on_exit FALSE.
+
+2004-06-23
+
+       * src/menu.[ch]: added menu_set_active().
+       * src/compose.c: don't change 'View/Auto wrapping' mode when selecting
+         accounts.
+
+2004-06-23
+
+       * src/compose.[ch]: autowrap can be switchd on/off from the compose
+         window.
+
+2004-06-17
+
+       * version 0.9.12
+
+2004-06-17
+
+       * src/session.c: session_set_timeout(): fixed a bug that didn't
+         reset timeout_tag when interval is 0.
+
+2004-06-16
+
+       * src/gtkstext.c: gtk_stext_update_text(): added null checking for
+         cache (thanks to Jim Hranicky).
+
+2004-06-15
+
+       * src/defs.h: increased CACHE_VERSION to work around the
+         incompatibility of the cache on some platforms (ex. FreeBSD).
+       * src/procmsg.c: procmsg_read_cache(): discard all read cache data
+         if an error occurred.
+
+2004-06-10
+
+       * src/summaryview.[ch]: hide 'Re-edit' menu when it's unusable.
+
+2004-06-08
+
+       * src/inc.[ch]
+         src/send_message.c
+         src/session.[ch]: implemented session timeout.
+       * src/pop.h: removed unused values from Pop3ErrorValue.
+
+2004-06-07
+
+       * src/inc.c: inc_all_account_mail(): code cleanup.
+
+2004-06-03
+
+       * src/procmsg.c: procmsg_read_cache_data_str(): changed gint32 to
+         guint32 for some platforms.
+       * src/summaryview.c: restored 'Print' menu.
+
+2004-06-01
+
+       * src/about.c: modified copyright year.
+
+2004-05-28
+
+       * version 0.9.11
+
 2004-05-21
 
        * src/smtp.c: comply with RFC 2821 (thanks to Alfons).
index 774f94a..f08120f 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-25 [paul]      0.9.10cvs17
+
+       * sync with 0.9.10cvs17 HEAD
+       
+       NOTE: QuickSearch is broken
+
 2004-06-07 [colin]     0.9.10claws67.10
        * src/plugins/trayicon/trayicon.c
          src/plugins/trayicon/libeggtrayicon/Makefile.am
index 26de83f..7966bd5 100644 (file)
@@ -1,3 +1,208 @@
+2004-06-25 [paul]      0.9.11cvs17
+
+       * sync with main 0.9.12cvs1
+               see ChangeLog 2004-06-23
+               
+       * src/gtk/menu.c
+               remove unused menu_toggle_toggle()
+
+2004-06-23 [christoph] 0.9.11cvs16
+
+       * src/folder.c
+       * src/procheader.c
+       * src/procmsg.h
+       * src/summaryview.c
+               scan the mime structure of multipart mails for correct
+               attachment, encryped and signed (with privacy API) part
+               detection
+
+2004-06-22 [paul]
+
+       * po/ru.po
+               updated by Pavlo Bohmat
+
+2004-06-20 [christoph] 0.9.11cvs15
+
+       * src/inc.c
+       * src/pop.[ch]
+               disconnect after authentication when doing POP before SMTP
+
+       (Closes Bug 393 Bad inerpretation of "Pop Before SMTP")
+
+2004-06-19 [christoph] 0.9.11cvs14
+
+       * src/folder.c
+               fix FolderItem name update
+
+       (Closes Bug 511 Folder-Renaming not reflected immediately)
+
+2004-06-17 [paul]      0.9.11cvs13
+       
+       * sync with main 0.9.12 release
+         src/session.c
+               session_set_timeout(): fixed a bug that didn't
+               reset timeout_tag when interval is 0.
+
+2004-06-16 [christoph] 0.9.11cvs12
+
+       * src/textview.c
+               correctly clear the URL in the status bar
+
+2004-06-15 [christoph] 0.9.11cvs11
+
+       * src/summaryview.c
+               add missing gtk_widget_show()
+
+2004-06-11 [christoph] 0.9.11cvs10
+
+       * src/plugins/spamassassin/spamassassin.c
+               correctly check waitpid return code
+
+       (Closes Bug 396 Zombie process when spamassassin is called)
+
+2004-06-10 [christoph] 0.9.11cvs9
+
+       * src/mainwindow.c
+       * src/summaryview.[ch]
+       * src/gtk/Makefile.am
+       * src/gtk/quicksearch.c                         ** NEW **
+               separate quick search from summaryview
+
+2004-06-09 [christoph] 0.9.11cvs8
+
+       * src/inc.c
+               remove unused code
+
+       * src/textview.c
+               get folder for compose default account from MsgInfo and not
+               from SummaryView
+
+2004-06-09 [christoph] 0.9.11cvs7
+
+       * src/folder.[ch]
+               add information about added or removed messages to
+               FOLDER_ITEM_UPDATE hook
+
+       * src/imap_gtk.c
+       * src/mh_gtk.c
+               scan folder when removing a folder failed instead of
+               updating the summaryview
+
+2004-06-08 [paul]      0.9.11cvs6
+
+       * sync with main 0.9.11cvs2
+               see ChangeLog 2004-06-08
+
+2004-06-07 [christoph] 0.9.11cvs5
+
+       * configure.ac
+       * src/common/Makefile.am
+               detect library providing 'encrypt' function
+
+2004-06-07 [paul]      0.9.11cvs4
+
+       * src/inc.c
+               sync with main, 'code cleanup'
+               
+       * tools/nautilus2sylpheed.sh
+               fix whitespace limitation. patch submitted by
+               Stephan Sachse <white@teg-clan.de>
+
+2004-06-04 [christoph] 0.9.11cvs3
+
+       * src/account.c
+       * src/action.[ch]
+       * src/addressbook.c
+       * src/addrindex.h
+       * src/folder.h
+       * src/folder_item_prefs.c
+       * src/inc.c
+       * src/main.c
+       * src/messageview.c
+       * src/mh_gtk.c
+       * src/prefs_themes.c
+       * src/procmime.c
+       * src/quote_fmt.h
+       * src/stock_pixmap.c
+       * src/toolbar.c
+               fix compiler warnings
+
+2004-06-03 [paul]      0.9.11cvs2
+
+       * src/msgcache.c
+               sync with main 0.9.11cvs1: "changed gint32 to
+               guint32 for some platforms"
+
+2004-06-02 [christoph] 0.9.11cvs1
+
+       * src/common/ssl.c
+               fix SSL_CTX variable name for older OpenSSL versions
+
+       (Closes Bug 503 fix compilation with older OpenSSL)
+
+2004-05-31 [paul]      0.9.11claws
+
+       * 0.9.11claws released
+
+2004-05-31 [paul]      0.9.10claws72
+
+       * po/es.po
+         po/it.po
+         po/ja.po
+         po/pl.po
+         po/sk.po
+         po/sr.po
+         po/zh_CN.po
+               update translations, submitted by Ricardo Mones Lastra,
+               Andrea Spadaccini, Rui Hirokawa, Emil, Andrej Kacian,
+               Urke MMI, and Hansom Young
+
+2004-05-25 [luke]      0.9.10claws71
+
+       * AUTHORS
+       * src/mimeview.c
+       * src/stockpixmap.[ch]
+       * src/Makefile.am
+       * src/pixmaps/privacy_emblem_encrypted.xpm      ** NEW **
+       * src/pixmaps/privacy_emblem_failed.xpm         ** NEW **
+       * src/pixmaps/privacy_emblem_passed.xpm         ** NEW **
+       * src/pixmaps/privacy_emblem_signed.xpm         ** NEW **
+       * src/pixmaps/privacy_emblem_warn.xpm           ** NEW **
+
+               o Added privacy emblems from Jesper Shultz 
+                 <jesper@schultz-net.dk>
+               o Overlay emblems onto mimeview icons to indicate
+                 status of signature and if a message is encrypted
+       
+       * src/textview.c
+               remove unused color definitions (were used to 
+               indicate sig status)
+
+2004-05-25 [paul]      0.9.10claws70
+
+       * AUTHORS
+         tools/Makefile.am
+         tools/README
+         tools/nautilus2sylpheed.sh            ** NEW FILE **
+               add script to enable sending files from
+               nautilus.
+               Submitted by Reza Pakdel <hrpakdel@cpsc.ucalgary.ca>
+               
+       * tools/launch_firebird                 ** REMOVED **
+               removed as the standard "firefox '%s'" now functions
+               correctly
+
+2004-05-23 [paul]      0.9.10claws69
+
+       * src/compose.c
+               fix %X cursor point segfault
+               patch by Christoph
+
+2004-05-23 [christoph] 0.9.10claws68
+
+       * src/folder.c
+               fix folder moving
+
 2004-05-21 [paul]      0.9.10claws67
 
        * sync with 0.9.10cvs17
index 94cf727..c7c74a7 100644 (file)
@@ -1,3 +1,70 @@
+2004-06-23
+
+       * src/prefs_common.c: confirm_on_exit ¤Î¥Ç¥Õ¥©¥ë¥È¤ò FALSE ¤Ë¤·¤¿¡£
+
+2004-06-23
+
+       * src/menu.[ch]: menu_set_active() ¤òÄɲá£
+       * src/compose.c: ¥¢¥«¥¦¥ó¥È¤òÁªÂò¤¹¤ë¤È¤­¤Ë¡Öɽ¼¨/¼«Æ°À°·Á¡×¥â¡¼¥É¤ò
+         ÀÚ¤êÂؤ¨¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+
+2004-06-23
+
+       * src/compose.[ch]: ¥á¥Ã¥»¡¼¥¸ºîÀ®¥¦¥£¥ó¥É¥¦¤«¤é¼«Æ°À°·Á¤òÀÚ¤êÂؤ¨
+         ¤é¤ì¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2004-06-17
+
+       * version 0.9.12
+
+2004-06-17
+
+       * src/session.c: session_set_timeout(): interval ¤¬ 0 ¤Î¤È¤­
+         timeout_tag ¤ò¥ê¥»¥Ã¥È¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¥Ð¥°¤ò½¤Àµ¡£
+
+2004-06-16
+
+       * src/gtkstext.c: gtk_stext_update_text(): cache ¤Î null ¥Á¥§¥Ã¥¯¤ò
+         ÄɲÃ(Jim Hranicky ¤µ¤ó thanks)¡£
+
+2004-06-15
+
+       * src/defs.h: ÆÃÄê¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à(Îã: FreeBSD)¤Ë¤ª¤±¤ë¥­¥ã¥Ã¥·¥å
+         ¤ÎÈó¸ß´¹À­ÌäÂê¤ËÂн褹¤ë¤¿¤á¤Ë CACHE_VERSION ¤òÁý²Ã¡£
+       * src/procmsg.c: procmsg_read_cache(): ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤éÆɤ߹þ¤ó¤À
+         ¥­¥ã¥Ã¥·¥å¥Ç¡¼¥¿¤òÁ´¤ÆÇË´þ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2004-06-10
+
+       * src/summaryview.[ch]: »ÈÍÑÉÔ²Äǽ¤Ê¤È¤­¤Ï¡ÖºÆÊÔ½¸¡×¥á¥Ë¥å¡¼¤ò±£¤¹
+         ¤è¤¦¤Ë¤·¤¿¡£
+
+2004-06-08
+
+       * src/inc.[ch]
+         src/send_message.c
+         src/session.[ch]: ¥»¥Ã¥·¥ç¥ó¤Î¥¿¥¤¥à¥¢¥¦¥È¤ò¼ÂÁõ¡£
+       * src/pop.h: Pop3ErrorValue ¤«¤é̤»ÈÍѤÎÃͤòºï½ü¡£
+
+2004-06-07
+
+       * src/inc.c: inc_all_account_mail(): ¥³¡¼¥É¤ÎÀ°Íý¡£
+
+2004-06-03
+
+       * src/procmsg.c: procmsg_read_cache_data_str(): ¤¤¤¯¤Ä¤«¤Î´Ä¶­¤Î¤¿¤á
+         ¤Ë gint32 ¤ò guint32 ¤ËÊѹ¹¡£
+       * src/summaryview.c: ¡Ö°õºþ¡×¥á¥Ë¥å¡¼¤òÉü³è¤·¡¢¡Ö¿¶¤êʬ¤±¥ë¡¼¥ë¤ò
+         ºîÀ®¡×¥á¥Ë¥å¡¼¤òºï½ü¡£
+
+2004-06-01
+
+       * src/about.c: Ãøºî¸¢¤Îǯ¤ò½¤Àµ¡£
+
+2004-05-28
+
+       * version 0.9.11
+
 2004-05-21
 
        * src/smtp.c: RFC 2821 ¤Ë½àµò(Alfons ¤µ¤ó thanks)¡£
diff --git a/NEWS b/NEWS
index 16a8094..79c37f5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,38 @@
 Changes of Sylpheed
 
+* 0.9.12
+
+    * A session timeout for POP3/SMTP has been implemented.
+    * The 'Print' menu on the context menu has been restored.
+    * the value of CACHE_VERSION has been increased to prevent a cache
+      incompatibility problem on some platforms such as FreeBSD.
+
+* 0.9.11
+
+    * The spring-loaded folder has been implemented for the folder view.
+    * A function to filter selected messages has been added.
+    * Always move messages by default when using DnD (copy if Ctrl key is
+      pressed).
+    * On filtering, the matching algorithm of 'not contain' flag has
+      been fixed.
+    * NNTP servers that require authentication at the beginning of the
+      session has been supported.
+    * The method of updating the progress dialog has been modified.
+    * The context menu on the summary view has been cleaned up.
+    * The image viewer has been fixed.
+    * The cache handling has been fixed for AMD64 and other 64-bit platforms.
+    * The SMTP routine has been fixed to fully comply with RFC 2821.
+
+* 0.9.10
+
+    * A new folder can be created on the folder selection dialog now.
+    * The folder view is now updated progressively when receiving.
+    * Statasbar has been added to the message view window.
+    * The built-in image viewer has been improved, and its memory leaks
+      have been fixed.
+    * Ukrainian translation has been added.
+    * Other bugfixes have been made.
+
 * 0.9.9
 
     * Word wrapping on multibyte locales has been improved.
index d219e82..ed5b526 100644 (file)
@@ -3,19 +3,21 @@ AC_PREREQ(2.50)
 AC_INIT(src/main.c)
 AC_CONFIG_AUX_DIR(config)
 
-PACKAGE=sylpheed
+PACKAGE=sylpheed-claws
 
 dnl version number
 MAJOR_VERSION=0
 MINOR_VERSION=9
-MICRO_VERSION=10
+MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=67.10
-if test $EXTRA_VERSION -eq 0; then
-    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
+EXTRA_VERSION=17
+EXTRA_RELEASE=
+
+if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
+    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}
 else
-    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws${EXTRA_VERSION}
+    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}
 fi
 
 dnl set $target
@@ -278,7 +280,14 @@ fi
 dnl Check for OpenSSL
 AM_PATH_OPENSSL
 
-dnl Key for password encryption
+dnl password encryption
+OLDLIBS=$LIBS
+LIBS=
+AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
+CRYPT_LIBS=$LIBS
+AC_SUBST(CRYPT_LIBS)
+LIBS=$OLDLIBS
+
 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
            with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
index 919d5ec..01dfb50 100644 (file)
@@ -6,7 +6,6 @@ src/addrgather.c
 src/addrindex.c
 src/alertpanel.c
 src/browseldap.c
-src/common/intl.h
 src/common/md5.c
 src/common/nntp.c
 src/common/plugin.c
@@ -36,6 +35,7 @@ src/grouplistdialog.c
 src/gtk/about.c
 src/gtk/colorlabel.c
 src/gtk/description_window.c
+src/gtk/foldersort.c
 src/gtk/gtkaspell.c
 src/gtk/gtkutils.c
 src/gtk/inputdialog.c
@@ -43,9 +43,11 @@ src/gtk/logwindow.c
 src/gtk/pluginwindow.c
 src/gtk/prefswindow.c
 src/gtk/progressdialog.c
+src/gtk/quicksearch.c
 src/gtk/sslcertwindow.c
 src/headerview.c
 src/imap.c
+src/imap_gtk.c
 src/import.c
 src/importldif.c
 src/importmutt.c
@@ -58,8 +60,10 @@ src/matcher.c
 src/message_search.c
 src/messageview.c
 src/mh.c
+src/mh_gtk.c
 src/mimeview.c
 src/news.c
+src/news_gtk.c
 src/passphrase.c
 src/plugins/clamav/clamav_plugin.c
 src/plugins/clamav/clamav_plugin_gtk.c
@@ -70,10 +74,8 @@ src/plugins/image_viewer/plugin.c
 src/plugins/image_viewer/viewer.c
 src/plugins/image_viewer/viewerprefs.c
 src/plugins/mathml_viewer/mathml_viewer.c
-src/plugins/spamassassin/libspamc.c
 src/plugins/spamassassin/spamassassin.c
 src/plugins/spamassassin/spamassassin_gtk.c
-src/plugins/spamassassin/utils.c
 src/plugins/trayicon/trayicon.c
 src/pop.c
 src/prefs_account.c
@@ -96,7 +98,6 @@ src/prefs_toolbar.c
 src/privacy.c
 src/procmsg.c
 src/quote_fmt.c
-src/rfc2015.c
 src/select-keys.c
 src/send_message.c
 src/setup.c
index 2a40d99..cfad0b3 100644 (file)
@@ -332,6 +332,11 @@ EXTRA_DIST = \
        pixmaps/privacy_signed.xpm \
        pixmaps/privacy_unknown.xpm \
        pixmaps/privacy_warn.xpm \
+       pixmaps/privacy_emblem_encrypted.xpm \
+       pixmaps/privacy_emblem_failed.xpm \
+       pixmaps/privacy_emblem_passed.xpm \
+       pixmaps/privacy_emblem_signed.xpm \
+       pixmaps/privacy_emblem_warn.xpm \
        pixmaps/properties.xpm \
        pixmaps/quicksearch.xpm \
        pixmaps/regular.xpm \
index 3569620..101257a 100644 (file)
@@ -92,9 +92,6 @@ static void account_set_default               (void);
 
 static void account_edit_close         (void);
 
-static gint account_clone_event                (GtkWidget      *widget,
-                                        GdkEventAny    *event,
-                                        gpointer        data);
 static gint account_delete_event       (GtkWidget      *widget,
                                         GdkEventAny    *event,
                                         gpointer        data);
@@ -990,13 +987,6 @@ static void account_edit_close(void)
        inc_unlock();
 }
 
-static gint account_clone_event(GtkWidget *widget, GdkEventAny *event,
-                                gpointer data)
-{
-       account_clone();
-       return TRUE;
-}
-
 static gint account_delete_event(GtkWidget *widget, GdkEventAny *event,
                                 gpointer data)
 {
index 2987b1e..4b49648 100644 (file)
@@ -100,7 +100,7 @@ struct _ChildInfo
 };
 
 static void action_update_menu         (GtkItemFactory *ifactory,
-                                        const gchar    *branch_path,
+                                        gchar          *branch_path,
                                         gpointer        callback,
                                         gpointer        data);
 static void compose_actions_execute_cb (Compose        *compose,
@@ -406,7 +406,7 @@ void actions_execute(gpointer data,
 }
 
 void action_update_mainwin_menu(GtkItemFactory *ifactory,
-                               const gchar *branch_path,
+                               gchar *branch_path,
                                MainWindow *mainwin)
 {
        action_update_menu(ifactory, branch_path,
@@ -414,7 +414,7 @@ void action_update_mainwin_menu(GtkItemFactory *ifactory,
 }
 
 void action_update_msgview_menu(GtkItemFactory *ifactory,
-                               const gchar *branch_path,
+                               gchar *branch_path,
                                MessageView *msgview)
 {
        action_update_menu(ifactory, branch_path,
@@ -422,7 +422,7 @@ void action_update_msgview_menu(GtkItemFactory *ifactory,
 }
 
 void action_update_compose_menu(GtkItemFactory *ifactory, 
-                               const gchar *branch_path,
+                               gchar *branch_path,
                                Compose *compose)
 {
        action_update_menu(ifactory, branch_path,
@@ -430,7 +430,7 @@ void action_update_compose_menu(GtkItemFactory *ifactory,
 }
 
 static void action_update_menu(GtkItemFactory *ifactory, 
-                              const gchar *branch_path,
+                              gchar *branch_path,
                               gpointer callback, gpointer data)
 {
        GtkWidget *menuitem;
index d3d7a02..ce20311 100644 (file)
@@ -53,13 +53,13 @@ void actions_execute                (gpointer       data,
                                 gint           source);
 
 void action_update_mainwin_menu        (GtkItemFactory *ifactory,
-                                const gchar    *branch_path,
+                                gchar          *branch_path,
                                 MainWindow     *mainwin);
 void action_update_msgview_menu        (GtkItemFactory *ifactory,
-                                const gchar    *branch_path,
+                                gchar          *branch_path,
                                 MessageView    *msgview);
 void action_update_compose_menu        (GtkItemFactory *ifactory,
-                                const gchar    *branch_path,
+                                gchar          *branch_path,
                                 Compose        *compose);
 
 #endif /* __ACTION_H__ */
index fc4a5c4..8e81f47 100644 (file)
@@ -360,7 +360,9 @@ static void addressbook_treenode_paste_cb   ( void );
 
 static void addressbook_mail_to_cb             ( void );
 
+#ifdef USE_LDAP
 static void addressbook_browse_entry_cb                ( void );
+#endif
 
 static GtkItemFactoryEntry addressbook_entries[] =
 {
@@ -433,10 +435,9 @@ static GtkItemFactoryEntry addressbook_list_popup_entries[] =
        {N_("/_Paste"),         NULL, addressbook_clip_paste_cb,     0, NULL},
        {N_("/---"),            NULL, NULL, 0, "<Separator>"},
        {N_("/Pa_ste Address"), NULL, addressbook_clip_paste_address_cb, 0, NULL},
-       {N_("/_Mail To"),       NULL, addressbook_mail_to_cb,            0, NULL}
+       {N_("/_Mail To"),       NULL, addressbook_mail_to_cb,            0, NULL},
 #ifdef USE_LDAP
-       ,
-       {N_("/_Browse Entry"),  NULL, addressbook_browse_entry_cb,       0, NULL}
+       {N_("/_Browse Entry"),  NULL, addressbook_browse_entry_cb,       0, NULL},
 #endif 
 };
 
@@ -3765,6 +3766,7 @@ static void addressbook_lup_clicked( GtkButton *button, gpointer data ) {
        g_free( searchTerm );
 }
 
+#ifdef USE_LDAP
 /**
  * Browse address entry for highlighted entry.
  */
@@ -3809,12 +3811,10 @@ static void addressbook_browse_entry_cb(void)
        }
 
        if( iface->type == ADDR_IF_LDAP ) {
-#ifdef USE_LDAP
                browseldap_entry(ds, person->externalID);
-#endif
        }
 }
-
+#endif
 
 /* **********************************************************************
 * Build lookup tables.
index d58d42f..4dc69ba 100644 (file)
@@ -170,6 +170,11 @@ gint addrindex_setup_static_search ( AddressDataSource *ds,
 
 gboolean addrindex_start_search                ( const gint queryID );
 void addrindex_stop_search             ( const gint queryID );
+gint addrindex_setup_explicit_search   ( AddressDataSource *ds, 
+                                         const gchar *searchTerm, 
+                                         ItemFolder *folder,
+                                         void *callBackEnd,
+                                         void *callBackEntry );
 void addrindex_remove_results          ( AddressDataSource *ds,
                                          ItemFolder *folder );
 
index 8f71f46..9d0d4e1 100644 (file)
@@ -67,7 +67,7 @@ AM_CPPFLAGS = \
 libsylpheedcommon_la_LIBADD = \
        $(GLIB_LIBS) \
        $(OPENSSL_LIBS) \
-       -lcrypt
+       $(CRYPT_LIBS)
 
 EXTRA_DIST = \
        version.h.in
index 8a516af..730591c 100644 (file)
 #define UI_REFRESH_INTERVAL            50000   /* usec */
 #define FOLDER_UPDATE_INTERVAL         1500    /* msec */
 #define PROGRESS_UPDATE_INTERVAL       200     /* msec */
-#define SESSION_TIMEOUT                        60      /* sec */
+#define SESSION_TIMEOUT_INTERVAL       60      /* sec */
 #define MAX_HISTORY_SIZE               16
 
 #define NORMAL_FONT prefs_common.normalfont
index 30a11f2..6824c00 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 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,6 +42,8 @@ static gint session_connect_cb                (SockInfo       *sock,
                                         gpointer        data);
 static gint session_close              (Session        *session);
 
+static gboolean session_timeout_cb     (gpointer        data);
+
 static gboolean session_recv_msg_idle_cb       (gpointer        data);
 static gboolean session_recv_data_idle_cb      (gpointer        data);
 
@@ -88,6 +90,9 @@ void session_init(Session *session)
        session->write_buf_p = NULL;
        session->write_buf_len = 0;
 
+       session->timeout_tag = 0;
+       session->timeout_interval = 0;
+
        session->data = NULL;
 }
 
@@ -200,6 +205,36 @@ gboolean session_is_connected(Session *session)
                session->state == SESSION_RECV);
 }
 
+void session_set_timeout(Session *session, guint interval)
+{
+       if (session->timeout_tag > 0)
+               g_source_remove(session->timeout_tag);
+
+       session->timeout_interval = interval;
+       if (interval > 0)
+               session->timeout_tag =
+                       g_timeout_add(interval, session_timeout_cb, session);
+       else
+               session->timeout_tag = 0;
+}
+
+static gboolean session_timeout_cb(gpointer data)
+{
+       Session *session = SESSION(data);
+
+       g_warning("session timeout.\n");
+
+       if (session->io_tag > 0) {
+               g_source_remove(session->io_tag);
+               session->io_tag = 0;
+       }
+
+       session->timeout_tag = 0;
+       session->state = SESSION_TIMEOUT;
+
+       return FALSE;
+}
+
 void session_set_recv_message_notify(Session *session,
                                     RecvMsgNotify notify_func, gpointer data)
 {
@@ -253,8 +288,11 @@ static gint session_close(Session *session)
        if (session->conn_id > 0) {
                sock_connect_async_cancel(session->conn_id);
                session->conn_id = 0;
+               debug_print("session (%p): connection cancelled\n", session);
        }
 
+       session_set_timeout(session, 0);
+
        if (session->io_tag > 0) {
                g_source_remove(session->io_tag);
                session->io_tag = 0;
@@ -264,10 +302,9 @@ static gint session_close(Session *session)
                sock_close(session->sock);
                session->sock = NULL;
                session->state = SESSION_DISCONNECTED;
+               debug_print("session (%p): closed\n", session);
        }
 
-       debug_print("session (%p): closed\n", session);
-
        return 0;
 }
 
@@ -431,6 +468,8 @@ static gboolean session_read_msg_cb(SockInfo *source, GIOCondition condition,
 
        g_return_val_if_fail(condition == G_IO_IN, FALSE);
 
+       session_set_timeout(session, session->timeout_interval);
+
        if (session->read_buf_len == 0) {
                gint read_len;
 
@@ -524,6 +563,8 @@ static gboolean session_read_data_cb(SockInfo *source, GIOCondition condition,
 
        g_return_val_if_fail(condition == G_IO_IN, FALSE);
 
+       session_set_timeout(session, session->timeout_interval);
+
        if (session->read_buf_len == 0) {
                gint read_len;
 
@@ -713,6 +754,7 @@ static gboolean session_write_data_cb(SockInfo *source,
                if (tv_cur.tv_sec - session->tv_prev.tv_sec > 0 ||
                    tv_cur.tv_usec - session->tv_prev.tv_usec >
                    UI_REFRESH_INTERVAL) {
+                       session_set_timeout(session, session->timeout_interval);
                        session->send_data_progressive_notify
                                (session,
                                 session->write_buf_p - session->write_buf,
index d747a14..2aca7c8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 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
@@ -43,7 +43,7 @@ typedef enum {
        SESSION_IMAP,
        SESSION_NEWS,
        SESSION_SMTP,
-       SESSION_POP3
+       SESSION_POP3,
 } SessionType;
 
 typedef enum {
@@ -51,6 +51,7 @@ typedef enum {
        SESSION_SEND,
        SESSION_RECV,
        SESSION_EOF,
+       SESSION_TIMEOUT,
        SESSION_ERROR,
        SESSION_DISCONNECTED
 } SessionState;
@@ -119,6 +120,9 @@ struct _Session
        gchar *write_buf_p;
        gint write_buf_len;
 
+       guint timeout_tag;
+       guint timeout_interval;
+
        gpointer data;
 
        /* virtual methods to parse server responses */
@@ -155,6 +159,9 @@ gint session_disconnect             (Session        *session);
 void session_destroy           (Session        *session);
 gboolean session_is_connected  (Session        *session);
 
+void session_set_timeout       (Session        *session,
+                                guint           interval);
+
 void session_set_recv_message_notify   (Session        *session,
                                         RecvMsgNotify   notify_func,
                                         gpointer        data);
index a5b1022..f6121da 100644 (file)
@@ -50,7 +50,7 @@ void ssl_init(void)
        SSL_CTX_set_default_verify_paths(ssl_ctx);
        
 #if (OPENSSL_VERSION_NUMBER < 0x0090600fL)
-       SSL_CTX_set_verify_depth(ctx,1);
+       SSL_CTX_set_verify_depth(ssl_ctx,1);
 #endif
 }
 
index 4e5febc..0576c85 100644 (file)
@@ -27,7 +27,7 @@
 
 #define PACKAGE                        "@PACKAGE@"
 #define VERSION                        "@VERSION@"
-#define PROG_VERSION           "Sylpheed version "VERSION
+#define PROG_VERSION           "Sylpheed-Claws "VERSION
 #define VERSION_NUMERIC                MAKE_NUMERIC_VERSION(@MAJOR_VERSION@, @MINOR_VERSION@, \
                                                     @MICRO_VERSION@, @EXTRA_VERSION@)
 
index bf988c0..9e3d367 100644 (file)
@@ -381,6 +381,10 @@ static void compose_grab_focus_cb  (GtkWidget      *widget,
 static void compose_changed_cb         (GtkTextBuffer  *textbuf,
                                         Compose        *compose);
 
+static void compose_toggle_autowrap_cb (gpointer        data,
+                                        guint           action,
+                                        GtkWidget      *widget);
+
 #if 0
 static void compose_toggle_to_cb       (gpointer        data,
                                         guint           action,
@@ -603,6 +607,8 @@ static GtkItemFactoryEntry compose_entries[] =
                                        "<control>L", compose_wrap_line, 0, NULL},
        {N_("/_Edit/Wrap all long _lines"),
                                        "<control><alt>L", compose_wrap_line_all, 0, NULL},
+       {N_("/_Edit/Aut_o wrapping"),   "<shift><control>L", compose_toggle_autowrap_cb, 0, "<ToggleItem>"},
+       {N_("/_Edit/---"),              NULL, NULL, 0, "<Separator>"},
        {N_("/_Edit/Edit with e_xternal editor"),
                                        "<shift><control>X", compose_ext_editor_cb, 0, NULL},
 #if USE_ASPELL
@@ -746,7 +752,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                        compose_entry_mark_default_to(compose, item->prefs->default_to);
                }
                if (item && item->ret_rcpt) {
-                       menu_set_toggle(ifactory, "/Message/Request Return Receipt", TRUE);
+                       menu_set_active(ifactory, "/Message/Request Return Receipt", TRUE);
                }
        } else {
                if (mailto) {
@@ -955,7 +961,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
        compose = compose_create(account, COMPOSE_REPLY);
        ifactory = gtk_item_factory_from_widget(compose->menubar);
 
-       menu_set_toggle(ifactory, "/Message/Remove references", FALSE);
+       menu_set_active(ifactory, "/Message/Remove references", FALSE);
        menu_set_sensitive(ifactory, "/Message/Remove references", TRUE);
 
        compose->replyinfo = procmsg_msginfo_get_full_info(msginfo);
@@ -963,7 +969,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                compose->replyinfo = procmsg_msginfo_copy(msginfo);
 
        if (msginfo->folder && msginfo->folder->ret_rcpt)
-               menu_set_toggle(ifactory, "/Message/Request Return Receipt", TRUE);
+               menu_set_active(ifactory, "/Message/Request Return Receipt", TRUE);
 
        /* Set save folder */
        if (msginfo->folder && msginfo->folder->prefs && msginfo->folder->prefs->save_copy_to_folder) {
@@ -2179,13 +2185,9 @@ static void compose_attach_append(Compose *compose, const gchar *file,
 #if 0 /* NEW COMPOSE GUI */
        if (!compose->use_attach) {
                GtkItemFactory *ifactory;
-               GtkWidget *menuitem;
 
                ifactory = gtk_item_factory_from_widget(compose->menubar);
-               menuitem = gtk_item_factory_get_item(ifactory,
-                                                    "/View/Attachment");
-               gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                              TRUE);
+               menu_set_active(ifactory, "/View/Attachment", TRUE);
        }
 #endif
        ainfo = g_new0(AttachInfo, 1);
@@ -3060,7 +3062,6 @@ compose_current_mail_account(void)
 static void compose_select_account(Compose *compose, PrefsAccount *account,
                                   gboolean init)
 {
-       GtkWidget *menuitem;
        GtkItemFactory *ifactory;
 
        g_return_if_fail(account != NULL);
@@ -3077,15 +3078,10 @@ static void compose_select_account(Compose *compose, PrefsAccount *account,
                gtk_table_set_row_spacing(GTK_TABLE(compose->table), 2, 4);
                compose->use_newsgroups = TRUE;
 
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/To");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
-               gtk_widget_set_sensitive(menuitem, TRUE);
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
-               gtk_widget_set_sensitive(menuitem, TRUE);
-
+               menu_set_active(ifactory, "/View/To", FALSE);
+               menu_set_sensitive(ifactory, "/View/To", TRUE);
+               menu_set_active(ifactory, "/View/Cc", FALSE);
+               menu_set_sensitive(ifactory, "/View/Cc", TRUE);
                menu_set_sensitive(ifactory, "/View/Followup to", TRUE);
        } else {
                gtk_widget_hide(compose->newsgroups_hbox);
@@ -3094,19 +3090,12 @@ static void compose_select_account(Compose *compose, PrefsAccount *account,
                gtk_widget_queue_resize(compose->table_vbox);
                compose->use_newsgroups = FALSE;
 
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/To");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               gtk_widget_set_sensitive(menuitem, FALSE);
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               gtk_widget_set_sensitive(menuitem, FALSE);
-
-               menuitem = gtk_item_factory_get_item(ifactory, "/View/Followup to");
-               gtk_check_menu_item_set_active
-                       (GTK_CHECK_MENU_ITEM(menuitem), FALSE);
-               gtk_widget_set_sensitive(menuitem, FALSE);
+               menu_set_active(ifactory, "/View/To", TRUE);
+               menu_set_sensitive(ifactory, "/View/To", FALSE);
+               menu_set_active(ifactory, "/View/Cc", TRUE);
+               menu_set_sensitive(ifactory, "/View/Cc", FALSE);
+               menu_set_active(ifactory, "/View/Followup to", FALSE);
+               menu_set_sensitive(ifactory, "/View/Followup to", FALSE);
        }
 
        if (account->set_autocc) {
@@ -3134,12 +3123,10 @@ static void compose_select_account(Compose *compose, PrefsAccount *account,
 #endif
 
 #if USE_GPGME
-       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Sign");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                      account->default_sign);
-       menuitem = gtk_item_factory_get_item(ifactory, "/Message/Encrypt");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                      account->default_encrypt);
+       if (account->default_sign)
+               menu_set_active(ifactory, "/Message/Sign", TRUE);
+       if (account->default_encrypt)
+               menu_set_active(ifactory, "/Message/Encrypt", TRUE);
                                       
        activate_gnupg_mode(compose, account);          
 #endif /* USE_GPGME */
@@ -3265,8 +3252,8 @@ gint compose_send(Compose *compose)
        }
 
        /* write to temporary file */
-       g_snprintf(tmp, sizeof(tmp), "%s%ctmpmsg.%08x",
-                  get_tmp_dir(), G_DIR_SEPARATOR, (gint)compose);
+       g_snprintf(tmp, sizeof(tmp), "%s%ctmpmsg.%p",
+                  get_tmp_dir(), G_DIR_SEPARATOR, compose);
 
        if (prefs_common.linewrap_at_send)
                compose_wrap_line_all(compose);
@@ -5390,6 +5377,8 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        compose->msgid       = NULL;
        compose->boundary    = NULL;
 
+       compose->autowrap       = prefs_common.autowrap;
+
 #if USE_GPGME
        compose->use_signing    = FALSE;
        compose->use_encryption = FALSE;
@@ -5453,6 +5442,8 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
 
        compose_select_account(compose, account, TRUE);
 
+       menu_set_active(ifactory, "/Edit/Auto wrapping", prefs_common.autowrap);
+       menu_set_active(ifactory, "/View/Ruler", prefs_common.show_ruler);
        if (account->set_autocc && account->auto_cc && mode != COMPOSE_REEDIT)
                compose_entry_append(compose, account->auto_cc, COMPOSE_CC);
 
@@ -7239,6 +7230,16 @@ static void compose_changed_cb(GtkTextBuffer *textbuf, Compose *compose)
        }
 }
 
+static void compose_toggle_autowrap_cb(gpointer data, guint action,
+                                      GtkWidget *widget)
+{
+       Compose *compose = (Compose *)data;
+
+       compose->autowrap = GTK_CHECK_MENU_ITEM(widget)->active;
+       if (compose->autowrap)
+               compose_wrap_line_all_full(compose, TRUE);
+}
+
 #if 0 /* NEW COMPOSE GUI */
 static void compose_toggle_to_cb(gpointer data, guint action,
                                 GtkWidget *widget)
index b678658..a7fb02c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 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
@@ -161,6 +161,8 @@ struct _Compose
        gchar   *msgid;
        gchar   *boundary;
 
+       gboolean autowrap;
+
        gboolean use_to;
        gboolean use_cc;
        gboolean use_bcc;
index a59900e..94f0d1f 100644 (file)
@@ -72,6 +72,8 @@ static gboolean persist_prefs_free    (gpointer key, gpointer val, gpointer data);
 void folder_item_read_cache            (FolderItem *item);
 void folder_item_free_cache            (FolderItem *item);
 gint folder_item_scan_full             (FolderItem *item, gboolean filtering);
+static void folder_item_update_with_msg (FolderItem *item, FolderItemUpdateFlags update_flags,
+                                         MsgInfo *msg);
 
 void folder_system_init(void)
 {
@@ -804,7 +806,8 @@ gint folder_item_rename(FolderItem *item, gchar *newname)
                FolderItemUpdateData hookdata;
 
                hookdata.item = item;
-               hookdata.update_flags = FOLDER_TREE_CHANGED;
+               hookdata.update_flags = F_ITEM_UPDATE_NAME;
+               hookdata.msg = NULL;
                hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &hookdata);
        }
 
@@ -1441,6 +1444,8 @@ gint folder_item_open(FolderItem *item)
        
        folder_item_apply_processing(item);
 
+       item->opened = TRUE;
+
        debug_print("done.\n");
 
        return 0;
@@ -1481,6 +1486,89 @@ gint folder_item_close(FolderItem *item)
        return folder->klass->close(folder, item);
 }
 
+static void msginfo_set_mime_flags(GNode *node, gpointer data)
+{
+       MsgInfo *msginfo = data;
+       MimeInfo *mimeinfo = node->data;
+
+       if (mimeinfo->disposition == DISPOSITIONTYPE_ATTACHMENT) {
+               MSG_SET_TMP_FLAGS(msginfo->flags, MSG_HAS_ATTACHMENT);
+       } else if (mimeinfo->disposition == DISPOSITIONTYPE_UNKNOWN && 
+                mimeinfo->type != MIMETYPE_TEXT &&
+                mimeinfo->type != MIMETYPE_MULTIPART) {
+               MSG_SET_TMP_FLAGS(msginfo->flags, MSG_HAS_ATTACHMENT)
+       }
+
+       /* don't descend below top level message for signed and encrypted info */
+       if (mimeinfo->type == MIMETYPE_MESSAGE)
+               return;
+
+       if (privacy_mimeinfo_is_signed(mimeinfo)) {
+               MSG_SET_TMP_FLAGS(msginfo->flags, MSG_SIGNED);
+       }
+
+       if (privacy_mimeinfo_is_encrypted(mimeinfo)) {
+               MSG_SET_TMP_FLAGS(msginfo->flags, MSG_ENCRYPTED);
+       } else {
+               /* searching inside encrypted parts doesn't really make sense */
+               g_node_children_foreach(mimeinfo->node, G_TRAVERSE_ALL, msginfo_set_mime_flags, msginfo);
+       }
+}
+
+static MsgInfoList *get_msginfos(FolderItem *item, MsgNumberList *numlist)
+{
+       MsgInfoList *msglist = NULL;
+       Folder *folder = item->folder;
+       MsgInfoList *elem;
+
+       if (folder->klass->get_msginfos != NULL)
+               msglist = folder->klass->get_msginfos(folder, item, numlist);
+       else {
+               MsgNumberList *elem;
+
+               for (elem = numlist; elem != NULL; elem = g_slist_next(elem)) {
+                       MsgInfo *msginfo;
+                       guint num;
+
+                       num = GPOINTER_TO_INT(elem->data);
+                       msginfo = folder->klass->get_msginfo(folder, item, num);
+                       if (msginfo != NULL)
+                               msglist = g_slist_prepend(msglist, msginfo);
+               }               
+       }
+
+       for (elem = msglist; elem != NULL; elem = g_slist_next(elem)) {
+               MsgInfo *msginfo = elem->data;
+
+               if (MSG_IS_MULTIPART(msginfo->flags)) {
+                       MimeInfo *mimeinfo;
+
+                       mimeinfo = procmime_scan_message(msginfo);
+                       g_node_children_foreach(mimeinfo->node, G_TRAVERSE_ALL, msginfo_set_mime_flags, msginfo);
+                       procmime_mimeinfo_free_all(mimeinfo);
+                       /* check for attachments */
+               }
+       }
+
+       return msglist;
+}
+
+static MsgInfo *get_msginfo(FolderItem *item, guint num)
+{
+       MsgNumberList numlist;
+       MsgInfoList *msglist;
+       MsgInfo *msginfo = NULL;
+
+       numlist.data = GINT_TO_POINTER(num);
+       numlist.next = NULL;
+       msglist = get_msginfos(item, &numlist);
+       if (msglist != NULL)
+               msginfo = procmsg_msginfo_new_ref(msglist->data);
+       procmsg_msg_list_free(msglist);
+
+       return msginfo;
+}
+
 gint folder_item_scan_full(FolderItem *item, gboolean filtering)
 {
        Folder *folder;
@@ -1655,23 +1743,7 @@ gint folder_item_scan_full(FolderItem *item, gboolean filtering)
        g_slist_free(folder_list);
 
        if (new_list != NULL) {
-               if (folder->klass->get_msginfos) {
-                       newmsg_list = folder->klass->get_msginfos(folder, item, new_list);
-               } else if (folder->klass->get_msginfo) {
-                       GSList *elem;
-       
-                       for (elem = new_list; elem != NULL; elem = g_slist_next(elem)) {
-                               MsgInfo *msginfo;
-                               guint num;
-
-                               num = GPOINTER_TO_INT(elem->data);
-                               msginfo = folder->klass->get_msginfo(folder, item, num);
-                               if (msginfo != NULL) {
-                                       newmsg_list = g_slist_prepend(newmsg_list, msginfo);
-                                       debug_print("Added newly found message %d to cache.\n", num);
-                               }
-                       }
-               }
+               newmsg_list = get_msginfos(item, new_list);
                g_slist_free(new_list);
        }
 
@@ -1959,7 +2031,7 @@ void folder_item_write_cache(FolderItem *item)
 MsgInfo *folder_item_get_msginfo(FolderItem *item, gint num)
 {
        Folder *folder;
-       MsgInfo *msginfo;
+       MsgInfo *msginfo = NULL;
        
        g_return_val_if_fail(item != NULL, NULL);
        
@@ -1970,8 +2042,8 @@ MsgInfo *folder_item_get_msginfo(FolderItem *item, gint num)
        if ((msginfo = msgcache_get_msg(item->cache, num)) != NULL)
                return msginfo;
        
-       g_return_val_if_fail(folder->klass->get_msginfo, NULL);
-       if ((msginfo = folder->klass->get_msginfo(folder, item, num)) != NULL) {
+       msginfo = get_msginfo(item, num);
+       if (msginfo != NULL) {
                msgcache_add_msg(item->cache, msginfo);
                return msginfo;
        }
@@ -2156,7 +2228,7 @@ static void add_msginfo_to_cache(FolderItem *item, MsgInfo *newmsginfo, MsgInfo
        folder_item_update_freeze();
        msgcache_add_msg(item->cache, newmsginfo);
        copy_msginfo_flags(flagsource, newmsginfo);
-       folder_item_update(item,  F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
+       folder_item_update_with_msg(item,  F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT | F_ITEM_UPDATE_ADDMSG, newmsginfo);
        folder_item_update_thaw();
 }
 
@@ -2180,7 +2252,7 @@ static void remove_msginfo_from_cache(FolderItem *item, MsgInfo *msginfo)
        hooks_invoke(MSGINFO_UPDATE_HOOKLIST, &msginfo_update);
 
        msgcache_remove_msg(item->cache, msginfo->msgnum);
-       folder_item_update(msginfo->folder, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
+       folder_item_update_with_msg(msginfo->folder, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT | F_ITEM_UPDATE_REMOVEMSG, msginfo);
 }
 
 gint folder_item_add_msg(FolderItem *dest, const gchar *file,
@@ -2270,7 +2342,7 @@ gint folder_item_add_msgs(FolderItem *dest, GSList *file_list,
                                continue;
 
                        if (!folderscan && 
-                           ((newmsginfo = folder->klass->get_msginfo(folder, dest, num)) != NULL)) {
+                           ((newmsginfo = get_msginfo(dest, num)) != NULL)) {
                                add_msginfo_to_cache(dest, newmsginfo, NULL);
                                procmsg_msginfo_free(newmsginfo);
                        } else if ((newmsginfo = msgcache_get_msg(dest->cache, num)) != NULL) {
@@ -2316,7 +2388,7 @@ FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest)
 
        /* move messages */
        debug_print("Moving %s to %s\n", src->path, dest->path);
-       new_item = folder_create_folder(dest, g_basename(src->path));
+       new_item = folder_create_folder(dest, src->name);
        if (new_item == NULL) {
                printf("Can't create folder\n");
                return NULL;
@@ -2328,7 +2400,8 @@ FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest)
        /* move messages */
        log_message(_("Moving %s to %s...\n"), 
                        src->name, new_item->path);
-       folder_item_move_msgs(new_item, mlist);
+       if (mlist != NULL)
+               folder_item_move_msgs(new_item, mlist);
        
        /*copy prefs*/
        folder_item_prefs_copy_prefs(src, new_item);
@@ -2357,8 +2430,10 @@ FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest)
        old_id = folder_item_get_identifier(src);
        new_id = folder_item_get_identifier(new_item);
        debug_print("updating rules : %s => %s\n", old_id, new_id);
-       
-       src->folder->klass->remove_folder(src->folder, src);
+
+       /* if src supports removing, otherwise only copy folder */
+       if (src->folder->klass->remove_folder != NULL)  
+               src->folder->klass->remove_folder(src->folder, src);
        folder_write_list();
 
        if (old_id != NULL && new_id != NULL)
@@ -2499,7 +2574,7 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour
                                        }
                                }
                        } else {
-                               newmsginfo = folder->klass->get_msginfo(folder, dest, num);
+                               newmsginfo = get_msginfo(dest, num);
                                if (newmsginfo != NULL) {
                                        add_msginfo_to_cache(dest, newmsginfo, msginfo);
                                        procmsg_msginfo_free(newmsginfo);
@@ -2624,7 +2699,6 @@ gint folder_item_remove_msg(FolderItem *item, gint num)
                remove_msginfo_from_cache(item, msginfo);
                procmsg_msginfo_free(msginfo);
        }
-       folder_item_update(item, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
 
        return ret;
 }
@@ -3165,6 +3239,20 @@ void folder_item_apply_processing(FolderItem *item)
  */
 static gint folder_item_update_freeze_cnt = 0;
 
+static void folder_item_update_with_msg(FolderItem *item, FolderItemUpdateFlags update_flags, MsgInfo *msg)
+{
+       if (folder_item_update_freeze_cnt == 0 || (msg != NULL && item->opened)) {
+               FolderItemUpdateData source;
+       
+               source.item = item;
+               source.update_flags = update_flags;
+               source.msg = msg;
+               hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
+       } else {
+               item->update_flags |= update_flags & ~(F_ITEM_UPDATE_ADDMSG | F_ITEM_UPDATE_REMOVEMSG);
+       }
+}
+
 /**
  * Notify the folder system about changes to a folder. If the
  * update system is not frozen the FOLDER_ITEM_UPDATE_HOOKLIST will
@@ -3176,15 +3264,7 @@ static gint folder_item_update_freeze_cnt = 0;
  */
 void folder_item_update(FolderItem *item, FolderItemUpdateFlags update_flags)
 {
-       if (folder_item_update_freeze_cnt == 0) {
-               FolderItemUpdateData source;
-       
-               source.item = item;
-               source.update_flags = update_flags;
-               hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
-       } else {
-               item->update_flags |= update_flags;
-       }
+       folder_item_update_with_msg(item, update_flags, NULL);
 }
 
 void folder_item_update_recursive(FolderItem *item, FolderItemUpdateFlags update_flags)
index 607a532..64649e4 100644 (file)
@@ -111,7 +111,9 @@ typedef enum
 {
        F_ITEM_UPDATE_MSGCNT = 1 << 0,
        F_ITEM_UPDATE_CONTENT = 1 << 1,
-       F_ITEM_UPDATE_NAME = 1 << 2,
+       F_ITEM_UPDATE_ADDMSG = 1 << 2,
+       F_ITEM_UPDATE_REMOVEMSG = 1 << 3,
+       F_ITEM_UPDATE_NAME = 1 << 4,
 } FolderItemUpdateFlags;
 
 typedef void (*FolderUIFunc)           (Folder         *folder,
@@ -630,6 +632,7 @@ struct _FolderItemUpdateData
 {
        FolderItem              *item;
        FolderItemUpdateFlags    update_flags;
+       MsgInfo                 *msg;
 };
 
 void       folder_system_init          (void);
@@ -719,6 +722,7 @@ gchar *folder_item_get_path         (FolderItem     *item);
 gint   folder_item_open                        (FolderItem     *item);
 gint   folder_item_close               (FolderItem     *item);
 gint   folder_item_scan                        (FolderItem     *item);
+gint   folder_item_syncronize_flags    (FolderItem     *item);
 void   folder_item_scan_foreach                (GHashTable     *table);
 MsgInfo *folder_item_get_msginfo       (FolderItem     *item,
                                         gint            num);
index 75a55d8..2af8990 100644 (file)
@@ -231,7 +231,7 @@ gint folder_item_prefs_get_sort_type(FolderItem * item)
 
 void folder_item_prefs_copy_prefs(FolderItem * src, FolderItem * dest)
 {
-       GSList *tmp_prop_list = NULL, *tmp_scor_list = NULL, *tmp;
+       GSList *tmp_prop_list = NULL, *tmp;
        folder_item_prefs_read_config(src);
 
        tmp_prefs.directory                     = g_strdup(src->prefs->directory);
index a54ab8a..337a422 100644 (file)
@@ -25,6 +25,7 @@ libsylpheedgtk_la_SOURCES = \
        pluginwindow.c \
        prefswindow.c \
        progressdialog.c \
+       quicksearch.c \
        sslcertwindow.c \
        sylpheed-marshal.c
 
@@ -50,6 +51,7 @@ sylpheedgtkinclude_HEADERS = \
        prefswindow.h \
        gtkvscrollbutton.h \
        progressdialog.h \
+       quicksearch.h \
        sslcertwindow.h \
        sylpheed-marshal.h
 
index 03856a7..3f5859e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 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
@@ -26,8 +26,8 @@
 #include <gtk/gtkwidget.h>
 #include <gtk/gtkmenu.h>
 #include <gtk/gtkmenubar.h>
-#include <gtk/gtkitemfactory.h>
 #include <gtk/gtkcheckmenuitem.h>
+#include <gtk/gtkitemfactory.h>
 #include <gtk/gtkbutton.h>
 #include <gtk/gtkwindow.h>
 
@@ -204,25 +204,15 @@ void menu_set_sensitive_all(GtkMenuShell *menu_shell, gboolean sensitive)
                gtk_widget_set_sensitive(GTK_WIDGET(cur->data), sensitive);
 }
 
-void menu_set_toggle(GtkItemFactory *ifactory, const gchar *path,
-                       gboolean active)
+void menu_set_active(GtkItemFactory *ifactory, const gchar *path,
+                    gboolean is_active)
 {
        GtkWidget *widget;
 
        g_return_if_fail(ifactory != NULL);
 
        widget = gtk_item_factory_get_item(ifactory, path);
-       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(widget), active);
-}
-
-void menu_toggle_toggle(GtkItemFactory *ifactory, const gchar *path)
-{
-       GtkWidget *widget;
-       
-       g_return_if_fail(ifactory != NULL);
-       
-       widget = gtk_item_factory_get_item(ifactory, path);
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), !((GTK_CHECK_MENU_ITEM(widget))->active));
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), is_active);
 }
 
 void menu_button_position(GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
index 8e31703..6be90a1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 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
@@ -71,11 +71,9 @@ void menu_set_sensitive              (GtkItemFactory         *ifactory,
 void menu_set_sensitive_all    (GtkMenuShell           *menu_shell,
                                 gboolean                sensitive);
 
-void menu_set_toggle           (GtkItemFactory         *ifactory,
-                                const gchar            *path,
-                                gboolean                active);
-void menu_toggle_toggle                (GtkItemFactory         *ifactory,
-                                const gchar            *path);
+void menu_set_active           (GtkItemFactory         *ifactory,
+                                const gchar            *path,
+                                gboolean                is_active);
 void menu_button_position      (GtkMenu                *menu,
                                 gint                   *x,
                                 gint                   *y,
index 76044e3..abe4033 100644 (file)
@@ -234,7 +234,7 @@ static void headerview_show_xface(HeaderView *headerview, MsgInfo *msginfo)
                gtk_widget_show(headerview->image);
        }
 
-       gdk_pixmap_unref(pixmap);
+       g_object_unref(pixmap);
 }
 #endif
 
index fe78554..f0e1fbe 100644 (file)
@@ -659,7 +659,7 @@ static IMAPSession *imap_session_get(Folder *folder)
         * A better solution than sending a NOOP every time would be
         * for every command to be prepared to retry until it is
         * successfully sent. -- mbp */
-       if (time(NULL) - session->last_access_time > SESSION_TIMEOUT) {
+       if (time(NULL) - session->last_access_time > SESSION_TIMEOUT_INTERVAL) {
                /* verify that the session is still alive */
                if (imap_cmd_noop(session) != IMAP_SUCCESS) {
                        /* Check if this is the first try to establish a
index e73cbda..c79b763 100644 (file)
@@ -313,10 +313,8 @@ static void delete_folder_cb(FolderView *folderview, guint action,
        }
 
        if (item->folder->klass->remove_folder(item->folder, item) < 0) {
+               folder_item_scan(item);
                alertpanel_error(_("Can't remove the folder `%s'."), name);
-               if (folderview->opened == folderview->selected)
-                       summary_show(folderview->summaryview,
-                                    folderview->summaryview->folder_item);
                g_free(old_id);
                return;
        }
index 4b3b411..eb9feaf 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -208,19 +208,36 @@ void inc_mail(MainWindow *mainwin, gboolean notify)
 
 void inc_pop_before_smtp(PrefsAccount *acc)
 {
+       IncProgressDialog *inc_dialog;
+       IncSession *session;
+       MainWindow *mainwin;
+
+       mainwin = mainwindow_get_mainwindow();
+
+       session = inc_session_new(acc);
+       if (!session) return;
+       POP3_SESSION(session->session)->pop_before_smtp = TRUE;
+               
+       inc_dialog = inc_progress_dialog_create(FALSE);
+       inc_dialog->queue_list = g_list_append(inc_dialog->queue_list,
+                                              session);
        /* FIXME: assumes to attach to first main window */
-       inc_account_mail(mainwindow_get_mainwindow(), acc);
+       inc_dialog->mainwin = mainwin;
+       inc_progress_dialog_set_list(inc_dialog);
+
+       if (mainwin) {
+               toolbar_main_set_sensitive(mainwin);
+               main_window_set_menu_sensitive(mainwin);
+       }
+                       
+       inc_start(inc_dialog);
 }
 
 static gint inc_account_mail_real(MainWindow *mainwin, PrefsAccount *account)
 {
        IncProgressDialog *inc_dialog;
        IncSession *session;
-       FolderItem *item = NULL;
        
-       if(mainwin && mainwin->summaryview)
-               item = mainwin->summaryview->folder_item;
-
        switch (account->protocol) {
        case A_IMAP4:
        case A_NNTP:
@@ -268,7 +285,7 @@ gint inc_account_mail(MainWindow *mainwin, PrefsAccount *account)
                if (alertpanel(_("Offline warning"), 
                               _("You're working offline. Override?"),
                               _("Yes"), _("No"), NULL) != G_ALERTDEFAULT)
-               return;
+                       return 0;
 
        inc_autocheck_timer_remove();
        main_window_lock(mainwin);
@@ -315,8 +332,8 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck,
        if (account_new_msgs > 0)
                new_msgs += account_new_msgs;
 
-       /* check IMAP4 folders */
-       for (; list != NULL; list = list->next) {
+       /* check IMAP4 / News folders */
+       for (list = account_get_list(); list != NULL; list = list->next) {
                PrefsAccount *account = list->data;
                if ((account->protocol == A_IMAP4 ||
                     account->protocol == A_NNTP) && account->recv_at_getall) {
@@ -336,23 +353,17 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck,
                }
        }
 
-       if (!queue_list) {
-               inc_finished(mainwin, new_msgs > 0);
-               main_window_unlock(mainwin);
-               inc_notify_cmd(new_msgs, notify);
-               inc_autocheck_timer_set();
-               return;
-       }
-
-       inc_dialog = inc_progress_dialog_create(autocheck);
-       inc_dialog->queue_list = queue_list;
-       inc_dialog->mainwin = mainwin;
-       inc_progress_dialog_set_list(inc_dialog);
+       if (queue_list) {
+               inc_dialog = inc_progress_dialog_create(autocheck);
+               inc_dialog->queue_list = queue_list;
+               inc_dialog->mainwin = mainwin;
+               inc_progress_dialog_set_list(inc_dialog);
 
-       toolbar_main_set_sensitive(mainwin);
-       main_window_set_menu_sensitive(mainwin);
+               toolbar_main_set_sensitive(mainwin);
+               main_window_set_menu_sensitive(mainwin);
+               new_msgs += inc_start(inc_dialog);
+       }
 
-       new_msgs += inc_start(inc_dialog);
        inc_finished(mainwin, new_msgs > 0);
        main_window_unlock(mainwin);
        inc_notify_cmd(new_msgs, notify);
@@ -589,6 +600,9 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                case INC_EOF:
                        SET_PIXMAP_AND_TEXT(errorxpm, errorxpmmask, _("Error"));
                        break;
+               case INC_TIMEOUT:
+                       SET_PIXMAP_AND_TEXT(errorxpm, errorxpmmask, _("Timeout"));
+                       break;
                case INC_CANCEL:
                        SET_PIXMAP_AND_TEXT(okxpm, okxpmmask, _("Cancelled"));
                        break;
@@ -628,8 +642,6 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                }
                g_slist_free(msglist);
 
-               statusbar_pop_all();
-
                new_msgs += pop3_session->cur_total_num;
 
                if (pop3_session->error_val == PS_AUTHFAIL &&
@@ -742,6 +754,9 @@ static IncState inc_pop3_session_do(IncSession *session)
        progress_dialog_set_label(inc_dialog->dialog, buf);
        g_free(buf);
 
+       session_set_timeout(SESSION(pop3_session),
+                           prefs_common.io_timeout_secs * 1000);
+
        if (session_connect(SESSION(pop3_session), server, port) < 0) {
                log_warning(_("Can't connect to POP3 server: %s:%d\n"),
                            server, port);
@@ -763,20 +778,26 @@ static IncState inc_pop3_session_do(IncSession *session)
               session->inc_state != INC_CANCEL)
                gtk_main_iteration();
 
-       statusbar_pop_all();
-
        if (session->inc_state == INC_SUCCESS) {
                switch (pop3_session->error_val) {
                case PS_SUCCESS:
-                       if (SESSION(pop3_session)->state == SESSION_ERROR) {
+                       switch (SESSION(pop3_session)->state) {
+                       case SESSION_ERROR:
                                if (pop3_session->state == POP3_READY)
                                        session->inc_state = INC_CONNECT_ERROR;
                                else
                                        session->inc_state = INC_ERROR;
-                       } else if (SESSION(pop3_session)->state == SESSION_EOF)
+                               break;
+                       case SESSION_EOF:
                                session->inc_state = INC_EOF;
-                       else
+                               break;
+                       case SESSION_TIMEOUT:
+                               session->inc_state = INC_TIMEOUT;
+                               break;
+                       default:
                                session->inc_state = INC_SUCCESS;
+                               break;
+                       }
                        break;
                case PS_AUTHFAIL:
                        session->inc_state = INC_AUTH_FAILED;
@@ -796,6 +817,9 @@ static IncState inc_pop3_session_do(IncSession *session)
                }
        }
 
+       session_disconnect(SESSION(pop3_session));
+       statusbar_pop_all();
+
        return session->inc_state;
 }
 
@@ -913,11 +937,6 @@ static void inc_progress_dialog_set_progress(IncProgressDialog *inc_dialog,
        }
 }
 
-static gboolean hash_remove_func(gpointer key, gpointer value, gpointer data)
-{
-       return TRUE;
-}
-
 static void inc_progress_dialog_update_periodic(IncProgressDialog *inc_dialog,
                                                IncSession *inc_session)
 {
@@ -1026,7 +1045,6 @@ static gint inc_drop_message(Pop3Session *session, const gchar *file)
        FolderItem *dropfolder;
        IncSession *inc_session = (IncSession *)(SESSION(session)->data);
        gint msgnum;
-       gint val;
 
        g_return_val_if_fail(inc_session != NULL, -1);
 
@@ -1120,6 +1138,12 @@ static void inc_put_error(IncState istate, const gchar *msg)
                else
                        err_msg = g_strdup(log_msg);
                break;
+       case INC_TIMEOUT:
+               log_msg = _("Session timed out.");
+               if (prefs_common.no_recv_err_panel)
+                       break;
+               err_msg = g_strdup(log_msg);
+               break;
        default:
                break;
        }
index 1d46882..507b815 100644 (file)
--- a/src/inc.h
+++ b/src/inc.h
@@ -48,6 +48,7 @@ typedef enum
        INC_IO_ERROR,
        INC_SOCKET_ERROR,
        INC_EOF,
+       INC_TIMEOUT,
        INC_CANCEL
 } IncState;
 
index 1eddfb1..b67fa62 100644 (file)
@@ -76,6 +76,7 @@
 #include "mh_gtk.h"
 #include "imap_gtk.h"
 #include "news_gtk.h"
+#include "matcher.h"
 
 #if USE_GPGME
 #  include "sgpgme.h"
@@ -382,7 +383,6 @@ static void save_all_caches(FolderItem *item, gpointer data)
 static void exit_sylpheed(MainWindow *mainwin)
 {
        gchar *filename;
-       GList *list, *cur;
 
        debug_print("shutting down\n");
 
index d08aa0c..63a2143 100644 (file)
@@ -1016,14 +1016,6 @@ MainWindow *main_window_create(SeparateType type)
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
                                       prefs_common.show_statusbar);
        
-       gtk_widget_hide(GTK_WIDGET(mainwin->summaryview->hbox_search));
-       
-       if (prefs_common.show_searchbar) {
-               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mainwin->summaryview->toggle_search), TRUE);
-               if (prefs_common.summary_quicksearch_type != S_SEARCH_EXTENDED)
-                       gtk_widget_hide(summaryview->search_description);
-       }
-
        /* set account selection menu */
        ac_menu = gtk_item_factory_get_widget
                (ifactory, "/Configuration/Change current account");
@@ -1042,7 +1034,7 @@ MainWindow *main_window_create(SeparateType type)
                (GTK_WINDOW(win),                       \
                 gtk_item_factory_from_widget(menu)->accel_group)                
        
-       ADD_MENU_ACCEL_GROUP_TO_WINDOW(summaryview->popupmenu,mainwin->window);
+       ADD_MENU_ACCEL_GROUP_TO_WINDOW(summaryview->popupmenu, mainwin->window);
        
        /* connect the accelerators for equivalent 
           menu items in different menus             */
@@ -2111,10 +2103,6 @@ static void main_window_set_widgets(MainWindow *mainwin, SeparateType type)
        else 
                gtk_widget_hide(mainwin->messageview->mimeview->ctree_mainbox);
 
-       /* rehide quick search if necessary */
-       if (!prefs_common.show_searchbar)
-               gtk_widget_hide(mainwin->summaryview->hbox_search);
-       
        mainwin->type = type;
 
 
index 19c24b6..b0517b0 100644 (file)
@@ -360,7 +360,6 @@ void messageview_add_toolbar(MessageView *msgview, GtkWidget *window)
        GtkWidget *vbox;
        GtkWidget *menubar;
        GtkWidget *statusbar;
-       GtkItemFactory *ifactory;
        guint n_menu_entries;
 
        vbox = gtk_vbox_new(FALSE, 0);
@@ -754,8 +753,6 @@ void messageview_clear(MessageView *messageview)
 
 void messageview_destroy(MessageView *messageview)
 {
-       GtkWidget *mimeview  = GTK_WIDGET_PTR(messageview->mimeview);
-
        debug_print("destroy messageview\n");
        messageview_list = g_list_remove(messageview_list, messageview);
 
index 907904c..7dfda25 100644 (file)
@@ -183,10 +183,8 @@ static void delete_folder_cb(FolderView *folderview, guint action,
        }
 
        if (item->folder->klass->remove_folder(item->folder, item) < 0) {
+               folder_item_scan(item);
                alertpanel_error(_("Can't remove the folder `%s'."), name);
-               if (folderview->opened == folderview->selected)
-                       summary_show(folderview->summaryview,
-                                    folderview->summaryview->folder_item);
                g_free(old_id);
                return;
        }
@@ -295,8 +293,6 @@ static void update_tree_cb(FolderView *folderview, guint action,
 static void remove_mailbox_cb(FolderView *folderview, guint action,
                              GtkWidget *widget)
 {
-       GtkCTree *ctree = GTK_CTREE(folderview->ctree);
-       GtkCTreeNode *node;
        FolderItem *item;
        gchar *name;
        gchar *message;
index 01f4c7f..c665fb7 100644 (file)
@@ -682,6 +682,8 @@ static void check_signature_cb(GtkWidget *widget, gpointer user_data)
        
        privacy_mimeinfo_check_signature(mimeinfo);
        update_signature_noticeview(mimeview, mimeview->siginfo);
+       icon_list_clear(mimeview);
+       icon_list_create(mimeview, mimeview->mimeinfo);
 }
 
 static void display_full_info_cb(GtkWidget *widget, gpointer user_data)
@@ -1484,9 +1486,14 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
        GtkWidget *vbox;
        GtkWidget *button;
        gchar *tip;
+       gchar *tiptmp;
        const gchar *desc = NULL; 
+       gchar *sigshort = NULL;
        gchar *content_type;
        StockPixmap stockp;
+       MimeInfo *partinfo;
+       MimeInfo *siginfo = NULL;
+       MimeInfo *encrypted = NULL;
        
        vbox = mimeview->icon_vbox;
        mimeview->icon_count++;
@@ -1524,7 +1531,47 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
                break;
        }
        
-       pixmap = stock_pixmap_widget(mimeview->mainwin->window, stockp);
+       partinfo = mimeinfo;
+       while (partinfo != NULL) {
+               if (privacy_mimeinfo_is_signed(partinfo)) {
+                       siginfo = partinfo;
+                       break;
+               }
+               if (privacy_mimeinfo_is_encrypted(partinfo)) {
+                       encrypted = partinfo;
+                       break;
+               }
+               partinfo = procmime_mimeinfo_parent(partinfo);
+       }       
+
+       if (siginfo != NULL) {
+               switch (privacy_mimeinfo_get_sig_status(siginfo)) {
+               case SIGNATURE_UNCHECKED:
+               case SIGNATURE_CHECK_FAILED:
+                       pixmap = stock_pixmap_widget_with_overlay(mimeview->mainwin->window, stockp,
+                           STOCK_PIXMAP_PRIVACY_EMBLEM_SIGNED, OVERLAY_BOTTOM_RIGHT, 6, 3);
+                       break;
+               case SIGNATURE_OK:
+                       pixmap = stock_pixmap_widget_with_overlay(mimeview->mainwin->window, stockp,
+                           STOCK_PIXMAP_PRIVACY_EMBLEM_PASSED, OVERLAY_BOTTOM_RIGHT, 6, 3);
+                       break;
+               case SIGNATURE_WARN:
+                       pixmap = stock_pixmap_widget_with_overlay(mimeview->mainwin->window, stockp,
+                           STOCK_PIXMAP_PRIVACY_EMBLEM_WARN, OVERLAY_BOTTOM_RIGHT, 6, 3);
+                       break;
+               case SIGNATURE_INVALID:
+                       pixmap = stock_pixmap_widget_with_overlay(mimeview->mainwin->window, stockp,
+                           STOCK_PIXMAP_PRIVACY_EMBLEM_FAILED, OVERLAY_BOTTOM_RIGHT, 6, 3);
+                       break;
+               }
+               sigshort = privacy_mimeinfo_sig_info_short(siginfo);
+       } else if (encrypted != NULL) {
+                       pixmap = stock_pixmap_widget_with_overlay(mimeview->mainwin->window, stockp,
+                           STOCK_PIXMAP_PRIVACY_EMBLEM_ENCRYPTED, OVERLAY_BOTTOM_RIGHT, 6, 3);         
+       } else {
+               pixmap = stock_pixmap_widget_with_overlay(mimeview->mainwin->window, stockp, 0,
+                                                         OVERLAY_NONE, 6, 3);
+       }
        gtk_container_add(GTK_CONTAINER(button), pixmap);
        
        if (!desc) {
@@ -1537,14 +1584,20 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
        content_type = procmime_get_content_type_str(mimeinfo->type,
                                                     mimeinfo->subtype);
 
-       if (desc && *desc)
-               tip = g_strdup_printf("%s\n%s\n%s", desc, content_type, 
-                                     to_human_readable(mimeinfo->length));
-       else            
-               tip = g_strdup_printf("%s\n%s", content_type,
-                                     to_human_readable(mimeinfo->length));
-       
+       tip = g_strjoin("\n", content_type,
+                       to_human_readable(mimeinfo->length), NULL);
        g_free(content_type);
+       if (desc && *desc) {
+               tiptmp = g_strjoin("\n", desc, tip, NULL);
+               g_free(tip);
+               tip = tiptmp;
+       }
+       if (sigshort && *sigshort) {
+               tiptmp = g_strjoin("\n", tip, sigshort, NULL);
+               g_free(tip);
+               tip = tiptmp;
+       }
+       g_free(sigshort);
 
        gtk_tooltips_set_tip(mimeview->tooltips, button, tip, NULL);
        g_free(tip);
index f3ac878..b9651dc 100644 (file)
@@ -305,10 +305,10 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str)
 {
        gchar buf[BUFFSIZE];
        gint ret = 0;
-       gint32 len;
+       guint32 len;
 
        if (fread(&len, sizeof(len), 1, fp) == 1) {
-               if (len < 0)
+               if (len > G_MAXINT)
                        ret = -1;
                else {
                        gchar *tmp = NULL;
@@ -402,15 +402,14 @@ MsgCache *msgcache_read_cache(FolderItem *item, const gchar *cache_file)
                cache->memusage += procmsg_msginfo_memusage(msginfo);
        }
        fclose(fp);
+       g_hash_table_thaw(cache->msgnum_table);
 
        if(error) {
-               g_hash_table_thaw(cache->msgnum_table);
                msgcache_destroy(cache);
                return NULL;
        }
 
        cache->last_access = time(NULL);
-       g_hash_table_thaw(cache->msgnum_table);
 
        debug_print("done. (%d items read)\n", g_hash_table_size(cache->msgnum_table));
        debug_print("Cache size: %d messages, %d byte\n", g_hash_table_size(cache->msgnum_table), cache->memusage);
index 9ffd5e8..cddc540 100644 (file)
@@ -267,7 +267,7 @@ static NNTPSession *news_session_get(Folder *folder)
                return NNTP_SESSION(rfolder->session);
        }
 
-       if (time(NULL) - rfolder->session->last_access_time < SESSION_TIMEOUT) {
+       if (time(NULL) - rfolder->session->last_access_time < SESSION_TIMEOUT_INTERVAL) {
                rfolder->session->last_access_time = time(NULL);
                return NNTP_SESSION(rfolder->session);
        }
index 4fb4660..98f0a26 100644 (file)
@@ -169,5 +169,5 @@ void noticeview_set_icon(NoticeView *noticeview, StockPixmap icon)
        if (stock_pixmap_gdk(noticeview->window, icon, &pixmap, &bitmap) < 0)
                return;
        
-       gtk_pixmap_set(GTK_PIXMAP(noticeview->icon), pixmap, bitmap);
+       gtk_image_set_from_pixmap(GTK_IMAGE(noticeview->icon), pixmap, bitmap);
 }
index b6f5cda..7b18576 100644 (file)
@@ -110,7 +110,7 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
 
                pixbuf_scaled = gdk_pixbuf_scale_simple
                        (pixbuf, new_width, new_height, GDK_INTERP_BILINEAR);
-               gdk_pixbuf_unref(pixbuf);
+               g_object_unref(pixbuf);
                pixbuf = pixbuf_scaled;
        }
 
@@ -123,11 +123,11 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
                        (GTK_SCROLLED_WINDOW(imageviewer->scrolledwin),
                         imageviewer->image);
        } else
-               gtk_pixmap_set(GTK_PIXMAP(imageviewer->image), pixmap, mask);
+               gtk_image_set_from_pixmap(GTK_IMAGE(imageviewer->image), pixmap, mask);
 
        gtk_widget_show(imageviewer->image);
 
-       gdk_pixbuf_unref(pixbuf);
+       g_object_unref(pixbuf);
 }
 #else
 #if HAVE_GDK_IMLIB
@@ -164,14 +164,14 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
        gdk_imlib_render(im, new_width, new_height);
 
        if (!imageviewer->image) {
-               imageviewer->image = gtk_pixmap_new(gdk_imlib_move_image(im),
-                                                   gdk_imlib_move_mask(im));
+               imageviewer->image = gtk_image_new_from_pixmap(gdk_imlib_move_image(im),
+                                                              gdk_imlib_move_mask(im));
 
                gtk_scrolled_window_add_with_viewport
                        (GTK_SCROLLED_WINDOW(imageviewer->scrolledwin),
                         imageviewer->image);
        } else
-               gtk_pixmap_set(GTK_PIXMAP(imageviewer->image),
+               gtk_image_set_from_pixmap(GTK_IMAGE(imageviewer->image),
                               gdk_imlib_move_image(im),
                               gdk_imlib_move_mask(im));      
 
@@ -239,7 +239,7 @@ static void image_viewer_clear_viewer(MimeViewer *_mimeviewer)
        image_viewer_set_notebook_page(_mimeviewer);
 
        if (imageviewer->image != NULL)
-               gtk_pixmap_set(GTK_PIXMAP(imageviewer->image), NULL, NULL);
+               gtk_image_set_from_pixmap(GTK_IMAGE(imageviewer->image), NULL, NULL);
        hadj = gtk_scrolled_window_get_hadjustment
                (GTK_SCROLLED_WINDOW(imageviewer->scrolledwin));
        gtk_adjustment_set_value(hadj, 0.0);
@@ -260,7 +260,7 @@ static void image_viewer_destroy_viewer(MimeViewer *_mimeviewer)
        debug_print("image_viewer_destroy_viewer\n");
 
        image_viewer_clear_viewer(_mimeviewer);
-       gtk_widget_unref(imageviewer->notebook);
+       g_object_unref(imageviewer->notebook);
        g_free(imageviewer);
 }
 
index 571aeee..e922340 100644 (file)
@@ -197,10 +197,17 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                running |= TIMEOUT_RUNNING;
 
                while(running & CHILD_RUNNING) {
-                       waitpid(pid, &status, WNOHANG);
-                       if (WIFEXITED(status)) {
+                       int ret;
+
+                       ret = waitpid(pid, &status, WNOHANG);
+                       if (ret == pid) {
+                               if (WIFEXITED(status)) {
+                                       running &= ~CHILD_RUNNING;
+                                       is_spam = WEXITSTATUS(status) == 1 ? TRUE : FALSE;
+                               }
+                       } if (ret < 0) {
                                running &= ~CHILD_RUNNING;
-                       }
+                       } /* ret == 0 continue */
            
                        g_main_iteration(TRUE);
                }
@@ -208,7 +215,6 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                while (running & TIMEOUT_RUNNING)
                        g_main_iteration(TRUE);
        }
-        is_spam = WEXITSTATUS(status) == 1 ? TRUE : FALSE;
 
        fclose(fp);
 
index a64669d..edddd1c 100644 (file)
@@ -87,7 +87,7 @@ static void set_trayicon_pixmap(TrayIconType icontype)
                break;
        }
 
-       gtk_pixmap_set(GTK_PIXMAP(image), pixmap, bitmap);
+       gtk_image_set_from_pixmap(GTK_IMAGE(image), pixmap, bitmap);
        gtk_widget_shape_combine_mask(GTK_WIDGET(trayicon), bitmap, GTK_WIDGET(image)->allocation.x, GTK_WIDGET(image)->allocation.y);
 }
 
@@ -166,10 +166,10 @@ static void create_trayicon()
         gtk_container_add(GTK_CONTAINER(eventbox), GTK_WIDGET(packer));
         gtk_container_set_border_width(GTK_CONTAINER(packer), 0);
 
-        image = gtk_pixmap_new(nomail_pixmap, nomail_bitmap);
+        image = gtk_image_new_from_pixmap(nomail_pixmap, nomail_bitmap);
         gtk_packer_add_defaults(GTK_PACKER(packer), GTK_WIDGET(image), GTK_SIDE_TOP, GTK_ANCHOR_CENTER, GTK_PACK_EXPAND);
 #else
-        image = gtk_pixmap_new(nomail_pixmap, nomail_bitmap);
+        image = gtk_image_new_from_pixmap(nomail_pixmap, nomail_bitmap);
         gtk_container_add(GTK_CONTAINER(eventbox), image);
 #endif
 
index 942cf9a..248e241 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -419,6 +419,7 @@ Session *pop3_session_new(PrefsAccount *account)
 
        session->state = POP3_READY;
        session->ac_prefs = account;
+       session->pop_before_smtp = FALSE;
        session->uidl_table = pop3_get_uidl_table(account);
        session->current_time = time(NULL);
        session->error_val = PS_SUCCESS;
@@ -758,7 +759,10 @@ static gint pop3_session_recv_msg(Session *session, const gchar *msg)
                break;
        case POP3_GETAUTH_PASS:
        case POP3_GETAUTH_APOP:
-               pop3_getrange_stat_send(pop3_session);
+               if (!pop3_session->pop_before_smtp)
+                       pop3_getrange_stat_send(pop3_session);
+               else
+                       pop3_logout_send(pop3_session);
                break;
        case POP3_GETRANGE_STAT:
                if (pop3_getrange_stat_recv(pop3_session, body) < 0)
index bf62212..63655d4 100644 (file)
--- a/src/pop.h
+++ b/src/pop.h
@@ -87,12 +87,6 @@ typedef enum {
 
        /* leave space for more codes */
 
-       PS_UNDEFINED    = 23,   /* something I hadn't thought of */
-       PS_TRANSIENT    = 24,   /* transient failure (internal use) */
-       PS_REFUSED      = 25,   /* mail refused (internal use) */
-       PS_RETAINED     = 26,   /* message retained (internal use) */
-       PS_TRUNCATED    = 27,   /* headers incomplete (internal use) */
-
        PS_CONTINUE     = 128   /* more responses may follow */
 } Pop3ErrorValue;
 
@@ -119,6 +113,7 @@ struct _Pop3Session
        gchar *prev_folder;
 
        PrefsAccount *ac_prefs;
+       gboolean pop_before_smtp;
 
        gchar *greeting;
        gchar *user;
index ac3e3a6..6fc08a1 100644 (file)
@@ -740,7 +740,7 @@ static PrefParam param[] = {
         P_BOOL, &other.checkbtn_addaddrbyclick,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
-       {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
+       {"confirm_on_exit", "FALSE", &prefs_common.confirm_on_exit, P_BOOL,
         &other.checkbtn_confonexit,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
index d2a7e1b..a816f29 100644 (file)
@@ -369,7 +369,6 @@ static void prefs_themes_free_names(ThemesData *tdata)
 void prefs_themes_done(void)
 {
        ThemesData *tdata = prefs_themes_data;
-       GList      *n;
 
        debug_print("Finished prefereces for themes.\n");
        
@@ -448,7 +447,6 @@ static void prefs_themes_btn_remove_clicked_cb(GtkWidget *widget, gpointer data)
 
 static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data)
 {
-       struct stat s;
        gchar      *filename, *source;
        gchar      *themeinfo, *themename;
        gchar      *alert_title = NULL;
@@ -592,7 +590,7 @@ static void prefs_themes_display_theme_info(ThemesData *tdata, const ThemeInfo *
        for (i = 0; i < PREVIEW_ICONS; ++i) {
                stock_pixmap_gdk(theme->window, prefs_themes_icons[i], 
                                &(theme->pixmaps[i]), &(theme->masks[i]));
-               gtk_pixmap_set(GTK_PIXMAP(theme->icons[i]),
+               gtk_image_set_from_pixmap(GTK_IMAGE(theme->icons[i]),
                                theme->pixmaps[i], theme->masks[i]);
        }
        prefs_common.pixmap_theme_path = save_prefs_path;
@@ -740,9 +738,9 @@ static GtkWidget* create_dummy_pixmap(GtkWidget *widget)
                        NULL, dummy_pixmap_xpm);
        if (gdkpixmap == NULL)
                g_error ("Couldn't create replacement pixmap.");
-       pixmap = gtk_pixmap_new (gdkpixmap, mask);
-       gdk_pixmap_unref (gdkpixmap);
-       gdk_bitmap_unref (mask);
+       pixmap = gtk_image_new_from_pixmap(gdkpixmap, mask);
+       g_object_unref (gdkpixmap);
+       g_object_unref (mask);
        return pixmap;
 }
 /* END GLADE CODE */
index 28a6b8f..89cd19c 100644 (file)
@@ -579,9 +579,6 @@ static MsgInfo *parse_stream(void *data, gboolean isstring, MsgFlags flags,
        else 
                MSG_SET_PERM_FLAGS(msginfo->flags, MSG_NEW | MSG_UNREAD);
        
-       if (decrypted)
-               MSG_UNSET_TMP_FLAGS(msginfo->flags, MSG_MIME);
-
        msginfo->inreplyto = NULL;
 
        while ((hnum = get_one_field(buf, sizeof(buf), data, hentry))
@@ -658,27 +655,8 @@ static MsgInfo *parse_stream(void *data, gboolean isstring, MsgFlags flags,
                        }
                        break;
                case H_CONTENT_TYPE:
-                       if (decrypted) {
-                               if (!strncasecmp(hp, "multipart", 9)) {
-                                       if (strncasecmp(hp, "multipart/signed", 16)) {
-                                               MSG_SET_TMP_FLAGS(msginfo->flags,
-                                                         MSG_MIME);
-                                       } else {
-                                               MSG_SET_TMP_FLAGS(msginfo->flags,
-                                                         MSG_SIGNED);
-                                       }
-                               }
-                       }
-                       else if (!strncasecmp(hp, "multipart/encrypted", 19)) {
-                               MSG_SET_TMP_FLAGS(msginfo->flags,
-                                                 MSG_ENCRYPTED);
-                       } 
-                       else if (!strncasecmp(hp, "multipart", 9) &&
-                                  !strncasecmp(hp, "multipart/signed", 16)) {
-                               MSG_SET_TMP_FLAGS(msginfo->flags, MSG_SIGNED);
-                       } 
-                       else if (!strncasecmp(hp, "multipart", 9))
-                               MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MIME);
+                       if (!strncasecmp(hp, "multipart/", 10))
+                               MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MULTIPART);
                        break;
 #ifdef ALLOW_HEADER_HINT                       
                case H_SEEN:
index 058f135..76a07b0 100644 (file)
@@ -987,7 +987,7 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo)
                                {NULL,             NULL, FALSE}};
        guint content_start, i;
        FILE *fp;
-       gint mime_major, mime_minor, a;
+       gint mime_major, mime_minor;
 
        if (mimeinfo->encoding_type != ENC_BINARY && 
           mimeinfo->encoding_type != ENC_7BIT && 
index 417f6b3..62e15ff 100644 (file)
@@ -91,12 +91,13 @@ typedef guint32 MsgPermFlags;
 #define MSG_IMAP               (1U << 19)
 #define MSG_NEWS               (1U << 20)
 #define MSG_SIGNED             (1U << 21)
-#define MSG_MIME               (1U << 29)
+#define MSG_MULTIPART          (1U << 29)
+#define MSG_HAS_ATTACHMENT     (1U << 30)
 #define MSG_CACHED             (1U << 31)
 
 typedef guint32 MsgTmpFlags;
 
-#define MSG_CACHED_FLAG_MASK   (MSG_MIME | MSG_ENCRYPTED | MSG_SIGNED)
+#define MSG_CACHED_FLAG_MASK   (MSG_MULTIPART | MSG_ENCRYPTED | MSG_SIGNED)
 
 #define MSG_SET_FLAGS(msg, flags)      { (msg) |= (flags); }
 #define MSG_UNSET_FLAGS(msg, flags)    { (msg) &= ~(flags); }
@@ -134,7 +135,8 @@ typedef guint32 MsgTmpFlags;
 #define MSG_IS_SIGNED(msg)             (((msg).tmp_flags & MSG_SIGNED) != 0)
 #define MSG_IS_IMAP(msg)               (((msg).tmp_flags & MSG_IMAP) != 0)
 #define MSG_IS_NEWS(msg)               (((msg).tmp_flags & MSG_NEWS) != 0)
-#define MSG_IS_MIME(msg)               (((msg).tmp_flags & MSG_MIME) != 0)
+#define MSG_IS_MULTIPART(msg)          (((msg).tmp_flags & MSG_MULTIPART) != 0)
+#define MSG_IS_WITH_ATTACHMENT(msg)    (((msg).tmp_flags & MSG_HAS_ATTACHMENT) != 0)
 #define MSG_IS_CACHED(msg)             (((msg).tmp_flags & MSG_CACHED) != 0)
 
 /* Claws related flags */
@@ -280,10 +282,10 @@ gint procmsg_send_message_queue           (const gchar *file);
 
 void procmsg_msginfo_set_flags         (MsgInfo *msginfo,
                                         MsgPermFlags perm_flags,
-                                         MsgTmpFlags tmp_flags);
+                                        MsgTmpFlags tmp_flags);
 void procmsg_msginfo_unset_flags       (MsgInfo *msginfo,
                                         MsgPermFlags perm_flags,
-                                         MsgTmpFlags tmp_flags);
+                                        MsgTmpFlags tmp_flags);
 gint procmsg_remove_special_headers    (const gchar    *in, 
                                         const gchar    *out);
 
index 4d352bd..17e3957 100644 (file)
@@ -12,6 +12,6 @@ void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
 gint quote_fmtparse(void);
 void quote_fmt_scan_string(const gchar *str);
 
-gint quote_fmtparse_get_cursor_pos(void);
+gint quote_fmt_get_cursor_pos(void);
 
 #endif /* __QUOTE_FMT_H__ */
index 8b67811..0532f15 100644 (file)
@@ -414,6 +414,7 @@ gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp)
                ret = -1;
        } else if (session->state == SESSION_ERROR ||
                   session->state == SESSION_EOF ||
+                  session->state == SESSION_TIMEOUT ||
                   SMTP_SESSION(session)->state == SMTP_ERROR ||
                   SMTP_SESSION(session)->error_val != SM_OK)
                ret = -1;
@@ -594,13 +595,22 @@ static void send_put_error(Session *session)
                        err_msg = g_strdup(log_msg);
                break;
        default:
-               if (session->state == SESSION_ERROR) {
+               switch (session->state) {
+               case SESSION_ERROR:
                        log_msg =
                                _("Error occurred while sending the message.");
                        err_msg = g_strdup(log_msg);
-               } else if (session->state == SESSION_EOF) {
+                       break;
+               case SESSION_EOF:
                        log_msg = _("Connection closed by the remote host.");
                        err_msg = g_strdup(log_msg);
+                       break;
+               case SESSION_TIMEOUT:
+                       log_msg = _("Session timed out.");
+                       err_msg = g_strdup(log_msg);
+                       break;
+               default:
+                       break;
                }
                break;
        }
index 3905cbf..1303ff9 100644 (file)
 #include "pixmaps/privacy_unknown.xpm"
 #include "pixmaps/privacy_expired.xpm"
 #include "pixmaps/privacy_warn.xpm"                 
+#include "pixmaps/privacy_emblem_encrypted.xpm"
+#include "pixmaps/privacy_emblem_signed.xpm"
+#include "pixmaps/privacy_emblem_passed.xpm"
+#include "pixmaps/privacy_emblem_failed.xpm"
+#include "pixmaps/privacy_emblem_warn.xpm"
 #include "pixmaps/mime_message.xpm"                  
 #include "pixmaps/address_search.xpm"
 #include "pixmaps/check_spelling.xpm"
@@ -122,6 +127,23 @@ struct _StockPixmapData
        gchar *icon_path;
 };
 
+typedef struct _OverlayData OverlayData;
+
+struct _OverlayData
+{
+       GdkPixmap *base_pixmap;
+       GdkBitmap *base_mask;
+       GdkPixmap *overlay_pixmap;
+       GdkBitmap *overlay_mask;
+       guint base_height;
+       guint base_width;
+       guint overlay_height;
+       guint overlay_width;
+       OverlayPosition position;
+       gint border_x;
+       gint border_y;
+};
+
 static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname);
 
 static StockPixmapData pixmaps[] =
@@ -219,6 +241,11 @@ static StockPixmapData pixmaps[] =
        {privacy_unknown_xpm                    , NULL, NULL, "privacy_unknown", NULL},
        {privacy_expired_xpm                    , NULL, NULL, "privacy_expired", NULL},
        {privacy_warn_xpm                       , NULL, NULL, "privacy_warn", NULL},
+       {privacy_emblem_encrypted_xpm           , NULL, NULL, "privacy_emblem_encrypted", NULL},
+       {privacy_emblem_signed_xpm              , NULL, NULL, "privacy_emblem_signed", NULL},
+       {privacy_emblem_passed_xpm              , NULL, NULL, "privacy_emblem_passed", NULL},
+       {privacy_emblem_failed_xpm              , NULL, NULL, "privacy_emblem_failed", NULL},   
+       {privacy_emblem_warn_xpm                , NULL, NULL, "privacy_emblem_warn", NULL},
        {mime_message_xpm                       , NULL, NULL, "mime_message", NULL},
        {sylpheed_logo_xpm                      , NULL, NULL, "sylpheed_logo", NULL},
 };
@@ -387,3 +414,168 @@ StockPixmap stock_pixmap_get_icon (gchar *file)
        }
        return -1;
 }
+
+static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventExpose *expose,
+                                                   OverlayData *data) 
+{
+       GdkDrawable *drawable = widget->window; 
+       GdkGC *gc_pix;
+       gint left;
+       gint top;
+
+       g_return_val_if_fail(data->base_pixmap != NULL, FALSE);
+       g_return_val_if_fail(data->base_mask != NULL, FALSE);
+
+       gc_pix = gdk_gc_new((GdkWindow *)drawable);
+                                                
+       gdk_window_clear_area (drawable, expose->area.x, expose->area.y,
+                              expose->area.width, expose->area.height);
+
+       gdk_gc_set_tile(gc_pix, data->base_pixmap);
+       gdk_gc_set_ts_origin(gc_pix, data->border_x, data->border_y);
+       gdk_gc_set_clip_mask(gc_pix, data->base_mask);
+       gdk_gc_set_clip_origin(gc_pix, data->border_x, data->border_y);
+       gdk_gc_set_fill(gc_pix, GDK_TILED);
+
+       gdk_draw_rectangle(drawable, gc_pix, TRUE, data->border_x, data->border_y, 
+                          data->base_width, data->base_height);
+
+       if (data->position != OVERLAY_NONE) {
+               g_return_val_if_fail(data->overlay_pixmap != NULL, FALSE);
+               g_return_val_if_fail(data->overlay_mask != NULL, FALSE);
+
+               gdk_gc_set_tile(gc_pix, data->overlay_pixmap);
+               gdk_gc_set_clip_mask(gc_pix, data->overlay_mask);
+
+               switch (data->position) {
+                       case OVERLAY_TOP_LEFT:
+                       case OVERLAY_MID_LEFT:
+                       case OVERLAY_BOTTOM_LEFT:
+                               left = 0;
+                               break;
+
+                       case OVERLAY_TOP_CENTER:
+                       case OVERLAY_MID_CENTER:
+                       case OVERLAY_BOTTOM_CENTER:
+                               left = (data->base_width + data->border_x * 2  - data->overlay_width)/2;
+                               break;
+
+                       case OVERLAY_TOP_RIGHT:
+                       case OVERLAY_MID_RIGHT:
+                       case OVERLAY_BOTTOM_RIGHT:
+                               left = data->base_width + data->border_x * 2 - data->overlay_width;
+                               break;
+
+                       default:
+                               break;
+               }
+               switch (data->position) {
+                       case OVERLAY_TOP_LEFT:
+                       case OVERLAY_TOP_CENTER:
+                       case OVERLAY_TOP_RIGHT:
+                               top = 0;
+                               break;
+
+                       case OVERLAY_MID_LEFT:
+                       case OVERLAY_MID_CENTER:
+                       case OVERLAY_MID_RIGHT:
+                               top = (data->base_height + data->border_y * 2  - data->overlay_height)/2;
+                               break;
+                                       
+                       case OVERLAY_BOTTOM_LEFT:
+                       case OVERLAY_BOTTOM_CENTER:
+                       case OVERLAY_BOTTOM_RIGHT:
+                               top = data->base_height + data->border_y * 2 - data->overlay_height;
+                               break;
+
+                       default:
+                               break;
+               }
+
+               gdk_gc_set_ts_origin(gc_pix, left, top);
+               gdk_gc_set_clip_origin(gc_pix, left, top);
+               gdk_gc_set_fill(gc_pix, GDK_TILED);
+               gdk_draw_rectangle(drawable, gc_pix, TRUE, left, top, 
+                                  data->overlay_width, data->overlay_height);
+       }
+       gdk_gc_destroy(gc_pix);
+       
+       return TRUE;
+}
+
+static void pixmap_with_overlay_destroy_cb(GtkObject *object, OverlayData *data) 
+{
+       g_object_unref(data->base_pixmap);
+       g_object_unref(data->base_mask);
+       if (data->position != OVERLAY_NONE) {
+               g_object_unref(data->overlay_pixmap);
+               g_object_unref(data->overlay_mask);
+       }
+       g_free(data);
+}
+
+/**
+ * \brief Get a widget showing one icon with another overlaid on top of it.
+ *
+ * The base icon is always centralised, the other icon can be positioned.
+ * The overlay icon is ignored if pos=OVERLAY_NONE is used
+ *
+ * \param window   top-level window widget
+ * \param icon    the base icon
+ * \param overlay  the icon to overlay
+ * \param pos      how to align the overlay widget, or OVERLAY_NONE for no overlay
+ * \param border_x size of the border around the base icon (left and right)
+ * \param border_y size of the border around the base icon (top and bottom)
+ */
+GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
+                                           StockPixmap overlay, OverlayPosition pos,
+                                           gint border_x, gint border_y)
+{
+       GdkPixmap *stock_pixmap;
+       GdkBitmap *stock_mask;
+       GtkWidget *widget;
+       GtkWidget *stock_wid;
+       OverlayData *data;
+       
+       data = g_new0(OverlayData, 1);
+
+       stock_wid = stock_pixmap_widget(window, icon);
+       gtk_image_get_pixmap(GTK_IMAGE(stock_wid), &stock_pixmap, &stock_mask);
+       g_object_ref(stock_pixmap);
+       g_object_ref(stock_mask);
+       data->base_pixmap = stock_pixmap;
+       data->base_mask   = stock_mask;
+       data->base_height = stock_wid->requisition.height;
+       data->base_width  = stock_wid->requisition.width;
+       gtk_widget_destroy(stock_wid);
+
+       if (pos == OVERLAY_NONE) {
+               data->overlay_pixmap = NULL;
+               data->overlay_mask   = NULL;
+       } else {
+               stock_wid = stock_pixmap_widget(window, overlay);
+               gtk_image_get_pixmap(GTK_IMAGE(stock_wid), &stock_pixmap, &stock_mask);
+               g_object_ref(stock_pixmap);
+               g_object_ref(stock_mask);
+               data->overlay_pixmap = stock_pixmap;
+               data->overlay_mask   = stock_mask;
+               data->overlay_height = stock_wid->requisition.height;
+               data->overlay_width  = stock_wid->requisition.width;
+
+               gtk_widget_destroy(stock_wid);
+       }
+       
+       data->position = pos;
+       data->border_x = border_x;
+       data->border_y = border_y;
+
+       widget = gtk_drawing_area_new();
+       gtk_drawing_area_size(GTK_DRAWING_AREA(widget), data->base_width + border_x * 2, 
+                             data->base_height + border_y * 2);
+       g_signal_connect(G_OBJECT(widget), "expose_event", 
+                        G_CALLBACK(pixmap_with_overlay_expose_event_cb), data);
+       g_signal_connect(G_OBJECT(widget), "destroy",
+                        G_CALLBACK(pixmap_with_overlay_destroy_cb), data);
+       return widget;
+
+}
index 7feafdd..712a343 100644 (file)
@@ -118,6 +118,11 @@ typedef enum
        STOCK_PIXMAP_PRIVACY_UNKNOWN,
        STOCK_PIXMAP_PRIVACY_EXPIRED,
        STOCK_PIXMAP_PRIVACY_WARN,
+       STOCK_PIXMAP_PRIVACY_EMBLEM_ENCRYPTED,
+       STOCK_PIXMAP_PRIVACY_EMBLEM_SIGNED,
+       STOCK_PIXMAP_PRIVACY_EMBLEM_PASSED,
+       STOCK_PIXMAP_PRIVACY_EMBLEM_FAILED,
+       STOCK_PIXMAP_PRIVACY_EMBLEM_WARN,
        STOCK_PIXMAP_MIME_MESSAGE,
        
        STOCK_PIXMAP_SYLPHEED_LOGO,             /* last entry */
@@ -125,6 +130,19 @@ typedef enum
        N_STOCK_PIXMAPS
 } StockPixmap;
 
+typedef enum {
+       OVERLAY_NONE,
+       OVERLAY_TOP_LEFT,
+       OVERLAY_TOP_CENTER,
+       OVERLAY_TOP_RIGHT,
+       OVERLAY_MID_LEFT,
+       OVERLAY_MID_CENTER,
+       OVERLAY_MID_RIGHT,
+       OVERLAY_BOTTOM_LEFT,
+       OVERLAY_BOTTOM_CENTER,
+       OVERLAY_BOTTOM_RIGHT
+} OverlayPosition;
+
 GtkWidget *stock_pixmap_widget (GtkWidget       *window,
                                 StockPixmap      icon);
 gint stock_pixmap_gdk          (GtkWidget       *window,
@@ -136,5 +154,11 @@ GList *stock_pixmap_themes_list_new        (void);
 void stock_pixmap_themes_list_free     (GList *list);
 gchar *stock_pixmap_get_name         (StockPixmap icon);
 StockPixmap stock_pixmap_get_icon    (gchar *file);
+GtkWidget *stock_pixmap_widget_with_overlay (GtkWidget         *window,
+                                            StockPixmap         icon,
+                                            StockPixmap         overlay,
+                                            OverlayPosition     pos,
+                                            gint                border_x,
+                                            gint                border_y);
 
 #endif /* __STOCK_PIXMAP_H__ */
index f4c93eb..15b4677 100644 (file)
 #include "string_match.h"
 #include "toolbar.h"
 #include "news.h"
-#include "matcher.h"
-#include "matcher_parser.h"
 #include "hooks.h"
 #include "description_window.h"
 #include "folderutils.h"
+#include "quicksearch.h"
 
 #define SUMMARY_COL_MARK_WIDTH         10
 #define SUMMARY_COL_STATUS_WIDTH       13
@@ -258,15 +257,6 @@ static gboolean summary_button_released    (GtkWidget              *ctree,
 static gboolean summary_key_pressed    (GtkWidget              *ctree,
                                         GdkEventKey            *event,
                                         SummaryView            *summaryview);
-static gboolean summary_searchbar_pressed
-                                       (GtkWidget              *ctree,
-                                        GdkEventKey            *event,
-                                        SummaryView            *summaryview);
-static gboolean summary_searchbar_focus_evt    (GtkWidget              *ctree,
-                                                GdkEventFocus          *event,
-                                                SummaryView            *summaryview);
-static void summary_searchtype_changed (GtkMenuItem            *widget, 
-                                        gpointer                data);
 static void summary_open_row           (GtkSCTree              *sctree,
                                         SummaryView            *summaryview);
 static void summary_tree_expanded      (GtkCTree               *ctree,
@@ -379,6 +369,8 @@ static gint summary_cmp_by_locked   (GtkCList               *clist,
 
 static void news_flag_crosspost                (MsgInfo *msginfo);
 
+static void quicksearch_execute_cb     (QuickSearch    *quicksearch,
+                                        gpointer        data);
 static void tog_searchbar_cb           (GtkWidget      *w,
                                         gpointer        data);
 
@@ -467,66 +459,6 @@ static const gchar *const col_label[N_SUMMARY_COLS] = {
        N_("L")         /* S_COL_LOCKED  */
 };
 
-/*
- * Strings describing how to use Extended Search
- * 
- * When adding new lines, remember to put 2 strings for each line
- */
-static gchar *search_descr_strings[] = {
-       "a",     N_("all messages"),
-       "ag #",  N_("messages whose age is greater than #"),
-       "al #",  N_("messages whose age is less than #"),
-       "b S",   N_("messages which contain S in the message body"),
-       "B S",   N_("messages which contain S in the whole message"),
-       "c S",   N_("messages carbon-copied to S"),
-       "C S",   N_("message is either to: or cc: to S"),
-       "D",     N_("deleted messages"), /** how I can filter deleted messages **/
-       "e S",   N_("messages which contain S in the Sender field"),
-       "E S",   N_("true if execute \"S\" succeeds"),
-       "f S",   N_("messages originating from user S"),
-       "F",     N_("forwarded messages"),
-       "h S",   N_("messages which contain header S"),
-       "i S",   N_("messages which contain S in Message-Id header"),
-       "I S",   N_("messages which contain S in inreplyto header"),
-       "L",     N_("locked messages"),
-       "n S",   N_("messages which are in newsgroup S"),
-       "N",     N_("new messages"),
-       "O",     N_("old messages"),
-       "r",     N_("messages which have been replied to"),
-       "R",     N_("read messages"),
-       "s S",   N_("messages which contain S in subject"),
-       "se #",  N_("messages whose score is equal to #"),
-       "sg #",  N_("messages whose score is greater than #"),
-       "sl #",  N_("messages whose score is lower than #"),
-       "Se #",  N_("messages whose size is equal to #"),
-       "Sg #",  N_("messages whose size is greater than #"),
-       "Ss #",  N_("messages whose size is smaller than #"),
-       "t S",   N_("messages which have been sent to S"),
-       "T",     N_("marked messages"),
-       "U",     N_("unread messages"),
-       "x S",   N_("messages which contain S in References header"),
-       "X cmd", N_("messages returning 0 when passed to command"),
-       "y S",   N_("messages which contain S in X-Label header"),
-        "",     "" ,
-       "&",     N_("logical AND operator"),
-       "|",     N_("logical OR operator"),
-       "! or ~",       N_("logical NOT operator"),
-       "%",     N_("case sensitive search"),
-       NULL,    NULL 
-};
-static DescriptionWindow search_descr = {
-       NULL, 
-       2,
-       N_("Extended Search symbols"),
-       search_descr_strings
-};
-       
-static void search_description_cb(GtkWidget *widget)
-{
-       description_window_create(&search_descr);
-};
-
 SummaryView *summary_create(void)
 {
        SummaryView *summaryview;
@@ -535,7 +467,6 @@ SummaryView *summary_create(void)
        GtkWidget *ctree;
        GtkWidget *hbox;
        GtkWidget *hbox_l;
-       GtkWidget *hbox_search;
        GtkWidget *statlabel_folder;
        GtkWidget *statlabel_select;
        GtkWidget *statlabel_msgs;
@@ -543,16 +474,11 @@ SummaryView *summary_create(void)
        GtkWidget *toggle_eventbox;
        GtkWidget *toggle_arrow;
        GtkWidget *popupmenu;
-       GtkWidget *search_type_opt;
-       GtkWidget *search_type;
-       GtkWidget *search_string;
-       GtkWidget *search_hbbox;
-       GtkWidget *search_description;
-       GtkWidget *menuitem;
        GtkWidget *toggle_search;
        GtkTooltips *search_tip;
        GtkItemFactory *popupfactory;
        gint n_entries;
+       QuickSearch *quicksearch;
 
        debug_print("Creating summary view...\n");
        summaryview = g_new0(SummaryView, 1);
@@ -562,9 +488,13 @@ SummaryView *summary_create(void)
        
        /* create status label */
        hbox = gtk_hbox_new(FALSE, 0);
-       
+       gtk_widget_show(hbox);
+
        search_tip = gtk_tooltips_new();
        toggle_search = gtk_toggle_button_new();
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_search),
+                                    prefs_common.show_searchbar);
+       gtk_widget_show(toggle_search);
 
        gtk_tooltips_set_tip(GTK_TOOLTIPS(search_tip),
                             toggle_search,
@@ -573,17 +503,22 @@ SummaryView *summary_create(void)
        gtk_box_pack_start(GTK_BOX(hbox), toggle_search, FALSE, FALSE, 2);      
 
        hbox_l = gtk_hbox_new(FALSE, 0);
+       gtk_widget_show(hbox_l);
        gtk_box_pack_start(GTK_BOX(hbox), hbox_l, TRUE, TRUE, 0);
  
        statlabel_folder = gtk_label_new("");
+       gtk_widget_show(statlabel_folder);
        gtk_box_pack_start(GTK_BOX(hbox_l), statlabel_folder, FALSE, FALSE, 2);
        statlabel_select = gtk_label_new("");
+       gtk_widget_show(statlabel_select);
        gtk_box_pack_start(GTK_BOX(hbox_l), statlabel_select, FALSE, FALSE, 12);
  
        /* toggle view button */
        toggle_eventbox = gtk_event_box_new();
+       gtk_widget_show(toggle_eventbox);
        gtk_box_pack_end(GTK_BOX(hbox), toggle_eventbox, FALSE, FALSE, 4);
        toggle_arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_OUT);
+       gtk_widget_show(toggle_arrow);
        gtk_container_add(GTK_CONTAINER(toggle_eventbox), toggle_arrow);
        g_signal_connect(G_OBJECT(toggle_eventbox), "button_press_event",
                         G_CALLBACK(summary_toggle_pressed),
@@ -591,12 +526,15 @@ SummaryView *summary_create(void)
        
        
        statlabel_msgs = gtk_label_new("");
+       gtk_widget_show(statlabel_msgs);
        gtk_box_pack_end(GTK_BOX(hbox), statlabel_msgs, FALSE, FALSE, 4);
 
        hbox_spc = gtk_hbox_new(FALSE, 0);
+       gtk_widget_show(hbox_spc);
        gtk_box_pack_end(GTK_BOX(hbox), hbox_spc, FALSE, FALSE, 6);
 
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
+       gtk_widget_show(scrolledwin);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
                                       GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_ALWAYS);
@@ -606,6 +544,7 @@ SummaryView *summary_create(void)
                             prefs_common.summaryview_height);
 
        ctree = summary_ctree_create(summaryview);
+       gtk_widget_show(ctree);
 
        gtk_scrolled_window_set_hadjustment(GTK_SCROLLED_WINDOW(scrolledwin),
                                            GTK_CLIST(ctree)->hadjustment);
@@ -617,70 +556,13 @@ SummaryView *summary_create(void)
        gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
        /* quick search */
-       hbox_search = gtk_hbox_new(FALSE, 0);
-       gtk_box_pack_start(GTK_BOX(vbox), hbox_search, FALSE, FALSE, 0);
-
-       search_type_opt = gtk_option_menu_new();
-       gtk_widget_show(search_type_opt);
-       gtk_box_pack_start(GTK_BOX(hbox_search), search_type_opt, FALSE, FALSE, 0);
-
-       search_type = gtk_menu_new();
-       MENUITEM_ADD (search_type, menuitem, _("Subject"), S_SEARCH_SUBJECT);
-       g_signal_connect(G_OBJECT(menuitem), "activate",
-                        G_CALLBACK(summary_searchtype_changed),
-                        summaryview);
-       MENUITEM_ADD (search_type, menuitem, _("From"), S_SEARCH_FROM);
-       g_signal_connect(G_OBJECT(menuitem), "activate",
-                        G_CALLBACK(summary_searchtype_changed),
-                        summaryview);
-       MENUITEM_ADD (search_type, menuitem, _("To"), S_SEARCH_TO);
-       g_signal_connect(G_OBJECT(menuitem), "activate",
-                        G_CALLBACK(summary_searchtype_changed),
-                        summaryview);
-       MENUITEM_ADD (search_type, menuitem, _("Extended"), S_SEARCH_EXTENDED);
-       g_signal_connect(G_OBJECT(menuitem), "activate",
-                        G_CALLBACK(summary_searchtype_changed),
-                        summaryview);
-
-       gtk_option_menu_set_menu(GTK_OPTION_MENU(search_type_opt), search_type);
-       
-       gtk_option_menu_set_history(GTK_OPTION_MENU(search_type_opt), prefs_common.summary_quicksearch_type);
-       
-       gtk_widget_show(search_type);
-       
-       search_string = gtk_combo_new();
-       gtk_box_pack_start(GTK_BOX(hbox_search), search_string, FALSE, FALSE, 2);
-       gtk_combo_set_value_in_list(GTK_COMBO(search_string), FALSE, TRUE);
-       gtk_combo_set_case_sensitive(GTK_COMBO(search_string), TRUE);
-       if (prefs_common.summary_quicksearch_history) 
-               gtk_combo_set_popdown_strings(GTK_COMBO(search_string), 
-                       prefs_common.summary_quicksearch_history);
-       gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(search_string)->entry), "");
-       gtk_widget_show(search_string);
-               
-       gtkut_button_set_create(&search_hbbox, &search_description, _("Extended Symbols"),
-                               NULL, NULL, NULL, NULL);
-       g_signal_connect(G_OBJECT(search_description), "clicked",
-                        G_CALLBACK(search_description_cb), NULL);
-       gtk_box_pack_start(GTK_BOX(hbox_search), search_hbbox, FALSE, FALSE, 2);
-                               
-       gtk_widget_show(search_string);
-       gtk_widget_show(hbox_search);
-
-       g_signal_connect(G_OBJECT(GTK_COMBO(search_string)->entry), 
-                          "key_press_event",
-                          G_CALLBACK(summary_searchbar_pressed),
-                          summaryview);
-
-       g_signal_connect(G_OBJECT(GTK_COMBO(search_string)->entry), 
-                        "focus_in_event",
-                        G_CALLBACK(summary_searchbar_focus_evt),
-                        summaryview);
-
-       g_signal_connect(G_OBJECT(GTK_COMBO(search_string)->entry), 
-                        "focus_out_event",
-                        G_CALLBACK(summary_searchbar_focus_evt),
-                        summaryview);
+       quicksearch = quicksearch_new();
+       gtk_box_pack_start(GTK_BOX(vbox), quicksearch_get_widget(quicksearch), FALSE, FALSE, 0);
+       if (prefs_common.show_searchbar)
+               quicksearch_show(quicksearch);
+       else
+               quicksearch_hide(quicksearch);
+       quicksearch_set_execute_callback(quicksearch, quicksearch_execute_cb, summaryview);
 
        g_signal_connect (G_OBJECT(toggle_search), "toggled",
                          G_CALLBACK(tog_searchbar_cb), summaryview);
@@ -697,7 +579,6 @@ SummaryView *summary_create(void)
        summaryview->ctree = ctree;
        summaryview->hbox = hbox;
        summaryview->hbox_l = hbox_l;
-       summaryview->hbox_search = hbox_search;
        summaryview->statlabel_folder = statlabel_folder;
        summaryview->statlabel_select = statlabel_select;
        summaryview->statlabel_msgs = statlabel_msgs;
@@ -707,24 +588,20 @@ SummaryView *summary_create(void)
        summaryview->popupmenu = popupmenu;
        summaryview->popupfactory = popupfactory;
        summaryview->lock_count = 0;
-       summaryview->search_type_opt = search_type_opt;
-       summaryview->search_type = search_type;
-       summaryview->search_string = search_string;
-       summaryview->search_description = search_description;
        summaryview->msginfo_update_callback_id =
                hooks_register_hook(MSGINFO_UPDATE_HOOKLIST, summary_update_msg, (gpointer) summaryview);
 
        summaryview->target_list = gtk_target_list_new(summary_drag_types, 1);
 
+       summaryview->quicksearch = quicksearch;
+
        /* CLAWS: need this to get the SummaryView * from
         * the CList */
        g_object_set_data(G_OBJECT(ctree), "summaryview", (gpointer)summaryview); 
 
        gtk_widget_show_all(vbox);
 
-       /* hide widgets that shouldn't be displayed */
-       if (prefs_common.summary_quicksearch_type != S_SEARCH_EXTENDED)
-               gtk_widget_hide(search_description);
+       gtk_widget_show(vbox);
 
        return summaryview;
 }
@@ -819,7 +696,7 @@ void summary_init(SummaryView *summaryview)
        gtk_container_add (GTK_CONTAINER(summaryview->toggle_search), pixmap);
        gtk_widget_show(pixmap);
        summaryview->quick_search_pixmap = pixmap;
-       
+
        /* Init summaryview prefs */
        summaryview->sort_key = SORT_BY_NONE;
        summaryview->sort_type = SORT_ASCENDING;
@@ -919,11 +796,6 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
        inc_lock();
        summary_lock(summaryview);
 
-       if (item != summaryview->folder_item) {
-               /* changing folder, reset search */
-               gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(summaryview->search_string)->entry), "");
-       }
-       
        /* STATUSBAR_POP(summaryview->mainwin); */
 
        is_refresh = (item == summaryview->folder_item) ? TRUE : FALSE;
@@ -1013,7 +885,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                             || MSG_IS_LOCKED(msginfo->flags)
                             || CURRENTLY_DISPLAYED(msginfo))
                             && !MSG_IS_IGNORE_THREAD(msginfo->flags))
-                           not_killed = g_slist_prepend(not_killed, msginfo);
+                               not_killed = g_slist_prepend(not_killed, msginfo);
                        else
                                procmsg_msginfo_free(msginfo);
                }
@@ -1023,62 +895,17 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                summary_set_hide_read_msgs_menu(summaryview, FALSE);
        }
 
-       if (strlen(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(summaryview->search_string)->entry))) > 0) {
+       if (quicksearch_is_active(summaryview->quicksearch)) {
                GSList *not_killed;
-               gint search_type = GPOINTER_TO_INT(g_object_get_data(
-                                  G_OBJECT(GTK_MENU_ITEM(gtk_menu_get_active(
-                                  GTK_MENU(summaryview->search_type)))), MENU_VAL_ID));
-               const gchar *search_string = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(summaryview->search_string)->entry));
-               gchar *searched_header = NULL;
-               MatcherList * tmp_list = NULL;
                
-               if (search_type == S_SEARCH_EXTENDED) {
-                       char *newstr = NULL;
-
-                       newstr = expand_search_string(search_string);
-                       if (newstr) {
-                               tmp_list = matcher_parser_get_cond(newstr);
-                               g_free(newstr);
-                       }
-                       else
-                               tmp_list = NULL;
-               }
-
                not_killed = NULL;
                for (cur = mlist ; cur != NULL ; cur = g_slist_next(cur)) {
                        MsgInfo * msginfo = (MsgInfo *) cur->data;
 
-                       switch (search_type) {
-                       case S_SEARCH_SUBJECT:
-                               searched_header = msginfo->subject;
-                               break;
-                       case S_SEARCH_FROM:
-                               searched_header = msginfo->from;
-                               break;
-                       case S_SEARCH_TO:
-                               searched_header = msginfo->to;
-                               break;
-                       case S_SEARCH_EXTENDED:
-                               break;
-                       default:
-                               debug_print("unknown search type (%d)\n", search_type);
-                               break;
-                       }
-                       if (search_type != S_SEARCH_EXTENDED) {
-                               if (searched_header && strcasestr(searched_header, search_string) != NULL)
-                                       not_killed = g_slist_prepend(not_killed, msginfo);
-                               else
-                                       procmsg_msginfo_free(msginfo);
-                       } else {
-                               if ((tmp_list != NULL) && matcherlist_match(tmp_list, msginfo))
-                                       not_killed = g_slist_prepend(not_killed, msginfo);
-                               else
-                                       procmsg_msginfo_free(msginfo);
-                       }
-               }
-               if (search_type == S_SEARCH_EXTENDED && tmp_list != NULL) {
-                       matcherlist_free(tmp_list);
-                       tmp_list = NULL;
+                       if (quicksearch_match(summaryview->quicksearch, msginfo))
+                               not_killed = g_slist_prepend(not_killed, msginfo);
+                       else
+                               procmsg_msginfo_free(msginfo);
                }
 
                g_slist_free(mlist);
@@ -2784,13 +2611,13 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
        if (MSG_IS_SIGNED(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MIME],
                                          gpgsignedxpm, gpgsignedxpmmask);
-       } else if (MSG_IS_MIME(flags) && MSG_IS_ENCRYPTED(flags)) {
+       } else if (MSG_IS_WITH_ATTACHMENT(flags) && MSG_IS_ENCRYPTED(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MIME],
                                          clipkeyxpm, clipkeyxpmmask);
        } else if (MSG_IS_ENCRYPTED(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MIME],
                                          keyxpm, keyxpmmask);
-       } else if (MSG_IS_MIME(flags)) {
+       } else if (MSG_IS_WITH_ATTACHMENT(flags)) {
                gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MIME],
                                          clipxpm, clipxpmmask);
        } else {
@@ -4571,68 +4398,23 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        return TRUE;
 }
 
-static gboolean summary_searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
-                                         SummaryView *summaryview)
+static void quicksearch_execute_cb(QuickSearch *quicksearch, gpointer data)
 {
-       if (event != NULL && event->keyval == GDK_Return) {
-               gchar *search_string = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(summaryview->search_string)->entry));
-               if (search_string && strlen(search_string) != 0) {
-                       prefs_common.summary_quicksearch_history =
-                               add_history(prefs_common.summary_quicksearch_history,
-                                           search_string);
-                       gtk_combo_set_popdown_strings(GTK_COMBO(summaryview->search_string), 
-                               prefs_common.summary_quicksearch_history);                      
-               }
-               summary_show(summaryview, summaryview->folder_item);
-               g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event");
-               return TRUE;            
-       }
-       return FALSE;
-}
-
-static gboolean summary_searchbar_focus_evt(GtkWidget *widget, GdkEventFocus *event,
-                               SummaryView *summaryview)
-{
-       if (event != NULL && event->in)
-               g_signal_handlers_block_by_func(G_OBJECT(summaryview->mainwin->window), 
-                                               G_CALLBACK(mainwindow_key_pressed),
-                                               summaryview->mainwin);
-       else
-               g_signal_handlers_unblock_by_func(G_OBJECT(summaryview->mainwin->window), 
-                                                 G_CALLBACK(mainwindow_key_pressed),
-                                                 summaryview->mainwin);
-
-       return FALSE;
-}
-
-static void summary_searchtype_changed(GtkMenuItem *widget, gpointer data)
-{
-       SummaryView *sw = (SummaryView *)data;
-       prefs_common.summary_quicksearch_type = GPOINTER_TO_INT(g_object_get_data(
-                                  G_OBJECT(GTK_MENU_ITEM(gtk_menu_get_active(
-                                  GTK_MENU(sw->search_type)))), MENU_VAL_ID));
-
-       /* Show extended search description button, only when Extended is selected */
-       if (prefs_common.summary_quicksearch_type == S_SEARCH_EXTENDED) {
-               gtk_widget_show(sw->search_description);
-       } else {
-               gtk_widget_hide(sw->search_description);
-       }
+       SummaryView *summaryview = data;
 
-       if (gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(sw->search_string)->entry)))
-               summary_show(sw, sw->folder_item);
+       summary_show(summaryview, summaryview->folder_item);
 }
 
 static void tog_searchbar_cb(GtkWidget *w, gpointer data)
 {
        SummaryView *summaryview = (SummaryView *)data;
-       GtkWidget *hbox= summaryview->hbox_search;
+
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) {
                prefs_common.show_searchbar = TRUE;
-               gtk_widget_show(hbox);
+               quicksearch_show(summaryview->quicksearch);
        } else {
                prefs_common.show_searchbar = FALSE;
-               gtk_widget_hide(hbox);
+               quicksearch_hide(summaryview->quicksearch);
        }
 }
 
@@ -4956,7 +4738,7 @@ CMP_FUNC_DEF(summary_cmp_by_mark,
 CMP_FUNC_DEF(summary_cmp_by_status,
             MSG_IS_UNREAD(msginfo1->flags) - MSG_IS_UNREAD(msginfo2->flags))
 CMP_FUNC_DEF(summary_cmp_by_mime,
-            MSG_IS_MIME(msginfo1->flags) - MSG_IS_MIME(msginfo2->flags))
+            MSG_IS_WITH_ATTACHMENT(msginfo1->flags) - MSG_IS_WITH_ATTACHMENT(msginfo2->flags))
 CMP_FUNC_DEF(summary_cmp_by_label,
             MSG_GET_COLORLABEL(msginfo1->flags) -
             MSG_GET_COLORLABEL(msginfo2->flags))
@@ -5460,13 +5242,11 @@ static void summary_find_answers (SummaryView *summaryview, MsgInfo *msg)
                folderview_select(summaryview->mainwin->folderview, sent_folder);
        }
        
-       gtk_option_menu_set_history(GTK_OPTION_MENU(summaryview->search_type_opt),
-                                   S_SEARCH_EXTENDED);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(summaryview->toggle_search), TRUE);
 
-       gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(summaryview->search_string)->entry), buf);
+       quicksearch_set(summaryview->quicksearch, QUICK_SEARCH_EXTENDED, buf);
        g_free(buf);
-       summary_show(summaryview, summaryview->folder_item);
+
        node = gtk_ctree_node_nth(GTK_CTREE(summaryview->ctree), 0);
        if (node)
                summary_select_node(summaryview, node, TRUE, TRUE);
index 064d442..f613521 100644 (file)
@@ -63,14 +63,6 @@ typedef enum
        TARGET_DUMMY
 } TargetInfo;
 
-typedef enum
-{
-       S_SEARCH_SUBJECT,
-       S_SEARCH_FROM,
-       S_SEARCH_TO,
-       S_SEARCH_EXTENDED
-} SummarySearchType;
-
 #include "mainwindow.h"
 #include "folderview.h"
 #include "headerview.h"
@@ -79,6 +71,7 @@ typedef enum
 #include "folder.h"
 #include "gtksctree.h"
 #include "prefs_filtering.h"
+#include "quicksearch.h"
 
 extern GtkTargetEntry summary_drag_types[1];
 
@@ -95,7 +88,6 @@ struct _SummaryView
        GtkWidget *ctree;
        GtkWidget *hbox;
        GtkWidget *hbox_l;
-       GtkWidget *hbox_search;
        GtkWidget *folder_pixmap;
        GtkWidget *statlabel_folder;
        GtkWidget *statlabel_select;
@@ -106,10 +98,6 @@ struct _SummaryView
        GtkWidget *quick_search_pixmap;
        GtkWidget *popupmenu;
        GtkWidget *colorlabel_menu;
-       GtkWidget *search_type_opt;
-       GtkWidget *search_type;
-       GtkWidget *search_string;
-       GtkWidget *search_description;
 
        GtkItemFactory *popupfactory;
 
@@ -133,6 +121,7 @@ struct _SummaryView
        FolderView   *folderview;
        HeaderView   *headerview;
        MessageView  *messageview;
+       QuickSearch  *quicksearch;
 
        FolderItem *folder_item;
 
index 3837c79..a8d5f7a 100644 (file)
@@ -98,26 +98,6 @@ static GdkColor error_color = {
 };
 #endif
 
-static GdkColor good_sig_color = {
-       (gulong)0,
-       (gushort)0,
-       (gushort)0xbfff,
-       (gushort)0
-};
-
-static GdkColor nocheck_sig_color = {
-       (gulong)0,
-       (gushort)0,
-       (gushort)0,
-       (gushort)0xcfff
-};
-
-static GdkColor bad_sig_color = {
-       (gulong)0,
-       (gushort)0xefff,
-       (gushort)0,
-       (gushort)0
-};
 
 #define TEXTVIEW_STATUSBAR_PUSH(textview, str)                                     \
 {                                                                          \
@@ -289,17 +269,6 @@ static void textview_create_tags(GtkTextView *text, TextView *textview)
        tag = gtk_text_buffer_create_tag(buffer, "link",
                                         "foreground-gdk", &uri_color,
                                         NULL);
-#if USE_GPGME
-       gtk_text_buffer_create_tag(buffer, "good-signature",
-                                  "foreground-gdk", &good_sig_color,
-                                  NULL);
-       gtk_text_buffer_create_tag(buffer, "bad-signature",
-                                  "foreground-gdk", &bad_sig_color,
-                                  NULL);
-       gtk_text_buffer_create_tag(buffer, "nocheck-signature",
-                                  "foreground-gdk", &nocheck_sig_color,
-                                  NULL);
-#endif /*USE_GPGME  */
 
        g_signal_connect(G_OBJECT(tag), "event",
                          G_CALLBACK(textview_uri_button_pressed), textview);
@@ -1912,6 +1881,7 @@ static gint show_url_timeout_cb(gpointer data)
        TextView *textview = (TextView *)data;
        
        TEXTVIEW_STATUSBAR_POP(textview);
+       textview->show_url_timeout_tag = 0;
        return FALSE;
 }
 
@@ -2048,23 +2018,24 @@ static gboolean textview_uri_button_pressed(GtkTextTag *tag, GObject *obj,
                                        g_free(fromname);
                                } else {
                                        PrefsAccount *account = NULL;
-                                       FolderItem   *folder_item;
-
-                                       if (textview->messageview && textview->messageview->mainwin 
-                                       &&  textview->messageview->mainwin->summaryview 
-                                       &&  textview->messageview->mainwin->summaryview->folder_item) {
-                                               folder_item = textview->messageview->mainwin->summaryview->folder_item;
-                                               if (folder_item->prefs && folder_item->prefs->enable_default_account)
-                                                       account = account_find_from_id(folder_item->prefs->default_account);
+
+                                               if (textview->messageview && textview->messageview->msginfo &&
+                                                   textview->messageview->msginfo->folder) {
+                                                       FolderItem   *folder_item;
+
+                                                       folder_item = textview->messageview->msginfo->folder;
+                                                       if (folder_item->prefs && folder_item->prefs->enable_default_account)
+                                                               account = account_find_from_id(folder_item->prefs->default_account);
+                                               }
+                                               compose_new(account, uri->uri + 7, NULL);
                                        }
-                                       compose_new(account, uri->uri + 7, NULL);
-                               }
-                       else
-                               if (uri_security_check(uri, textview) == TRUE)
-                                       open_uri(uri->uri, prefs_common.uri_cmd);
-                       return TRUE;
-               }
-               g_free(trimmed_uri);
+                       } else {
+                               if (textview_uri_security_check(textview, uri) == TRUE) 
+                                       open_uri(uri->uri,
+                                                prefs_common.uri_cmd);
+                               return TRUE;
+                       }
+                       g_free(trimmed_uri);
        }
 
        return FALSE;
index ed4dbd9..8f7c716 100644 (file)
@@ -81,8 +81,6 @@ static void   toolbar_style                   (ToolbarType     type,
                                                 guint           action, 
                                                 gpointer        data);
 
-static GtkWidget *get_window_widget            (ToolbarType     type, 
-                                                gpointer        data);
 static MainWindow *get_mainwin                 (gpointer data);
 static void activate_compose_button            (Toolbar        *toolbar,
                                                 ToolbarStyle    style,
@@ -149,9 +147,7 @@ static void toolbar_addrbook_cb             (GtkWidget      *widget,
 static void toolbar_check_spelling_cb                  (GtkWidget      *widget, 
                                                 gpointer        data);
 #endif
-static void toolbar_popup_cb                   (gpointer        data, 
-                                                guint           action, 
-                                                GtkWidget      *widget);
+
 struct {
        gchar *index_str;
        const gchar *descr;
@@ -942,11 +938,6 @@ static void toolbar_compose_cb(GtkWidget *widget, gpointer data)
        }
 }
 
-static void toolbar_popup_cb(gpointer data, guint action, GtkWidget *widget)
-{
-       toolbar_reply(data, action);
-}
-
 
 /*
  * Reply Message
@@ -1215,26 +1206,6 @@ static MainWindow *get_mainwin(gpointer data)
        return mainwin;
 }
 
-static GtkWidget *get_window_widget(ToolbarType type, gpointer data)
-{
-       MainWindow *mainwin;
-       MessageView *msgview;
-
-       switch (type) {
-       case TOOLBAR_MAIN:
-               mainwin = (MainWindow*)data;
-               return mainwin->window;
-               break;
-       case TOOLBAR_MSGVIEW:
-               msgview = (MessageView*)data;
-               return msgview->vbox;
-               break;
-       default:
-               break;
-       }
-       return NULL;
-}
-
 static void toolbar_buttons_cb(GtkWidget   *widget, 
                               ToolbarItem *item)
 {
@@ -1302,7 +1273,6 @@ Toolbar *toolbar_create(ToolbarType        type,
        GtkWidget *icon_news;
        GtkWidget *item;
        GtkWidget *item_news;
-       GtkWidget *window_wid;
 
        guint n_menu_entries;
        ComboButton *reply_combo;
diff --git a/tools/launch_firebird b/tools/launch_firebird
deleted file mode 100644 (file)
index 5cae436..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Copyright © 2002 Mohammed Sameer <Uniball@linux-egypt.org> 
-#
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-############################################################################
-# Script Name: launch_firebird
-# Author: Mohammed Sameer <Uniball@linux-egypt.org>
-# Script Version: 0.2
-# Script Purpose: Check for a running firebird process and and open a new 
-#                tab with a given URL or execute firebird with that URL
-# Usage: preferences->other->web browser-> "launch_firebird "%s""
-############################################################################
-# Version 0.2, June 2003, Paul Mangan <claws@thewildbeast.co.uk>
-# Changes: renamed and edited to reflect the browser's name change from
-# 'phoenix' to 'firebird'.
-############################################################################
-
-URL=$*
-# name of binary (change it if necessary):
-FIREBIRD=mozilla-firebird
-
-firebird_running()
-{
-$FIREBIRD -remote "openurl($URL,new-tab)"
-}
-firebird_new()
-{
-$FIREBIRD $URL
-}
-
-
-STR=`$FIREBIRD -remote "ping()" 2>&1 | grep No`
-#echo $STR
-if [[ "$STR" == "No running window found." ]]; then
-firebird_new;
-else
-firebird_running;
-fi
-