sync with sylpheed 0.6.1cvs6
authorPaul Mangan <paul@claws-mail.org>
Thu, 13 Sep 2001 13:38:32 +0000 (13:38 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 13 Sep 2001 13:38:32 +0000 (13:38 +0000)
42 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
po/POTFILES.in
src/addressadd.c
src/addressbook.c
src/addritem.h
src/codeconv.c
src/codeconv.h
src/compose.c
src/compose.h
src/editaddress.c
src/editjpilot.c
src/editldap.c
src/editldap_basedn.c
src/foldersel.c
src/folderview.c
src/inc.c
src/jpilot.c
src/jpilot.h
src/mainwindow.c
src/mgutils.c
src/mimeview.c
src/pixmaps/dir-close.xpm
src/pixmaps/dir-open.xpm
src/pixmaps/new.xpm
src/pixmaps/trash.xpm
src/pixmaps/unread.xpm
src/prefs.h
src/prefs_common.c
src/prefs_common.h
src/prefs_customheader.c
src/prefs_display_header.c
src/prefs_filter.c
src/prefs_filtering.c
src/summaryview.c
src/summaryview.h
src/syldap.c
src/utils.c
src/utils.h
src/vcard.c

index f2ba097..08ae487 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,55 @@
+2001-09-12
+
+       * src/utils.c: get_quote_level(): some optimization and bugfixes.
+       * src/codeconv.[ch]: conv_get_current_locale(): new.
+       * src/editaddress.c: edit_person_page_basic(): reverse the order
+         of first and last name on some locales.
+
+2001-09-11
+
+       * src/compose.c: applied the patch from Yasumatsu that reformats
+         the current paragraph (thanks!). Modified so that it doesn't
+         reformat quoted paragraphs.
+         compose_create(): don't fill the entry automatically on reedit
+         mode.
+       * src/mainwindow.c
+         src/summaryview.[ch]: added the "Mark all read" option.
+         summary_mark_all_read(): new.
+
+2001-09-10
+
+       * src/vcard.c
+         src/mgutils.c
+         src/syldap.c
+         src/editldap.c
+         src/editldap_basedn.c
+         src/jpilot.c
+         src/editjpilot.c: removed all warnings.
+       * configure.in
+         src/jpilot.[ch]: fixed the problem that failed to detect JPilot
+         header files on the Debian system.
+       * src/mainwindow.c
+         src/summaryview.[ch]: enabled sorting by mark, unread, attachment,
+         and color label. Enabled moving to next/prev flagged messages.
+
+2001-09-09
+
+       * src/pixmaps/dir-close.xpm
+         src/pixmaps/dir-open.xpm
+         src/pixmaps/new.xpm
+         src/pixmaps/unread.xpm: modified the color balance.
+       * src/utils.[ch]: execute_sync(): new.
+         execute_command_line(): added the arg for async mode.
+       * src/inc.c: inc_mail(): use execute_command_line().
+
 2001-09-08
 
        * src/prefs.[ch]
-         src/prefs_common.c
-         src/prefs_account.c: modified the layout.
+         src/prefs_common.[ch]
+         src/prefs_account.c: modified the layout. Added the option to
+         launch the external editor automatically.
+       * src/compose.c: launch the external editor automatically if the
+         option is set.
 
 2001-09-06
 
index 0d9e5bc..db5f280 100644 (file)
@@ -1,3 +1,10 @@
+2001-09-13 [paul]
+
+       * configure.in
+               change to version 0.6.1claws3
+
+       * sync with sylpheed 0.6.1cvs6
+
 2001-09-13 [darko]
        
        * src/folderview.c
index e103a84..eebb1af 100644 (file)
@@ -1,8 +1,55 @@
+2001-09-12
+
+       * src/utils.c: get_quote_level(): ºÇŬ²½¤È¥Ð¥°½¤Àµ¡£
+       * src/codeconv.[ch]: conv_get_current_locale(): ¿·µ¬¡£
+       * src/editaddress.c: edit_person_page_basic(): ÆÃÄê¤Î¥í¥«¡¼¥ë¤Ç
+         À«¡¦Ì¾¤Î½ç½ø¤ò¸ò´¹¡£
+
+2001-09-11
+
+       * src/compose.c: ¸½ºß¤ÎÃÊÍî¤òÀ°·Á¤¹¤ë¤è¤¦¤Ë¤¹¤ë°Â¾¾¤µ¤ó¤Î¥Ñ¥Ã¥Á¤ò
+         Å¬ÍÑ(thanks!)¡£°úÍѤµ¤ì¤¿ÃÊÍî¤òÀ°·Á¤·¤Ê¤¤¤è¤¦¤Ë½¤Àµ¡£
+         compose_create(): ºÆÊÔ½¸¥â¡¼¥É¤Ç¥¨¥ó¥È¥ê¤ò¼«Æ°Åª¤ËËä¤á¤Ê¤¤¤è¤¦¤Ë
+         ¤·¤¿¡£
+       * src/mainwindow.c
+         src/summaryview.[ch]: ¡ÖÁ´¤ÆÆɤó¤À¤³¤È¤Ë¤¹¤ë¡×¥ª¥×¥·¥ç¥ó¤òÄɲá£
+         summary_mark_all_read(): ¿·µ¬¡£
+
+2001-09-10
+
+       * src/vcard.c
+         src/mgutils.c
+         src/syldap.c
+         src/editldap.c
+         src/editldap_basedn.c
+         src/jpilot.c
+         src/editjpilot.c: Á´¤Æ¤Î·Ù¹ð¤ò½üµî¡£
+       * configure.in
+         src/jpilot.[ch]: Debian ¥·¥¹¥Æ¥à¤Ç JPilot ¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò
+         ¸¡½Ð¤Ç¤­¤Ê¤¤ÌäÂê¤ò½¤Àµ¡£
+       * src/mainwindow.c
+         src/summaryview.[ch]: ¥Þ¡¼¥¯¡¢Ì¤ÆÉ¡¢ÅºÉÕ¡¢¤½¤·¤Æ¥«¥é¡¼¥é¥Ù¥ë
+         ¤Ë¤è¤ë¥½¡¼¥È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¡£Á°/¼¡¤Î¥Õ¥é¥°ÉÕ¤­¥á¥Ã¥»¡¼¥¸
+         ¤Ø¤Î°ÜÆ°¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2001-09-09
+
+       * src/pixmaps/dir-close.xpm
+         src/pixmaps/dir-open.xpm
+         src/pixmaps/new.xpm
+         src/pixmaps/unread.xpm: ¿§¤Î¥Ð¥é¥ó¥¹¤ò½¤Àµ¡£
+       * src/utils.[ch]: execute_sync(): ¿·µ¬¡£
+         execute_command_line(): ÈóƱ´ü¥â¡¼¥ÉÍѤΰú¿ô¤òÄɲá£
+       * src/inc.c: inc_mail(): execute_command_line() ¤ò»ÈÍÑ¡£
+
 2001-09-08
 
        * src/prefs.[ch]
-         src/prefs_common.c
-         src/prefs_account.c: ¥ì¥¤¥¢¥¦¥È¤ò½¤Àµ¡£
+         src/prefs_common.[ch]
+         src/prefs_account.c: ¥ì¥¤¥¢¥¦¥È¤ò½¤Àµ¡£³°Éô¥¨¥Ç¥£¥¿¤ò¼«Æ°Åª¤Ë
+         µ¯Æ°¤¹¤ë¥ª¥×¥·¥ç¥ó¤òÄɲá£
+       * src/compose.c: ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¤é³°Éô¥¨¥Ç¥£¥¿¤ò¼«Æ°Åª
+         ¤Ëµ¯Æ°¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
 
 2001-09-06
 
index 2d8c069..60527b8 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws2
+EXTRA_VERSION=claws3
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
@@ -152,6 +152,12 @@ if test "$ac_cv_enable_jpilot" = yes; then
                         [ LIBS="$LIBS -lpisock"
                           AC_DEFINE(USE_JPILOT) ],
                         [ ac_cv_enable_jpilot=no ])
+       if test "$ac_cv_enable_jpilot" = no; then
+               AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
+                                [ LIBS="$LIBS -lpisock"
+                                  ac_cv_enable_jpilot=yes
+                                  AC_DEFINE(USE_JPILOT) ])
+       fi
        AC_MSG_CHECKING([whether jpilot is available])
        AC_MSG_RESULT($ac_cv_enable_jpilot)
 else
index 9d285f7..6a7434e 100644 (file)
@@ -2,7 +2,6 @@ src/about.c
 src/account.c
 src/addrbook.c
 src/addrcache.c
-src/address.c
 src/addressadd.c
 src/addressbook.c
 src/addrindex.c
index dbb3928..353f3f6 100644 (file)
@@ -271,7 +271,7 @@ static void addressadd_create( void ) {
        gtk_widget_show_all( window );
 
        PIXMAP_CREATE( window, bookXpm, bookXpmMask, book_xpm );
-       PIXMAP_CREATE( window, folderXpm, folderXpmMask, DIRECTORY_OPEN_XPM );
+       PIXMAP_CREATE( window, folderXpm, folderXpmMask, dir_open_xpm );
 }
 
 static void addressadd_load_folder( GtkCTreeNode *parentNode, ItemFolder *parentFolder,
index 2548176..2ba7be1 100644 (file)
@@ -136,10 +136,10 @@ static GdkBitmap *categoryxpmmask;
 static GdkPixmap *ldapxpm;
 static GdkBitmap *ldapxpmmask;
 
-/* Message buffer  */
+/* Message buffer */
 static gchar addressbook_msgbuf[ ADDRESSBOOK_MSGBUF_SIZE ];
 
-/* Address list selection  */
+/* Address list selection */
 static GList *_addressListSelection_ = NULL;
 
 /* Address index file and interfaces */
@@ -153,7 +153,7 @@ static AddressBook_win addrbook;
 static GHashTable *_addressBookTypeHash_ = NULL;
 static GList *_addressBookTypeList_ = NULL;
 
-static void addressbook_create                 ( void );
+static void addressbook_create                 (void);
 static gint addressbook_close                  (void);
 static void addressbook_button_set_sensitive   (void);
 
@@ -244,24 +244,24 @@ static void addressbook_file_save_cb              (gpointer        data,
                                                 guint           action,
                                                 GtkWidget      *widget);
 
-/* Data source edit stuff  */
-static void addressbook_new_book_cb            ( gpointer      data,
-                                                 guint         action,
-                                                 GtkWidget     *widget );
-static void addressbook_new_vcard_cb           ( gpointer      data,
-                                                 guint         action,
-                                                 GtkWidget     *widget );
+/* Data source edit stuff */
+static void addressbook_new_book_cb            (gpointer        data,
+                                                guint           action,
+                                                GtkWidget      *widget);
+static void addressbook_new_vcard_cb           (gpointer        data,
+                                                guint           action,
+                                                GtkWidget      *widget);
 
 #ifdef USE_JPILOT
-static void addressbook_new_jpilot_cb          ( gpointer      data,
-                                                 guint         action,
-                                                 GtkWidget     *widget );
+static void addressbook_new_jpilot_cb          (gpointer        data,
+                                                guint           action,
+                                                GtkWidget      *widget);
 #endif
 
 #ifdef USE_LDAP
-static void addressbook_new_ldap_cb            ( gpointer      data,
-                                                 guint         action,
-                                                 GtkWidget     *widget );
+static void addressbook_new_ldap_cb            (gpointer        data,
+                                                guint           action,
+                                                GtkWidget      *widget);
 #endif
 
 static void addressbook_set_clist              (AddressObject  *obj);
@@ -280,20 +280,20 @@ static GtkCTreeNode *addressbook_node_add_folder
                                                (GtkCTreeNode   *node,
                                                AddressDataSource *ds,
                                                ItemFolder      *itemFolder,
-                                               AddressObjectType otype );
+                                               AddressObjectType otype);
 static GtkCTreeNode *addressbook_node_add_group (GtkCTreeNode  *node,
                                                AddressDataSource *ds,
-                                               ItemGroup       *itemGroup );
+                                               ItemGroup       *itemGroup);
 /* static GtkCTreeNode *addressbook_node_add_category
                                                (GtkCTreeNode   *node,
                                                 AddressDataSource *ds,
                                                 ItemFolder     *itemFolder );  */
 static void addressbook_tree_remove_children   (GtkCTree       *ctree,
-                                               GtkCTreeNode    *parent );
+                                               GtkCTreeNode    *parent);
 static void addressbook_move_nodes_up          (GtkCTree       *ctree,
-                                               GtkCTreeNode    *node );
+                                               GtkCTreeNode    *node);
 static GtkCTreeNode *addressbook_find_group_node (GtkCTreeNode *parent,
-                                               ItemGroup       *group );
+                                               ItemGroup       *group);
 
 static void addressbook_delete_object          (AddressObject  *obj);
 
@@ -306,34 +306,34 @@ static gint addressbook_list_compare_func (GtkCList       *clist,
 /* static gint addressbook_obj_name_compare    (gconstpointer   a,
                                                 gconstpointer   b);  */
 
-static void addressbook_book_show_message      ( AddressBookFile *book );
-static void addressbook_vcard_show_message     ( VCardFile *vcf );
+static void addressbook_book_show_message      (AddressBookFile *book);
+static void addressbook_vcard_show_message     (VCardFile *vcf);
 #ifdef USE_JPILOT
-static void addressbook_jpilot_show_message    ( JPilotFile *jpf );
+static void addressbook_jpilot_show_message    (JPilotFile *jpf);
 #endif
 #ifdef USE_LDAP
-static void addressbook_ldap_show_message      ( SyldapServer *server );
+static void addressbook_ldap_show_message      (SyldapServer *server);
 #endif
 
-/* LUT's and IF stuff  */
-static void addressbook_free_adapter           ( GtkCTreeNode  *node );
-static void addressbook_free_child_adapters    ( GtkCTreeNode  *node );
-AddressTypeControlItem *addrbookctl_lookup     ( gint          ot );
-AddressTypeControlItem *addrbookctl_lookup_iface( AddressIfType        ifType );
+/* LUT's and IF stuff */
+static void addressbook_free_adapter           (GtkCTreeNode   *node);
+static void addressbook_free_child_adapters    (GtkCTreeNode   *node);
+AddressTypeControlItem *addrbookctl_lookup     (gint            ot);
+AddressTypeControlItem *addrbookctl_lookup_iface(AddressIfType  ifType);
 
-void addrbookctl_build_map                     ( GtkWidget     *window );
-void addrbookctl_build_iflist                  ( void );
-AdapterInterface *addrbookctl_find_interface   ( AddressIfType ifType );
-void addrbookctl_build_ifselect();
+void addrbookctl_build_map                     (GtkWidget      *window);
+void addrbookctl_build_iflist                  (void);
+AdapterInterface *addrbookctl_find_interface   (AddressIfType   ifType);
+void addrbookctl_build_ifselect                        (void);
 
-static void addrbookctl_free_interface         ( AdapterInterface      *adapter );
-static void addrbookctl_free_datasource                ( AdapterDSource        *adapter );
-static void addrbookctl_free_folder            ( AdapterFolder *adapter );
-static void addrbookctl_free_group             ( AdapterGroup  *adapter );
+static void addrbookctl_free_interface         (AdapterInterface *adapter);
+static void addrbookctl_free_datasource                (AdapterDSource   *adapter);
+static void addrbookctl_free_folder            (AdapterFolder    *adapter);
+static void addrbookctl_free_group             (AdapterGroup     *adapter);
 
-static void addressbook_list_select_clear      ( void );
-static void addressbook_list_select_add                ( AddressObject *obj );
-static void addressbook_list_select_remove     ( AddressObject *obj );
+static void addressbook_list_select_clear      (void);
+static void addressbook_list_select_add                (AddressObject *obj);
+static void addressbook_list_select_remove     (AddressObject *obj);
 
 static GtkItemFactoryEntry addressbook_entries[] =
 {
@@ -426,10 +426,12 @@ Compose *addressbook_get_target_compose(void)
        return addrbook.target_compose;
 }
 
-void addressbook_refresh( void ) {
-       if( addrbook.window ) {
-               if( addrbook.treeSelected ) {
-                       gtk_ctree_select( GTK_CTREE(addrbook.ctree), addrbook.treeSelected );
+void addressbook_refresh(void)
+{
+       if (addrbook.window) {
+               if (addrbook.treeSelected) {
+                       gtk_ctree_select(GTK_CTREE(addrbook.ctree),
+                                        addrbook.treeSelected);
                }
        }
        addressbook_export_to_file();
@@ -450,7 +452,8 @@ void addressbook_refresh( void ) {
 * In the tradition of MVC architecture, the data stores have been separated from the
 * GUI components. The addrindex.c file provides the interface to all data stores.
 */
-static void addressbook_create( void ) {
+static void addressbook_create(void)
+{
        GtkWidget *window;
        GtkWidget *vbox;
        GtkWidget *menubar;
@@ -465,7 +468,6 @@ static void addressbook_create( void ) {
        GtkWidget *label;
        GtkWidget *entry;
        GtkWidget *statusbar;
-       /* GtkWidget *hmbox;  */
        GtkWidget *hbbox;
        GtkWidget *hsbox;
        GtkWidget *del_btn;
@@ -481,9 +483,6 @@ static void addressbook_create( void ) {
        GtkItemFactory *menu_factory;
        gint n_entries;
        GList *nodeIf;
-       AdapterInterface *adapter;
-       AddressTypeControlItem *atci;
-       AddressInterface *iface;
 
        gchar *titles[N_COLS] = {_("Name"), _("E-Mail address"), _("Remarks")};
        gchar *text;
@@ -494,7 +493,6 @@ static void addressbook_create( void ) {
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title(GTK_WINDOW(window), _("Address book"));
        gtk_widget_set_usize(window, ADDRESSBOOK_WIDTH, ADDRESSBOOK_HEIGHT);
-       gtk_container_set_border_width(GTK_CONTAINER(window), BORDER_WIDTH);
        gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, TRUE);
        gtk_widget_realize(window);
 
@@ -527,7 +525,7 @@ static void addressbook_create( void ) {
                                       GTK_POLICY_ALWAYS);
        gtk_widget_set_usize(ctree_swin, COL_FOLDER_WIDTH + 40, -1);
 
-       /* Address index  */
+       /* Address index */
        ctree = gtk_ctree_new(1, 0);
        gtk_container_add(GTK_CONTAINER(ctree_swin), ctree);
        gtk_clist_set_selection_mode(GTK_CLIST(ctree), GTK_SELECTION_BROWSE);
@@ -556,7 +554,7 @@ static void addressbook_create( void ) {
                                       GTK_POLICY_ALWAYS);
        gtk_box_pack_start(GTK_BOX(clist_vbox), clist_swin, TRUE, TRUE, 0);
 
-       /* Address list  */
+       /* Address list */
        clist = gtk_ctree_new_with_titles(N_COLS, 0, titles);
        gtk_container_add(GTK_CONTAINER(clist_swin), clist);
        gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_EXTENDED);
@@ -666,22 +664,23 @@ static void addressbook_create( void ) {
                           GTK_SIGNAL_FUNC(addressbook_to_clicked),
                           GINT_TO_POINTER(COMPOSE_BCC));
 
-       /* Build icons for interface  */
+       /* Build icons for interface */
        PIXMAP_CREATE( window, interfacexpm, interfacexpmmask, interface_xpm );
 
        /* Build control tables */
-       addrbookctl_build_map( window );
+       addrbookctl_build_map(window);
        addrbookctl_build_iflist();
        addrbookctl_build_ifselect();
 
-       /* Add each interface into the tree as a root level folder  */
+       /* Add each interface into the tree as a root level folder */
        nodeIf = _addressInterfaceList_;
        while( nodeIf ) {
-               adapter = nodeIf->data;
-               nodeIf = g_list_next( nodeIf );
-               iface = adapter->interface;
-               if( iface->useInterface ) {
-                       atci = adapter->atci;
+               AdapterInterface *adapter = nodeIf->data;
+               AddressInterface *iface = adapter->interface;
+               nodeIf = g_list_next(nodeIf);
+
+               if(iface->useInterface) {
+                       AddressTypeControlItem *atci = adapter->atci;
                        text = atci->displayName;
                        adapter->treeNode =
                                gtk_ctree_insert_node( GTK_CTREE(ctree),
@@ -1109,7 +1108,7 @@ static void addressbook_tree_selected(GtkCTree *ctree, GtkCTreeNode *node,
                ads = ADAPTER_DSOURCE(obj);
                if( ads == NULL ) return;
                ds = ads->dataSource;
-               if( ds == NULL ) return;
+               if( ds == NULL ) return;                
 
                if( addrindex_ds_get_modify_flag( ds ) ) {
                        addrindex_ds_read_data( ds );
@@ -3006,9 +3005,9 @@ static void addressbook_lup_clicked( GtkButton *button, gpointer data ) {
 void addrbookctl_build_map( GtkWidget *window ) {
        AddressTypeControlItem *atci;
 
-       /* Build icons */
-       PIXMAP_CREATE(window, folderxpm, folderxpmmask, DIRECTORY_CLOSE_XPM);
-       PIXMAP_CREATE(window, folderopenxpm, folderopenxpmmask, DIRECTORY_OPEN_XPM);
+       // Build icons
+       PIXMAP_CREATE(window, folderxpm, folderxpmmask, dir_close_xpm);
+       PIXMAP_CREATE(window, folderopenxpm, folderopenxpmmask, dir_open_xpm);
        PIXMAP_CREATE(window, groupxpm, groupxpmmask, group_xpm);
        PIXMAP_CREATE(window, vcardxpm, vcardxpmmask, vcard_xpm);
        PIXMAP_CREATE(window, bookxpm, bookxpmmask, book_xpm);
index 7250367..80cbdaa 100644 (file)
@@ -121,6 +121,7 @@ void addritem_person_set_first_name ( ItemPerson *person, const gchar *value );
 void addritem_person_set_last_name     ( ItemPerson *person, const gchar *value );
 void addritem_person_set_nick_name     ( ItemPerson *person, const gchar *value );
 void addritem_person_set_common_name   ( ItemPerson *person, const gchar *value );
+void addritem_person_set_external_id   ( ItemPerson *person, const gchar *value );
 void addritem_person_set_opened                ( ItemPerson *person, const gboolean value );
 void addritem_free_item_person         ( ItemPerson *person );
 void addritem_free_list_email          ( GList *list );
@@ -171,5 +172,3 @@ ItemEMail *addritem_move_email_before       ( ItemPerson *person, ItemEMail *itemMove,
 ItemEMail *addritem_move_email_after   ( ItemPerson *person, ItemEMail *itemMove, ItemEMail *itemTarget );
 
 #endif /* __ADDRITEM_H__ */
-
-
index d963d35..ca69e59 100644 (file)
@@ -699,6 +699,20 @@ const gchar *conv_get_outgoing_charset_str(void)
        return str ? str : "US-ASCII";
 }
 
+const gchar *conv_get_current_locale(void)
+{
+       gchar *cur_locale;
+
+       cur_locale = g_getenv("LC_ALL");
+       if (!cur_locale) cur_locale = g_getenv("LANG");
+       if (!cur_locale) cur_locale = setlocale(LC_CTYPE, NULL);
+
+       debug_print("current locale: %s\n",
+                   cur_locale ? cur_locale : "(none)");
+
+       return cur_locale;
+}
+
 void conv_unmime_header_overwrite(gchar *str)
 {
        gchar *buf;
index 897d0cf..fd23755 100644 (file)
@@ -141,6 +141,8 @@ const gchar *conv_get_current_charset_str   (void);
 CharSet conv_get_outgoing_charset              (void);
 const gchar *conv_get_outgoing_charset_str     (void);
 
+const gchar *conv_get_current_locale           (void);
+
 void conv_unmime_header_overwrite      (gchar          *str);
 void conv_unmime_header                        (gchar          *outbuf,
                                         gint            outlen,
index a56c70e..0537ee2 100644 (file)
@@ -124,7 +124,8 @@ static GdkColor quote_color = {0, 0, 0, 0xbfff};
 
 static GList *compose_list = NULL;
 
-static Compose *compose_create                 (PrefsAccount   *account);
+static Compose *compose_create                 (PrefsAccount   *account,
+                                                ComposeMode     mode);
 static void compose_toolbar_create             (Compose        *compose,
                                                 GtkWidget      *container);
 static GtkWidget *compose_account_option_menu_create
@@ -160,6 +161,7 @@ static void compose_attach_append_with_type(Compose *compose,
                                            const gchar *type,
                                            ContentType cnttype);
 static void compose_wrap_line                  (Compose        *compose);
+static void compose_wrap_line_all              (Compose        *compose);
 static void compose_set_title                  (Compose        *compose);
 
 static PrefsAccount *compose_current_mail_account(void);
@@ -409,54 +411,56 @@ static GtkItemFactoryEntry compose_popup_entries[] =
 static GtkItemFactoryEntry compose_entries[] =
 {
        {N_("/_File"),                          NULL, NULL, 0, "<Branch>"},
-       {N_("/_File/_Attach file"),             "<control>M", compose_attach_cb, 0, NULL},
+       {N_("/_File/_Attach file"),             "<control>M", compose_attach_cb,      0, NULL},
        {N_("/_File/_Insert file"),             "<control>I", compose_insert_file_cb, 0, NULL},
-       {N_("/_File/Insert si_gnature"),        "<control>G", compose_insert_sig, 0, NULL},
+       {N_("/_File/Insert si_gnature"),        "<control>G", compose_insert_sig,     0, NULL},
        {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_File/_Close"),                   "<alt>W", compose_close_cb, 0, NULL},
 
-       {N_("/_Edit"),             NULL,         NULL,  0, "<Branch>"},
-       {N_("/_Edit/_Undo"),       "<control>Z", NULL,  0, NULL},
-       {N_("/_Edit/_Redo"),       "<control>Y", NULL,  0, NULL},
-       {N_("/_Edit/---"),         NULL,         NULL,  0, "<Separator>"},
+       {N_("/_Edit"),             NULL, NULL, 0, "<Branch>"},
+       {N_("/_Edit/_Undo"),       "<control>Z", NULL, 0, NULL},
+       {N_("/_Edit/_Redo"),       "<control>Y", NULL, 0, NULL},
+       {N_("/_Edit/---"),         NULL, NULL, 0, "<Separator>"},
        {N_("/_Edit/Cu_t"),        "<control>X", compose_cut_cb,    0, NULL},
        {N_("/_Edit/_Copy"),       "<control>C", compose_copy_cb,   0, NULL},
        {N_("/_Edit/_Paste"),      "<control>V", compose_paste_cb,  0, NULL},
        {N_("/_Edit/Select _all"), "<control>A", compose_allsel_cb, 0, NULL},
-       {N_("/_Edit/---"),         NULL,         NULL,  0, "<Separator>"},
-       {N_("/_Edit/Wrap long _lines"), "<alt>L", compose_wrap_line, 0, NULL},
-       {N_("/_Edit/Edit with e_xternal editor"), "<alt>X",
-                                       compose_ext_editor_cb,  0, NULL},
-
-       {N_("/_Message"),               NULL,           NULL,   0, "<Branch>"},
+       {N_("/_Edit/---"),         NULL, NULL, 0, "<Separator>"},
+       {N_("/_Edit/_Wrap current paragraph"), "<alt>L", compose_wrap_line, 0, NULL},
+       {N_("/_Edit/Wrap all long _lines"),
+                       "<shift><alt>L", compose_wrap_line_all, 0, NULL},
+       {N_("/_Edit/Edit with e_xternal editor"),
+                       "<alt>X", compose_ext_editor_cb, 0, NULL},
+
+       {N_("/_Message"),               NULL, NULL, 0, "<Branch>"},
        {N_("/_Message/_Send"),         "<shift><control>S",
                                        compose_send_cb, 0, NULL},
        {N_("/_Message/Send _later"),   "<shift><alt>S",
                                        compose_send_later_cb,  0, NULL},
        {N_("/_Message/Save to _draft folder"),
-                                       "<alt>D",       compose_draft_cb, 0, NULL},
-       {N_("/_Message/---"),           NULL,           NULL,   0, "<Separator>"},
-       {N_("/_Message/_To"),           NULL, compose_toggle_to_cb, 0, "<ToggleItem>"},
-       {N_("/_Message/_Cc"),           NULL, compose_toggle_cc_cb, 0, "<ToggleItem>"},
-       {N_("/_Message/_Bcc"),          NULL, compose_toggle_bcc_cb, 0, "<ToggleItem>"},
+                                       "<alt>D", compose_draft_cb, 0, NULL},
+       {N_("/_Message/---"),           NULL, NULL, 0, "<Separator>"},
+       {N_("/_Message/_To"),           NULL, compose_toggle_to_cb     , 0, "<ToggleItem>"},
+       {N_("/_Message/_Cc"),           NULL, compose_toggle_cc_cb     , 0, "<ToggleItem>"},
+       {N_("/_Message/_Bcc"),          NULL, compose_toggle_bcc_cb    , 0, "<ToggleItem>"},
        {N_("/_Message/_Reply to"),     NULL, compose_toggle_replyto_cb, 0, "<ToggleItem>"},
-       {N_("/_Message/---"),           NULL,           NULL,   0, "<Separator>"},
+       {N_("/_Message/---"),           NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/_Followup to"),  NULL, compose_toggle_followupto_cb, 0, "<ToggleItem>"},
-       {N_("/_Message/---"),           NULL,           NULL,   0, "<Separator>"},
+       {N_("/_Message/---"),           NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/_Attach"),       NULL, compose_toggle_attach_cb, 0, "<ToggleItem>"},
 #if USE_GPGME
-       {N_("/_Message/---"),           NULL,           NULL,   0, "<Separator>"},
-       {N_("/_Message/Si_gn"),         NULL, compose_toggle_sign_cb, 0, "<ToggleItem>"},
+       {N_("/_Message/---"),           NULL, NULL, 0, "<Separator>"},
+       {N_("/_Message/Si_gn"),         NULL, compose_toggle_sign_cb   , 0, "<ToggleItem>"},
        {N_("/_Message/_Encrypt"),      NULL, compose_toggle_encrypt_cb, 0, "<ToggleItem>"},
 #endif /* USE_GPGME */
        {N_("/_Message/---"),           NULL,           NULL,   0, "<Separator>"},
        {N_("/_Message/_Request Return Receipt"),       NULL, compose_toggle_return_receipt_cb, 0, "<ToggleItem>"},
-       {N_("/_Tool"),                  NULL, NULL,     0, "<Branch>"},
-       {N_("/_Tool/Show _ruler"),      NULL, compose_toggle_ruler_cb,  0, "<ToggleItem>"},
-       {N_("/_Tool/_Address book"),    "<alt>A",       compose_address_cb, 0, NULL},
+       {N_("/_Tool"),                  NULL, NULL, 0, "<Branch>"},
+       {N_("/_Tool/Show _ruler"),      NULL, compose_toggle_ruler_cb, 0, "<ToggleItem>"},
+       {N_("/_Tool/_Address book"),    "<alt>A", compose_address_cb , 0, NULL},
        {N_("/_Tool/_Templates ..."),   NULL, template_select_cb, 0, NULL},
-       {N_("/_Help"),                  NULL, NULL,     0, "<LastBranch>"},
-       {N_("/_Help/_About"),           NULL,           about_show,     0, NULL}
+       {N_("/_Help"),                  NULL, NULL, 0, "<LastBranch>"},
+       {N_("/_Help/_About"),           NULL, about_show, 0, NULL}
 };
 
 static GtkTargetEntry compose_mime_types[] =
@@ -486,8 +490,7 @@ Compose * compose_generic_new(PrefsAccount *account, const gchar *to, FolderItem
        if (!account) account = cur_account;
        g_return_val_if_fail(account != NULL, NULL);
 
-       compose = compose_create(account);
-       compose->mode = COMPOSE_NEW;
+       compose = compose_create(account, COMPOSE_NEW);
        compose->replyinfo = NULL;
 
        if (prefs_common.auto_sig)
@@ -520,7 +523,10 @@ Compose * compose_generic_new(PrefsAccount *account, const gchar *to, FolderItem
                        gtk_widget_grab_focus(compose->newsgroups_entry);
        }
 
-       return compose;
+       if (prefs_common.auto_exteditor)
+               compose_exec_ext_editor(compose);
+
+        return compose;
 }
 
 #define CHANGE_FLAGS(msginfo) \
@@ -541,8 +547,7 @@ Compose * compose_new_followup_and_replyto(PrefsAccount *account,
        g_return_val_if_fail(account != NULL, NULL);
        g_return_val_if_fail(account->protocol != A_NNTP, NULL);
 
-       compose = compose_create(account);
-       compose->mode = COMPOSE_NEW;
+       compose = compose_create(account, COMPOSE_NEW);
 
        if (prefs_common.auto_sig)
                compose_insert_sig(compose);
@@ -616,8 +621,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
 
        CHANGE_FLAGS(msginfo);
 
-       compose = compose_create(reply_account);
-       compose->mode = COMPOSE_REPLY;
+       compose = compose_create(account, COMPOSE_REPLY);
        compose->replyinfo = msginfo;
 
 
@@ -681,6 +685,9 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
 
        gtk_stext_thaw(text);
        gtk_widget_grab_focus(compose->text);
+
+        if (prefs_common.auto_exteditor)
+               compose_exec_ext_editor(compose);
 }
 
 
@@ -947,8 +954,7 @@ Compose * compose_forward(PrefsAccount * account, MsgInfo *msginfo,
        MSG_SET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);
        CHANGE_FLAGS(msginfo);
 
-       compose = compose_create(account);
-       compose->mode = COMPOSE_FORWARD;
+       compose = compose_create(account, COMPOSE_FORWARD);
 
        if (msginfo->subject && *msginfo->subject) {
                gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), "Fw: ");
@@ -1010,7 +1016,10 @@ Compose * compose_forward(PrefsAccount * account, MsgInfo *msginfo,
        else
                gtk_widget_grab_focus(compose->newsgroups_entry);
 
-       return compose;
+       if (prefs_common.auto_exteditor)
+               compose_exec_ext_editor(compose);
+
+        return compose;
 }
 
 #undef INSERT_FW_HEADER
@@ -1039,8 +1048,7 @@ Compose * compose_forward_multiple(PrefsAccount * account,
        }
        g_return_val_if_fail(account != NULL, NULL);
 
-       compose = compose_create(account);
-       compose->mode = COMPOSE_FORWARD;
+       compose = compose_create(account, COMPOSE_FORWARD);
 
        text = GTK_STEXT(compose->text);
        gtk_stext_freeze(text);
@@ -1092,9 +1100,7 @@ void compose_reedit(MsgInfo *msginfo)
         if (!account) account = cur_account;
        g_return_if_fail(account != NULL);
 
-       compose = compose_create(account);
-       compose->mode = COMPOSE_REEDIT;
-
+       compose = compose_create(account, COMPOSE_REEDIT);
        compose->targetinfo = procmsg_msginfo_copy(msginfo);
 
        if (compose_parse_header(compose, msginfo) < 0) return;
@@ -1114,6 +1120,9 @@ void compose_reedit(MsgInfo *msginfo)
 
        gtk_stext_thaw(text);
        gtk_widget_grab_focus(compose->text);
+
+        if (prefs_common.auto_exteditor)
+               compose_exec_ext_editor(compose);
 }
 
 GList *compose_get_compose_list(void)
@@ -1892,6 +1901,175 @@ static void compose_attach_append(Compose *compose, const gchar *file,
 }
 
 static void compose_wrap_line(Compose *compose)
+{
+       GtkSText *text = GTK_STEXT(compose->text);
+       gint ch_len, last_ch_len;
+       gchar cbuf[MB_CUR_MAX], last_ch;
+       guint text_len;
+       guint line_end;
+       guint quoted;
+       gint p_start, p_end;
+       gint line_pos, cur_pos;
+       gint line_len, cur_len;
+
+#define GET_STEXT(pos)                                                        \
+       if (text->use_wchar)                                                 \
+               ch_len = wctomb(cbuf, (wchar_t)GTK_STEXT_INDEX(text, (pos))); \
+       else {                                                               \
+               cbuf[0] = GTK_STEXT_INDEX(text, (pos));                       \
+               ch_len = 1;                                                  \
+       }
+
+       gtk_stext_freeze(text);
+
+       text_len = gtk_stext_get_length(text);
+
+       /* check to see if the point is on the paragraph mark (empty line). */
+       cur_pos = gtk_stext_get_point(text);
+       GET_STEXT(cur_pos);
+       if ((ch_len == 1 && *cbuf == '\n') || cur_pos == text_len) {
+               if (cur_pos == 0)
+                       goto compose_end; /* on the paragraph mark */
+               GET_STEXT(cur_pos - 1);
+               if (ch_len == 1 && *cbuf == '\n')
+                       goto compose_end; /* on the paragraph mark */
+       }
+
+       /* find paragraph start. */
+       line_end = quoted = 0;
+       for (p_start = cur_pos; p_start >= 0; --p_start) {
+               GET_STEXT(p_start);
+               if (ch_len == 1 && *cbuf == '\n') {
+                       if (quoted)
+                               goto compose_end; /* quoted part */
+                       if (line_end) {
+                               p_start += 2;
+                               break;
+                       }
+                       line_end = 1;
+               } else {
+                       if (ch_len == 1 && strchr(">:#", *cbuf))
+                               quoted = 1;
+                       else if (ch_len != 1 || !isspace(*cbuf))
+                               quoted = 0;
+
+                       line_end = 0;
+               }
+       }
+       if (p_start < 0)
+               p_start = 0;
+
+       /* find paragraph end. */
+       line_end = 0;
+       for (p_end = cur_pos; p_end < text_len; p_end++) {
+               GET_STEXT(p_end);
+               if (ch_len == 1 && *cbuf == '\n') {
+                       if (line_end) {
+                               p_end -= 1;
+                               break;
+                       }
+                       line_end = 1;
+               } else {
+                       if (line_end && ch_len == 1 && strchr(">:#", *cbuf))
+                               goto compose_end; /* quoted part */
+
+                       line_end = 0;
+               }
+       }
+       if (p_end >= text_len)
+               p_end = text_len;
+
+       if (p_start >= p_end)
+               goto compose_end;
+
+       line_len = cur_len = 0;
+       last_ch_len = 0;
+       last_ch = '\0';
+       line_pos = p_start;
+       for (cur_pos = p_start; cur_pos < p_end; cur_pos++) {
+               guint space = 0;
+
+               GET_STEXT(cur_pos);
+
+               if (ch_len < 0) {
+                       cbuf[0] = '\0';
+                       ch_len = 1;
+               }
+
+               if (ch_len == 1 && isspace(*cbuf))
+                       space = 1;
+
+               if (ch_len == 1 && *cbuf == '\n') {
+                       guint replace = 0;
+                       if (last_ch_len == 1 && !isspace(last_ch)) {
+                               if (cur_pos + 1 < p_end) {
+                                       GET_STEXT(cur_pos + 1);
+                                       if (ch_len == 1 && !isspace(*cbuf))
+                                               replace = 1;
+                               }
+                       }
+                       gtk_stext_set_point(text, cur_pos + 1);
+                       gtk_stext_backward_delete(text, 1);
+                       if (replace) {
+                               gtk_stext_set_point(text, cur_pos);
+                               gtk_stext_insert(text, NULL, NULL, NULL, " ", 1);
+                               space = 1;
+                       }
+                       else {
+                               p_end--;
+                               cur_pos--;
+                               continue;
+                       }
+               }
+
+               last_ch_len = ch_len;
+               last_ch = *cbuf;
+
+               if (space) {
+                       line_pos = cur_pos + 1;
+                       line_len = cur_len + ch_len;
+               }
+
+               if (cur_len + ch_len > prefs_common.linewrap_len &&
+                   line_len > 0) {
+                       gint tlen = ch_len;
+
+                       GET_STEXT(line_pos - 1);
+                       if (ch_len == 1 && isspace(*cbuf)) {
+                               gtk_stext_set_point(text, line_pos);
+                               gtk_stext_backward_delete(text, 1);
+                               p_end--;
+                               cur_pos--;
+                               line_pos--;
+                               cur_len--;
+                               line_len--;
+                       }
+                       ch_len = tlen;
+
+                       gtk_stext_set_point(text, line_pos);
+                       gtk_stext_insert(text, NULL, NULL, NULL, "\n", 1);
+                       p_end++;
+                       cur_pos++;
+                       line_pos++;
+                       cur_len = cur_len - line_len + ch_len;
+                       line_len = 0;
+                       continue;
+               }
+
+               if (ch_len > 1) {
+                       line_pos = cur_pos + 1;
+                       line_len = cur_len + ch_len;
+               }
+               cur_len += ch_len;
+       }
+
+compose_end:
+       gtk_stext_thaw(text);
+
+#undef GET_STEXT
+}
+
+static void compose_wrap_line_all(Compose *compose)
 {
        GtkSText *text = GTK_STEXT(compose->text);
        guint text_len;
@@ -2038,7 +2216,7 @@ gint compose_send(Compose *compose)
                   get_rc_dir(), G_DIR_SEPARATOR, (gint)compose);
 
        if (prefs_common.linewrap_at_send)
-               compose_wrap_line(compose);
+               compose_wrap_line_all(compose);
 
        if (compose_write_to_file(compose, tmp, FALSE) < 0) {
                lock = FALSE;
@@ -2894,7 +3072,7 @@ static void compose_add_entry_field(GtkWidget *table, GtkWidget **hbox,
        (*count)++;
 }
 
-static Compose *compose_create(PrefsAccount *account)
+static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
 {
        Compose   *compose;
        GtkWidget *window;
@@ -3295,7 +3473,7 @@ static Compose *compose_create(PrefsAccount *account)
        compose->popupmenu    = popupmenu;
        compose->popupfactory = popupfactory;
 
-       compose->mode = COMPOSE_NEW;
+       compose->mode = mode;
 
        compose->replyto     = NULL;
        compose->cc          = NULL;
@@ -3341,7 +3519,7 @@ static Compose *compose_create(PrefsAccount *account)
                gtk_widget_set_sensitive(menuitem, FALSE);
        }
        */
-       if (account->set_autocc && account->auto_cc) {
+       if (account->set_autocc && account->auto_cc && mode != COMPOSE_REEDIT) {
                compose->use_cc = TRUE;
                gtk_entry_set_text(GTK_ENTRY(cc_entry), account->auto_cc);
                menuitem = gtk_item_factory_get_item(ifactory, "/Message/Cc");
@@ -3354,7 +3532,7 @@ static Compose *compose_create(PrefsAccount *account)
                menuitem = gtk_item_factory_get_item(ifactory, "/Message/Bcc");
                gtk_check_menu_item_set_active
                        (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               if (account->auto_bcc)
+               if (account->auto_bcc && mode != COMPOSE_REEDIT)
                        gtk_entry_set_text(GTK_ENTRY(bcc_entry),
                                           account->auto_bcc);
        }
@@ -3364,7 +3542,7 @@ static Compose *compose_create(PrefsAccount *account)
                                                     "/Message/Reply to");
                gtk_check_menu_item_set_active
                        (GTK_CHECK_MENU_ITEM(menuitem), TRUE);
-               if (account->auto_replyto)
+               if (account->auto_replyto && mode != COMPOSE_REEDIT)
                        gtk_entry_set_text(GTK_ENTRY(reply_entry),
                                           account->auto_replyto);
        }
@@ -3522,7 +3700,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container)
        CREATE_TOOLBAR_ICON(linewrap_xpm);
        linewrap_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
                                               _("Linewrap"),
-                                              _("Wrap long lines"),
+                                              _("Wrap current paragraph"),
                                               "Linewrap",
                                               icon_wid,
                                               toolbar_linewrap_cb,
@@ -4437,7 +4615,7 @@ static void compose_send_later_cb(gpointer data, guint action,
                   g_get_tmp_dir(), G_DIR_SEPARATOR, (gint)compose);
 
        if (prefs_common.linewrap_at_send)
-               compose_wrap_line(compose);
+               compose_wrap_line_all(compose);
 
        if (compose_write_to_file(compose, tmp, FALSE) < 0 ||
            compose_queue(compose, tmp) < 0) {
index 1ae1817..89199b9 100644 (file)
@@ -32,12 +32,6 @@ typedef struct _AttachInfo   AttachInfo;
 #include "addressbook.h"
 #include "prefs_account.h"
 
-typedef enum
-{
-       COMPOSE_MAIL,
-       COMPOSE_NEWS
-} ComposeMode;
-
 typedef enum
 {
        COMPOSE_TO,
@@ -62,7 +56,7 @@ typedef enum
        COMPOSE_FORWARD_AS_ATTACH,
        COMPOSE_NEW,
        COMPOSE_REEDIT
-} ComposeReplyMode;
+} ComposeMode;
 
 struct _Compose
 {
@@ -117,7 +111,7 @@ struct _Compose
 
        GtkItemFactory *popupfactory;
 
-       ComposeReplyMode mode;
+       ComposeMode mode;
 
        MsgInfo *targetinfo;
        MsgInfo *replyinfo;
index bca341f..64bbf88 100644 (file)
@@ -40,6 +40,7 @@
 #include "addrbook.h"
 #include "manage_window.h"
 #include "gtkutils.h"
+#include "codeconv.h"
 
 #include "prefs_common.h"
 
@@ -171,7 +172,7 @@ static void addressbook_edit_address_create(gboolean *cancelled)
 
        window = gtk_window_new(GTK_WINDOW_DIALOG);
        gtk_widget_set_usize(window, 400, -1);
-       gtk_container_set_border_width(GTK_CONTAINER(window), 8);
+       //gtk_container_set_border_width(GTK_CONTAINER(window), 8);
        gtk_window_set_title(GTK_WINDOW(window), _("Edit address"));
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_modal(GTK_WINDOW(window), TRUE); 
@@ -604,6 +605,7 @@ static void edit_person_attrib_add( gpointer data ) {
 static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
        GtkWidget *window;
        GtkWidget *vbox;
+       GtkWidget *vnbox;
        GtkWidget *notebook;
        GtkWidget *hbbox;
        GtkWidget *ok_btn;
@@ -613,7 +615,7 @@ static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
 
        window = gtk_window_new(GTK_WINDOW_DIALOG);
        gtk_widget_set_usize(window, EDITPERSON_WIDTH, EDITPERSON_HEIGHT );
-       gtk_container_set_border_width(GTK_CONTAINER(window), 0);
+       //gtk_container_set_border_width(GTK_CONTAINER(window), 0);
        gtk_window_set_title(GTK_WINDOW(window), _("Edit Person Data"));
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_modal(GTK_WINDOW(window), TRUE); 
@@ -624,16 +626,21 @@ static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
                           GTK_SIGNAL_FUNC(edit_person_key_pressed),
                           cancelled);
 
-       vbox = gtk_vbox_new( FALSE, 6 );
-       gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);
-       gtk_widget_show( vbox );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
+       vbox = gtk_vbox_new(FALSE, 4);
+       //gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);
+       gtk_widget_show(vbox);
+       gtk_container_add(GTK_CONTAINER(window), vbox);
+
+       vnbox = gtk_vbox_new(FALSE, 4);
+       gtk_container_set_border_width(GTK_CONTAINER(vnbox), 4);
+       gtk_widget_show(vnbox);
+       gtk_box_pack_start(GTK_BOX(vbox), vnbox, TRUE, TRUE, 0);
 
        // Notebook
        notebook = gtk_notebook_new();
-       gtk_widget_show( notebook );
-       gtk_box_pack_start( GTK_BOX( vbox ), notebook, TRUE, TRUE, 0 );
-       gtk_container_set_border_width( GTK_CONTAINER( notebook ), 6 );
+       gtk_widget_show(notebook);
+       gtk_box_pack_start(GTK_BOX(vnbox), notebook, TRUE, TRUE, 0);
+       gtk_container_set_border_width(GTK_CONTAINER(notebook), 6);
 
        // Status line
        hsbox = gtk_hbox_new(FALSE, 0);
@@ -644,7 +651,7 @@ static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
        // Button panel
        gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
                                &cancel_btn, _("Cancel"), NULL, NULL);
-       gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
+       gtk_box_pack_end(GTK_BOX(vnbox), hbbox, FALSE, FALSE, 0);
        gtk_widget_grab_default(ok_btn);
 
        gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
@@ -673,7 +680,8 @@ void addressbook_edit_person_page_basic( gint pageNum, gchar *pageLbl ) {
        GtkWidget *entry_fn;
        GtkWidget *entry_ln;
        GtkWidget *entry_nn;
-       gint top;
+       const gchar *locale;
+       gint top = 0;
 
        vbox = gtk_vbox_new( FALSE, 8 );
        gtk_widget_show( vbox );
@@ -692,41 +700,34 @@ void addressbook_edit_person_page_basic( gint pageNum, gchar *pageLbl ) {
        gtk_table_set_row_spacings(GTK_TABLE(table), 8);
        gtk_table_set_col_spacings(GTK_TABLE(table), 8);
 
-       // First row
-       top = 0;
-       label = gtk_label_new(_("Display Name"));
-       gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
-       entry_name = gtk_entry_new();
-       gtk_table_attach(GTK_TABLE(table), entry_name, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
-
-       // Next row
-       ++top;
-       label = gtk_label_new(_("First Name"));
-       gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
-       entry_fn = gtk_entry_new();
-       gtk_table_attach(GTK_TABLE(table), entry_fn, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
-
-       // Next row
-       ++top;
-       label = gtk_label_new(_("Last Name"));
-       gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
-       entry_ln = gtk_entry_new();
-       gtk_table_attach(GTK_TABLE(table), entry_ln, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+#define ATTACH_ROW(text, entry) \
+{ \
+       label = gtk_label_new(text); \
+       gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), \
+                        GTK_FILL, 0, 0, 0); \
+       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); \
+ \
+       entry = gtk_entry_new(); \
+       gtk_table_attach(GTK_TABLE(table), entry, 1, 2, top, (top + 1), \
+                        GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0); \
+       top++; \
+}
 
-       // Next row
-       ++top;
-       label = gtk_label_new(_("Nick Name"));
-       gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+       ATTACH_ROW(_("Display Name"), entry_name);
+       locale = conv_get_current_locale();
+       if (locale &&
+           (!g_strncasecmp(locale, "ja", 2) ||
+            !g_strncasecmp(locale, "ko", 2) ||
+            !g_strncasecmp(locale, "zh", 2))) {
+               ATTACH_ROW(_("Last Name"), entry_ln);
+               ATTACH_ROW(_("First Name"), entry_fn);
+       } else {
+               ATTACH_ROW(_("First Name"), entry_fn);
+               ATTACH_ROW(_("Last Name"), entry_ln);
+       }
+       ATTACH_ROW(_("Nick Name"), entry_nn);
 
-       entry_nn = gtk_entry_new();
-       gtk_table_attach(GTK_TABLE(table), entry_nn, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+#undef ATTACH_ROW
 
        gtk_widget_show_all(vbox);
 
index 94a272f..cb72b0f 100644 (file)
@@ -45,6 +45,8 @@
 #include "addressitem.h"
 #include "jpilot.h"
 #include "mgutils.h"
+#include "gtkutils.h"
+#include "manage_window.h"
 
 #define ADDRESSBOOK_GUESS_JPILOT "MyJPilot"
 #define JPILOT_NUM_CUSTOM_LABEL        4
@@ -151,7 +153,7 @@ static void edit_jpilot_read_check_box( JPilotFile *pilotFile ) {
 }
 
 static void edit_jpilot_file_check( void ) {
-       gint t;
+       gint t = -1;
        gchar *sFile;
        gchar *sMsg;
        gboolean flg;
index 38d6b3e..6fe9c10 100644 (file)
 #include "addressbook.h"
 #include "prefs_common.h"
 #include "addressitem.h"
+#include "mgutils.h"
 #include "syldap.h"
 #include "editldap_basedn.h"
+#include "manage_window.h"
+#include "gtkutils.h"
 
 #define ADDRESSBOOK_GUESS_LDAP_NAME    "MyServer"
 #define ADDRESSBOOK_GUESS_LDAP_SERVER  "localhost"
@@ -220,7 +223,7 @@ static void addressbook_edit_ldap_dialog_create( gboolean *cancelled ) {
                           cancelled);
 
        vbox = gtk_vbox_new( FALSE, 6 );
-       gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);
+       //gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);
        gtk_widget_show( vbox );
        gtk_container_add( GTK_CONTAINER( window ), vbox );
 
@@ -276,7 +279,7 @@ void addressbook_edit_ldap_page_basic( gint pageNum, gchar *pageLbl ) {
        vbox = gtk_vbox_new( FALSE, 8 );
        gtk_widget_show( vbox );
        gtk_container_add( GTK_CONTAINER( ldapedit.notebook ), vbox );
-       gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );
+       //gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );
 
        label = gtk_label_new( pageLbl );
        gtk_widget_show( label );
@@ -368,7 +371,7 @@ void addressbook_edit_ldap_page_extended( gint pageNum, gchar *pageLbl ) {
        vbox = gtk_vbox_new( FALSE, 8 );
        gtk_widget_show( vbox );
        gtk_container_add( GTK_CONTAINER( ldapedit.notebook ), vbox );
-       gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );
+       //gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );
 
        label = gtk_label_new( pageLbl );
        gtk_widget_show( label );
@@ -467,7 +470,7 @@ void edit_ldap_set_optmenu( GtkOptionMenu *optmenu, const gint value ) {
        gint menuVal;
        gint n = 0;
 
-       g_return_if_fail(menu != NULL);
+       g_return_if_fail(optmenu != NULL);
 
        menu = gtk_option_menu_get_menu(optmenu);
        for( cur = GTK_MENU_SHELL(menu)->children; cur != NULL; cur = cur->next ) {
@@ -485,7 +488,9 @@ void edit_ldap_set_optmenu( GtkOptionMenu *optmenu, const gint value ) {
 gint edit_ldap_get_optmenu( GtkOptionMenu *optmenu ) {
        GtkWidget *menu;
        GtkWidget *menuitem;
-       g_return_if_fail(menu != NULL);
+
+       g_return_val_if_fail(optmenu != NULL, -1);
+
        menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(optmenu));
        menuitem = gtk_menu_get_active(GTK_MENU(menu));
        return GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(menuitem)));
@@ -494,7 +499,7 @@ gint edit_ldap_get_optmenu( GtkOptionMenu *optmenu ) {
 AdapterDSource *addressbook_edit_ldap( AddressIndex *addrIndex, AdapterDSource *ads ) {
        static gboolean cancelled;
        gchar *sName, *sHost, *sBase, *sBind, *sPass, *sCrit;
-       gint iPort, iMaxE, iTime, iMail, iName;
+       gint iPort, iMaxE, iTime;
        AddressDataSource *ds = NULL;
        SyldapServer *server = NULL;
        gboolean fin;
@@ -592,4 +597,3 @@ AdapterDSource *addressbook_edit_ldap( AddressIndex *addrIndex, AdapterDSource *
 /*
 * End of Source.
 */
-
index f836fc9..9c8b2f3 100644 (file)
@@ -42,6 +42,9 @@
 #include "intl.h"
 #include "prefs_common.h"
 #include "syldap.h"
+#include "mgutils.h"
+#include "gtkutils.h"
+#include "manage_window.h"
 
 static struct _LDAPEdit_basedn {
        GtkWidget *window;
@@ -94,7 +97,7 @@ static void edit_ldap_bdn_cancel( GtkWidget *widget, gboolean *cancelled ) {
 }
 
 static void edit_ldap_bdn_list_select( GtkCList *clist, gint row, gint column, GdkEvent *event, gpointer data ) {
-       gchar **text;
+       gchar **text = NULL;
        if( gtk_clist_get_text( clist, row, 0, text ) ) {
                if( *text ) {
                        gtk_entry_set_text(GTK_ENTRY(ldapedit_basedn.basedn_entry), *text );
@@ -112,25 +115,25 @@ static void edit_ldap_bdn_list_button( GtkCList *clist, GdkEventButton *event, g
        }
 }
 
-static void edit_ldap_bdn_create() {
+static void edit_ldap_bdn_create(void) {
        GtkWidget *window;
        GtkWidget *vbox;
        GtkWidget *table;
        GtkWidget *label;
        GtkWidget *host_label;
        GtkWidget *port_label;
-       GtkWidget *basedn_label;
+       //GtkWidget *basedn_label;
        GtkWidget *basedn_list;
        GtkWidget *vlbox;
        GtkWidget *lwindow;
        GtkWidget *basedn_entry;
-       GtkWidget *hlbox;
+       //GtkWidget *hlbox;
        GtkWidget *hbbox;
        GtkWidget *hsep;
        GtkWidget *ok_btn;
        GtkWidget *cancel_btn;
-       GtkWidget *check_btn;
-       GtkWidget *file_btn;
+       //GtkWidget *check_btn;
+       //GtkWidget *file_btn;
        GtkWidget *hsbox;
        GtkWidget *statusbar;
        gint top;
index 09fda2a..39e1700 100644 (file)
@@ -193,9 +193,8 @@ static void foldersel_create(void)
 
 static void foldersel_init(void)
 {
-       PIXMAP_CREATE(ctree, folderxpm, folderxpmmask, DIRECTORY_CLOSE_XPM);
-       PIXMAP_CREATE(ctree, folderopenxpm, folderopenxpmmask,
-                     DIRECTORY_OPEN_XPM);
+       PIXMAP_CREATE(ctree, folderxpm, folderxpmmask, dir_close_xpm);
+       PIXMAP_CREATE(ctree, folderopenxpm, folderopenxpmmask, dir_open_xpm);
 }
 
 static gboolean foldersel_gnode_func(GtkCTree *ctree, guint depth,
index c5f775e..cc08ab3 100644 (file)
@@ -426,9 +426,8 @@ void folderview_init(FolderView *folderview)
 
        PIXMAP_CREATE(ctree, inboxxpm, inboxxpmmask, inbox_xpm);
        PIXMAP_CREATE(ctree, outboxxpm, outboxxpmmask, outbox_xpm);
-       PIXMAP_CREATE(ctree, folderxpm, folderxpmmask, DIRECTORY_CLOSE_XPM);
-       PIXMAP_CREATE(ctree, folderopenxpm, folderopenxpmmask,
-                     DIRECTORY_OPEN_XPM);
+       PIXMAP_CREATE(ctree, folderxpm, folderxpmmask, dir_close_xpm);
+       PIXMAP_CREATE(ctree, folderopenxpm, folderopenxpmmask, dir_open_xpm);
        PIXMAP_CREATE(ctree, trashxpm, trashxpmmask, trash_xpm);
 
        if (!normalfont)
index b86a174..1ef5271 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -178,30 +178,14 @@ void inc_mail(MainWindow *mainwin)
        summary_write_cache(mainwin->summaryview);
        main_window_lock(mainwin);
 
-       if (prefs_common.use_extinc && prefs_common.extinc_path) {
-               gint pid;
-
+       if (prefs_common.use_extinc && prefs_common.extinc_cmd) {
                /* external incorporating program */
-               if ((pid = fork()) < 0) {
-                       perror("fork");
+               if (execute_command_line(prefs_common.extinc_cmd, FALSE) < 0) {
                        main_window_unlock(mainwin);
                        inc_autocheck_timer_set();
                        return;
                }
 
-               if (pid == 0) {
-                       execlp(prefs_common.extinc_path,
-                              g_basename(prefs_common.extinc_path),
-                              NULL);
-
-                       /* this will be called when failed */
-                       perror("exec");
-                       _exit(1);
-               }
-
-               /* wait until child process is terminated */
-               waitpid(pid, NULL, 0);
-
                if (prefs_common.inc_local)
                        new_msgs = inc_spool();
        } else {
@@ -315,6 +299,7 @@ static IncProgressDialog *inc_progress_dialog_create(void)
                           GTK_SIGNAL_FUNC(inc_cancel), dialog);
        gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
                           GTK_SIGNAL_FUNC(gtk_true), NULL);
+       /* manage_window_set_transient(GTK_WINDOW(progress->window)); */
 
        progress_dialog_set_value(progress, 0.0);
 
index 9b4d4b1..3b71d06 100644 (file)
 
 #ifdef USE_JPILOT
 
+#include <glib.h>
 #include <time.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/stat.h>
 #include <dlfcn.h>
 
-#include <pi-args.h>
-#include <pi-appinfo.h>
-#include <pi-address.h>
+#ifdef HAVE_LIBPISOCK_PI_ARGS_H
+#  include <libpisock/pi-args.h>
+#  include <libpisock/pi-appinfo.h>
+#  include <libpisock/pi-address.h>
+#else
+#  include <pi-args.h>
+#  include <pi-appinfo.h>
+#  include <pi-address.h>
+#endif
 
 #include "mgutils.h"
 #include "addritem.h"
@@ -174,15 +183,15 @@ void jpilot_set_accessed( JPilotFile *pilotFile, const gboolean value ) {
 }
 
 gint jpilot_get_status( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, -1 );
        return pilotFile->retVal;
 }
 ItemFolder *jpilot_get_root_folder( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, NULL );
        return addrcache_get_root_folder( pilotFile->addressCache );
 }
 gchar *jpilot_get_name( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, NULL );
        return pilotFile->name;
 }
 
@@ -191,11 +200,11 @@ gchar *jpilot_get_name( JPilotFile *pilotFile ) {
 * Return: TRUE if file was modified.
 */
 gboolean jpilot_get_modified( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, FALSE );
        return addrcache_check_file( pilotFile->addressCache, pilotFile->path );
 }
 gboolean jpilot_get_accessed( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, FALSE );
        return pilotFile->accessFlag;
 }
 
@@ -204,7 +213,7 @@ gboolean jpilot_get_accessed( JPilotFile *pilotFile ) {
 * Return: TRUE if file was read.
 */
 gboolean jpilot_get_read_flag( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, FALSE );
        return pilotFile->addressCache->dataRead;
 }
 
@@ -213,6 +222,7 @@ gboolean jpilot_get_read_flag( JPilotFile *pilotFile ) {
 */
 void jpilot_clear_custom_labels( JPilotFile *pilotFile ) {
        GList *node;
+
        g_return_if_fail( pilotFile != NULL );
 
        // Release custom labels
@@ -260,7 +270,9 @@ void jpilot_add_custom_label( JPilotFile *pilotFile, const gchar *labelName ) {
 GList *jpilot_get_custom_labels( JPilotFile *pilotFile ) {
        GList *retVal = NULL;
        GList *node;
-       g_return_if_fail( pilotFile != NULL );
+
+       g_return_val_if_fail( pilotFile != NULL, NULL );
+
        node = pilotFile->customLabels;
        while( node ) {
                retVal = g_list_append( retVal, g_strdup( node->data ) );
@@ -304,7 +316,9 @@ void jpilot_force_refresh( JPilotFile *pilotFile ) {
 */
 void jpilot_print_file( JPilotFile *pilotFile, FILE *stream ) {
        GList *node;
+
        g_return_if_fail( pilotFile != NULL );
+
        fprintf( stream, "JPilotFile:\n" );
        fprintf( stream, "file spec: '%s'\n", pilotFile->path );
        fprintf( stream, " metadata: %s\n", pilotFile->readMetadata ? "yes" : "no" );
@@ -312,7 +326,7 @@ void jpilot_print_file( JPilotFile *pilotFile, FILE *stream ) {
 
        node = pilotFile->customLabels;
        while( node ) {
-               fprintf( stream, "  c label: %s\n", node->data );
+               fprintf( stream, "  c label: %s\n", (gchar *)node->data );
                node = g_list_next( node );
        }
 
@@ -339,7 +353,7 @@ void jpilot_print_short( JPilotFile *pilotFile, FILE *stream ) {
 
        node = pilotFile->customLabels;
        while( node ) {
-               fprintf( stream, "  c label: %s\n", node->data );
+               fprintf( stream, "  c label: %s\n", (gchar *)node->data );
                node = g_list_next( node );
        }
 
@@ -373,6 +387,7 @@ time_t pilot_time_to_unix_time ( unsigned long raw_time ) {
 // Shamelessly copied from JPilot (libplugin.c)
 static int raw_header_to_header(RawDBHeader *rdbh, DBHeader *dbh) {
        unsigned long temp;
+
        strncpy(dbh->db_name, rdbh->db_name, 31);
        dbh->db_name[31] = '\0';
        dbh->flags = bytes_to_bin(rdbh->flags, 2);
@@ -575,14 +590,14 @@ static gint jpilot_get_file_info( JPilotFile *pilotFile, unsigned char **buf, in
 // jp_read_DB_files (from libplugin.c)
 static gint jpilot_read_file( JPilotFile *pilotFile ) {
        FILE *in;
-       char *buf;
-       int num_records, recs_returned, i, num, r;
-       unsigned int offset, prev_offset, next_offset, rec_size;
-       int out_of_order;
-       long fpos;  /*file position indicator */
-       unsigned char attrib;
-       unsigned int unique_id;
-       gint cat_id;
+       gchar *buf;
+       gint num_records, recs_returned, i, num;
+       guint offset, prev_offset, next_offset, rec_size;
+       gint out_of_order;
+       glong fpos;  /*file position indicator */
+       guchar attrib;
+       guint unique_id;
+       gint cat_id = 0;
        mem_rec_header *mem_rh, *temp_mem_rh, *last_mem_rh;
        record_header rh;
        RawDBHeader rdbh;
@@ -590,15 +605,15 @@ static gint jpilot_read_file( JPilotFile *pilotFile ) {
        gint retVal;
        struct Address addr;
        struct AddressAppInfo *ai;
-       char **addrEnt;
-       int inum, k;
+       gchar **addrEnt;
+       gint inum, k;
        gchar fullName[ FULLNAME_BUFSIZE ];
        gchar bufEMail[ EMAIL_BUFSIZE ];
        gchar* extID;
        ItemPerson *person;
        ItemEMail *email;
-       int *indPhoneLbl;
-       char *labelEntry;
+       gint *indPhoneLbl;
+       gchar *labelEntry;
        GList *node;
        ItemFolder *folderInd[ JPILOT_NUM_CATEG ];
 
@@ -713,7 +728,8 @@ static gint jpilot_read_file( JPilotFile *pilotFile ) {
 
                // Now go load all records              
                while(!feof(in)) {
-                       struct CategoryAppInfo *cat = & ai->category;
+                       //struct CategoryAppInfo *cat = &ai->category;
+
                        fpos = ftell(in);
                        if (out_of_order) {
                                find_next_offset(mem_rh, fpos, &next_offset, &attrib, &unique_id);
@@ -775,7 +791,7 @@ static gint jpilot_read_file( JPilotFile *pilotFile ) {
                                // Add entry for each email address listed under phone labels.
                                indPhoneLbl = addr.phoneLabel;
                                for( k = 0; k < JPILOT_NUM_ADDR_PHONE; k++ ) {
-                                       int ind;
+                                       gint ind;
                                        ind = indPhoneLbl[k];
                                        /*
                                        fprintf( stdout, "%d : %d : %20s : %s\n", k, ind,
@@ -860,7 +876,7 @@ static gint jpilot_read_metadata( JPilotFile *pilotFile ) {
        unsigned char *buf;
        int num;
 
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, -1 );
 
        pilotFile->readMetadata = FALSE;
        addrcache_clear( pilotFile->addressCache );
@@ -896,7 +912,7 @@ static gboolean jpilot_setup_labels( JPilotFile *pilotFile ) {
        struct AddressAppInfo *ai;
        GList *node;
 
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, -1 );
 
        // Release indexes
        node = pilotFile->labelInd;
@@ -933,7 +949,9 @@ static gboolean jpilot_setup_labels( JPilotFile *pilotFile ) {
 */
 GList *jpilot_load_label( JPilotFile *pilotFile, GList *labelList ) {
        int i;
-       g_return_if_fail( pilotFile != NULL );
+
+       g_return_val_if_fail( pilotFile != NULL, NULL );
+
        if( pilotFile->readMetadata ) {
                struct AddressAppInfo *ai = & pilotFile->addrInfo;
                for( i = 0; i < JPILOT_NUM_LABELS; i++ ) {
@@ -956,7 +974,9 @@ GList *jpilot_load_label( JPilotFile *pilotFile, GList *labelList ) {
 */
 gchar *jpilot_get_category_name( JPilotFile *pilotFile, gint catID ) {
        gchar *catName = NULL;
-       g_return_if_fail( pilotFile != NULL );
+
+       g_return_val_if_fail( pilotFile != NULL, NULL );
+
        if( pilotFile->readMetadata ) {
                struct AddressAppInfo *ai = & pilotFile->addrInfo;
                struct CategoryAppInfo *cat = & ai->category;
@@ -974,8 +994,10 @@ gchar *jpilot_get_category_name( JPilotFile *pilotFile, gint catID ) {
 * Load list with character strings of phone label names.
 */
 GList *jpilot_load_phone_label( JPilotFile *pilotFile, GList *labelList ) {
-       int i;
-       g_return_if_fail( pilotFile != NULL );
+       gint i;
+
+       g_return_val_if_fail( pilotFile != NULL, NULL );
+
        if( pilotFile->readMetadata ) {
                struct AddressAppInfo *ai = & pilotFile->addrInfo;
                for( i = 0; i < JPILOT_NUM_PHONELABELS; i++ ) {
@@ -996,8 +1018,9 @@ GList *jpilot_load_phone_label( JPilotFile *pilotFile, GList *labelList ) {
 * are loaded.
 */
 GList *jpilot_load_custom_label( JPilotFile *pilotFile, GList *labelList ) {
-       int i;
-       g_return_if_fail( pilotFile != NULL );
+       gint i;
+
+       g_return_val_if_fail( pilotFile != NULL, NULL );
 
        if( pilotFile->readMetadata ) {
                struct AddressAppInfo *ai = & pilotFile->addrInfo;
@@ -1020,8 +1043,10 @@ GList *jpilot_load_custom_label( JPilotFile *pilotFile, GList *labelList ) {
 */
 GList *jpilot_get_category_list( JPilotFile *pilotFile ) {
        GList *catList = NULL;
-       int i;
-       g_return_if_fail( pilotFile != NULL );
+       gint i;
+
+       g_return_val_if_fail( pilotFile != NULL, NULL );
+
        if( pilotFile->readMetadata ) {
                struct AddressAppInfo *ai = & pilotFile->addrInfo;
                struct CategoryAppInfo *cat = & ai->category;
@@ -1045,6 +1070,7 @@ static void jpilot_build_category_list( JPilotFile *pilotFile ) {
        struct AddressAppInfo *ai = & pilotFile->addrInfo;
        struct CategoryAppInfo *cat = & ai->category;
        gint i;
+
        for( i = 0; i < JPILOT_NUM_CATEG; i++ ) {
                ItemFolder *folder = addritem_create_item_folder();
                addritem_folder_set_name( folder, cat->name[i] );
@@ -1098,7 +1124,8 @@ static void jpilot_remove_empty( JPilotFile *pilotFile ) {
 */
 // ============================================================================================
 gint jpilot_read_data( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, -1 );
+
        pilotFile->retVal = MGU_SUCCESS;
        pilotFile->accessFlag = FALSE;
        if( addrcache_check_file( pilotFile->addressCache, pilotFile->path ) ) {
@@ -1123,7 +1150,7 @@ gint jpilot_read_data( JPilotFile *pilotFile ) {
 * Return link list of persons.
 */
 GList *jpilot_get_list_person( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, NULL );
        return addrcache_get_list_person( pilotFile->addressCache );
 }
 
@@ -1133,7 +1160,7 @@ GList *jpilot_get_list_person( JPilotFile *pilotFile ) {
 * Return: NULL.
 */
 GList *jpilot_get_list_folder( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, NULL );
        return addrcache_get_list_folder( pilotFile->addressCache );
 }
 
@@ -1144,7 +1171,7 @@ GList *jpilot_get_list_folder( JPilotFile *pilotFile ) {
 * Return: List of items, or NULL if none.
 */
 GList *jpilot_get_all_persons( JPilotFile *pilotFile ) {
-       g_return_if_fail( pilotFile != NULL );
+       g_return_val_if_fail( pilotFile != NULL, NULL );
        return addrcache_get_all_persons( pilotFile->addressCache );
 }
 
@@ -1152,8 +1179,9 @@ GList *jpilot_get_all_persons( JPilotFile *pilotFile ) {
 * Check label list for specified label.
 */
 gint jpilot_check_label( struct AddressAppInfo *ai, gchar *lblCheck ) {
-       int i;
-       gchar   *lblName;
+       gint i;
+       gchar *lblName;
+
        if( lblCheck == NULL ) return -1;
        if( strlen( lblCheck ) < 1 ) return -1;
        for( i = 0; i < JPILOT_NUM_LABELS; i++ ) {
@@ -1173,7 +1201,8 @@ gint jpilot_check_label( struct AddressAppInfo *ai, gchar *lblCheck ) {
 */
 gboolean jpilot_validate( const JPilotFile *pilotFile ) {
        gboolean retVal;
-       g_return_if_fail( pilotFile != NULL );
+
+       g_return_val_if_fail( pilotFile != NULL, FALSE );
 
        retVal = TRUE;
        if( pilotFile->path ) {
@@ -1237,6 +1266,7 @@ gchar *jpilot_find_pilotdb( void ) {
 gint jpilot_test_read_file( const gchar *fileSpec ) {
        JPilotFile *pilotFile;
        gint retVal;
+
        if( fileSpec ) {
                pilotFile = jpilot_create_path( fileSpec );
                retVal = jpilot_read_metadata( pilotFile );
@@ -1256,7 +1286,8 @@ gint jpilot_test_read_file( const gchar *fileSpec ) {
 gboolean jpilot_test_custom_label( JPilotFile *pilotFile, const gchar *labelName ) {
        gboolean retVal;
        GList *node;
-       g_return_if_fail( pilotFile != NULL );
+
+       g_return_val_if_fail( pilotFile != NULL, FALSE );
 
        retVal = FALSE;
        if( labelName ) {
@@ -1276,7 +1307,7 @@ gboolean jpilot_test_custom_label( JPilotFile *pilotFile, const gchar *labelName
 * Test whether pilot link library installed.
 * Return: TRUE if library available.
 */
-gboolean jpilot_test_pilot_lib() {
+gboolean jpilot_test_pilot_lib( void ) {
        void *handle, *fun;
 
        handle = dlopen( PILOT_LINK_LIB_NAME, RTLD_LAZY );
@@ -1305,5 +1336,3 @@ gboolean jpilot_test_pilot_lib() {
 /*
 * End of Source.
 */
-
-
index a3b7254..6d8edf1 100644 (file)
 #ifndef __JPILOT_H__
 #define __JPILOT_H__
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #ifdef USE_JPILOT
 
-#include <stdio.h>
 #include <glib.h>
-#include <pi-address.h>
+#include <stdio.h>
+
+#ifdef HAVE_LIBPISOCK_PI_ADDRESS_H
+#  include <libpisock/pi-address.h>
+#else
+#  include <pi-address.h>
+#endif
 
 #include "addritem.h"
 #include "addrcache.h"
index a07904a..ff38950 100644 (file)
@@ -276,6 +276,12 @@ static void mark_as_unread_cb              (MainWindow     *mainwin,
 static void mark_as_read_cb            (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
+static void mark_all_read_cb           (MainWindow     *mainwin,
+                                        guint           action,
+                                        GtkWidget      *widget);
+static void add_address_cb             (MainWindow     *mainwin,
+                                        guint           action,
+                                        GtkWidget      *widget);
 
 static void set_charset_cb             (MainWindow     *mainwin,
                                         guint           action,
@@ -314,27 +320,24 @@ static void next_cb                (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
 
-static void next_unread_cb      (MainWindow    *mainwin,
+static void prev_unread_cb      (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
-
-static void next_marked_cb      (MainWindow    *mainwin,
+static void next_unread_cb      (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
-
 static void prev_marked_cb      (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
-
-static void next_labeled_cb     (MainWindow    *mainwin,
+static void next_marked_cb      (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
-
-
 static void prev_labeled_cb     (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
-
+static void next_labeled_cb     (MainWindow    *mainwin,
+                                 guint          action,
+                                 GtkWidget     *widget);
 
 static void goto_folder_cb      (MainWindow    *mainwin,
                                  guint          action,
@@ -545,15 +548,25 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Summary/E_xecute"),              "<alt>X", execute_summary_cb, 0, NULL},
        {N_("/_Summary/_Update"),               "<alt>U", update_summary_cb,  0, NULL},
        {N_("/_Summary/---"),                   NULL, NULL, 0, "<Separator>"},
-       {N_("/_Summary/_Prev message"),         NULL, prev_cb, 0, NULL},
-       {N_("/_Summary/_Next message"),         NULL, next_cb, 0, NULL},
-       {N_("/_Summary/N_ext unread message"),  NULL, next_unread_cb, 0, NULL},
-       {N_("/_Summary/Prev marked message"),   NULL, prev_marked_cb, 0, NULL},
-       {N_("/_Summary/Next marked message"),   NULL, next_marked_cb, 0, NULL},
-       {N_("/_Summary/Prev labeled message"),  NULL, prev_labeled_cb, 0, NULL},
-       {N_("/_Summary/Next labeled message"),  NULL, next_labeled_cb, 0, NULL},
-       {N_("/_Summary/---"),                   NULL, NULL, 0, "<Separator>"},
-       {N_("/_Summary/_Go to other folder"),   "<alt>G", goto_folder_cb, 0, NULL},
+       {N_("/_Summary/Go _to"),                NULL, NULL, 0, "<Branch>"},
+       {N_("/_Summary/Go _to/_Prev message"),  NULL, prev_cb, 0, NULL},
+       {N_("/_Summary/Go _to/_Next message"),  NULL, next_cb, 0, NULL},
+       {N_("/_Summary/Go _to/---"),            NULL, NULL, 0, "<Separator>"},
+       {N_("/_Summary/Go _to/P_rev unread message"),
+                                               NULL, prev_unread_cb, 0, NULL},
+       {N_("/_Summary/Go _to/N_ext unread message"),
+                                               NULL, next_unread_cb, 0, NULL},
+       {N_("/_Summary/Go _to/---"),            NULL, NULL, 0, "<Separator>"},
+       {N_("/_Summary/Go _to/Prev _marked message"),
+                                               NULL, prev_marked_cb, 0, NULL},
+       {N_("/_Summary/Go _to/Next m_arked message"),
+                                               NULL, next_marked_cb, 0, NULL},
+       {N_("/_Summary/Go _to/---"),            NULL, NULL, 0, "<Separator>"},
+       {N_("/_Summary/Go _to/Prev _labeled message"),
+                                               NULL, prev_labeled_cb, 0, NULL},
+       {N_("/_Summary/Go _to/Next la_beled message"),
+                                               NULL, next_labeled_cb, 0, NULL},
+       {N_("/_Summary/_Go to other folder..."),"<alt>G", goto_folder_cb, 0, NULL},
        {N_("/_Summary/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Summary/_Sort"),                 NULL, NULL, 0, "<Branch>"},
        {N_("/_Summary/_Sort/Sort by _number"), NULL, sort_summary_cb, SORT_BY_NUMBER, NULL},
@@ -561,8 +574,12 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Summary/_Sort/Sort by _date"),   NULL, sort_summary_cb, SORT_BY_DATE, NULL},
        {N_("/_Summary/_Sort/Sort by _from"),   NULL, sort_summary_cb, SORT_BY_FROM, NULL},
        {N_("/_Summary/_Sort/Sort by _subject"),NULL, sort_summary_cb, SORT_BY_SUBJECT, NULL},
-       {N_("/_Summary/_Sort/Sort by sco_re"),  NULL, sort_summary_cb, SORT_BY_SCORE, NULL},
-       {N_("/_Summary/_Sort/Sort by _label"),  NULL, sort_summary_cb, SORT_BY_LABEL, NULL},
+       {N_("/_Summary/_Sort/Sort by _color label"),
+                                               NULL, sort_summary_cb, SORT_BY_LABEL, NULL},
+       {N_("/_Summary/_Sort/Sort by _mark"),   NULL, sort_summary_cb, SORT_BY_MARK, NULL},
+       {N_("/_Summary/_Sort/Sort by _unread"), NULL, sort_summary_cb, SORT_BY_UNREAD, NULL},
+       {N_("/_Summary/_Sort/Sort by a_ttachment"),
+                                               NULL, sort_summary_cb, SORT_BY_MIME, NULL},
        {N_("/_Summary/_Sort/---"),             NULL, NULL, 0, "<Separator>"},
        {N_("/_Summary/_Sort/_Attract by subject"),
                                                NULL, attract_by_subject_cb, 0, NULL},
@@ -1291,29 +1308,34 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/View/Show all header"      , M_SINGLE_TARGET_EXIST},
                {"/View/View source"          , M_SINGLE_TARGET_EXIST},
 
-               {"/Message/Get new mail"          , M_HAVE_ACCOUNT|M_UNLOCKED},
-               {"/Message/Get from all accounts" , M_HAVE_ACCOUNT|M_UNLOCKED},
-               {"/Message/Compose new message"   , M_HAVE_ACCOUNT},
-               {"/Message/Reply"                 , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Reply to sender"       , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Follow-up and reply to", M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Reply to all"          , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Forward"               , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Forward as attachment" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
-               {"/Message/Open in new window"    , M_SINGLE_TARGET_EXIST},
+               {"/Message/Get new mail"         , M_HAVE_ACCOUNT|M_UNLOCKED},
+               {"/Message/Get from all accounts", M_HAVE_ACCOUNT|M_UNLOCKED},
+               {"/Message/Compose new message"  , M_HAVE_ACCOUNT},
+               {"/Message/Reply"                , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {"/Message/Reply to sender"      , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {"/Message/Reply to all"         , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {"/Message/Forward"              , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {"/Message/Forward as attachment", M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {"/Message/Open in new window"   , M_SINGLE_TARGET_EXIST},
+               {"/Message/Re-edit", M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
                {"/Message/Move...", M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
                {"/Message/Copy...", M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
                {"/Message/Delete" , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
                {"/Message/Mark"   , M_TARGET_EXIST},
-               {"/Message/Re-edit", M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
+               {"/Message/Add sender to address book", M_SINGLE_TARGET_EXIST},
 
                {"/Summary/Delete duplicated messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
-               {"/Summary/Filter messages"    , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
-               {"/Summary/Execute"            , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
-               {"/Summary/Prev message"       , M_MSG_EXIST},
-               {"/Summary/Next message"       , M_MSG_EXIST},
-               {"/Summary/Next unread message", M_MSG_EXIST},
-               {"/Summary/Sort"               , M_MSG_EXIST},
+               {"/Summary/Filter messages"           , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+               {"/Summary/Execute"                   , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+               {"/Summary/Go to"                     , M_MSG_EXIST},
+               {"/Summary/Go to/Prev message"        , M_MSG_EXIST},
+               {"/Summary/Go to/Next message"        , M_MSG_EXIST},
+               {"/Summary/Go to/Next unread message" , M_MSG_EXIST},
+               {"/Summary/Go to/Prev marked message" , M_MSG_EXIST},
+               {"/Summary/Go to/Next marked message" , M_MSG_EXIST},
+               {"/Summary/Go to/Prev labeled message", M_MSG_EXIST},
+               {"/Summary/Go to/Next labeled message", M_MSG_EXIST},
+               {"/Summary/Sort"                      , M_MSG_EXIST},
 
                {"/Configuration", M_UNLOCKED},
 
@@ -2468,6 +2490,18 @@ static void mark_as_read_cb(MainWindow *mainwin, guint action,
        summary_mark_as_read(mainwin->summaryview);
 }
 
+static void mark_all_read_cb(MainWindow *mainwin, guint action,
+                            GtkWidget *widget)
+{
+       summary_mark_all_read(mainwin->summaryview);
+}
+
+static void add_address_cb(MainWindow *mainwin, guint action,
+                          GtkWidget *widget)
+{
+       summary_add_address(mainwin->summaryview);
+}
+
 static void set_charset_cb(MainWindow *mainwin, guint action,
                           GtkWidget *widget)
 {
@@ -2604,16 +2638,16 @@ static void next_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
        summary_step(mainwin->summaryview, GTK_SCROLL_STEP_FORWARD);
 }
 
-static void next_unread_cb(MainWindow *mainwin, guint action,
+static void prev_unread_cb(MainWindow *mainwin, guint action,
                           GtkWidget *widget)
 {
-       summary_select_next_unread(mainwin->summaryview);
+       summary_select_prev_unread(mainwin->summaryview);
 }
 
-static void next_marked_cb(MainWindow *mainwin, guint action,
+static void next_unread_cb(MainWindow *mainwin, guint action,
                           GtkWidget *widget)
 {
-       summary_select_next_marked(mainwin->summaryview);
+       summary_select_next_unread(mainwin->summaryview);
 }
 
 static void prev_marked_cb(MainWindow *mainwin, guint action,
@@ -2622,18 +2656,24 @@ static void prev_marked_cb(MainWindow *mainwin, guint action,
        summary_select_prev_marked(mainwin->summaryview);
 }
 
-static void next_labeled_cb(MainWindow *mainwin, guint action,
+static void next_marked_cb(MainWindow *mainwin, guint action,
                           GtkWidget *widget)
 {
-       summary_select_next_labeled(mainwin->summaryview);
+       summary_select_next_marked(mainwin->summaryview);
 }
 
 static void prev_labeled_cb(MainWindow *mainwin, guint action,
-                          GtkWidget *widget)
+                           GtkWidget *widget)
 {
        summary_select_prev_labeled(mainwin->summaryview);
 }
 
+static void next_labeled_cb(MainWindow *mainwin, guint action,
+                           GtkWidget *widget)
+{
+       summary_select_next_labeled(mainwin->summaryview);
+}
+
 static void goto_folder_cb(MainWindow *mainwin, guint action,
                           GtkWidget *widget)
 {
index ea61460..bb28c12 100644 (file)
@@ -32,7 +32,7 @@
 void mgu_print_list( GSList *list, FILE *stream ) {
        GSList *node = list;
        while( node ) {
-               fprintf( stream, "\t- >%s<\n", node->data );
+               fprintf( stream, "\t- >%s<\n", (gchar *)node->data );
                node = g_slist_next( node );
        }
 }
@@ -43,7 +43,7 @@ void mgu_print_list( GSList *list, FILE *stream ) {
 void mgu_print_dlist( GList *list, FILE *stream ) {
        GList *node = list;
        while( node ) {
-               fprintf( stream, "\t- >%s<\n", node->data );
+               fprintf( stream, "\t- >%s<\n", (gchar *)node->data );
                node = g_list_next( node );
        }
 }
index 0ed9ab8..abcefe1 100644 (file)
@@ -834,7 +834,7 @@ static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo,
                        return;
        }
 
-       execute_command_line(buf);
+       execute_command_line(buf, TRUE);
 }
 
 #if USE_GPGME
index f8539fc..6edf902 100644 (file)
@@ -1,34 +1,34 @@
 /* XPM */
-static char * DIRECTORY_CLOSE_XPM[] = {
+static char * dir_close_xpm[] = {
 "16 16 28 1",
 "      c None",
 ".     c #000000",
-"+     c #8F98C4",
-"@     c #7277AB",
-"#     c #757EB0",
-"$     c #606497",
-"%     c #D1D5F6",
-"&     c #BDC1E8",
-"*     c #D6D8F7",
-"=     c #9CA1DB",
-"-     c #AFB2EC",
-";     c #B4BCE3",
-">     c #989FD1",
-",     c #AAB2D3",
-"'     c #9197C6",
-")     c #8A92C3",
-"!     c #7A7FB7",
-"~     c #606499",
-"{     c #C7CCF0",
-"]     c #595A88",
-"^     c #52537B",
-"/     c #7E87B9",
-"(     c #6C72A9",
-"_     c #898FC0",
-":     c #6B6EA6",
-"<     c #4B4D6E",
-"[     c #AFB8DC",
-"}     c #3D3F60",
+"+     c #A1ACDA",
+"@     c #7C83C1",
+"#     c #808CC7",
+"$     c #656AAB",
+"%     c #E5E9FD",
+"&     c #D4D7F6",
+"*     c #E9EBFD",
+"=     c #B1B6ED",
+"-     c #C6C9F8",
+";     c #CBD3F3",
+">     c #ACB4E5",
+",     c #C0C9E7",
+"'     c #A4ABDC",
+")     c #9BA5D9",
+"!     c #878DCE",
+"~     c #656AAD",
+"{     c #DDE1FA",
+"]     c #5C5D99",
+"^     c #545588",
+"/     c #8C97D0",
+"(     c #747CBF",
+"_     c #9AA1D7",
+":     c #7377BC",
+"<     c #4C4E77",
+"[     c #C6CFEE",
+"}     c #3C3E65",
 "                ",
 "                ",
 "    ....        ",
index ebde5db..0bc602e 100644 (file)
@@ -1,40 +1,39 @@
 /* XPM */
-static char * DIRECTORY_OPEN_XPM[] = {
-"16 16 34 1",
+static char * dir_open_xpm[] = {
+"16 16 33 1",
 "      c None",
 ".     c #000000",
-"+     c #8F98C4",
-"@     c #7277AB",
-"#     c #757EB0",
-"$     c #606497",
-"%     c #7F83C2",
-"&     c #686CA3",
-"*     c #797FB2",
-"=     c #666BA1",
-"-     c #5D6194",
-";     c #505173",
-">     c #434562",
-",     c #232436",
-"'     c #606499",
-")     c #BAC0E7",
-"!     c #C1C7EC",
-"~     c #ABB3D8",
-"{     c #3B3C58",
-"]     c #484969",
-"^     c #C7CCF0",
-"/     c #A2ACCD",
-"(     c #7F87AE",
-"_     c #9FA9C6",
-":     c #3F4160",
-"<     c #B3B7EC",
-"[     c #5B6080",
-"}     c #252544",
-"|     c #787FB1",
-"1     c #393A58",
-"2     c #B5BDE4",
-"3     c #50526D",
-"4     c #8E94CD",
-"5     c #666D97",
+"+     c #A7B2DF",
+"@     c #7F86C7",
+"#     c #8390CD",
+"$     c #666BB1",
+"%     c #9297DE",
+"&     c #7177BF",
+"*     c #8992CF",
+"=     c #6E75BC",
+"-     c #6267AD",
+";     c #515381",
+">     c #424469",
+",     c #222334",
+"'     c #666BB3",
+")     c #D6DCF8",
+"!     c #DDE2FA",
+"~     c #C7D0EF",
+"{     c #393A5B",
+"]     c #484972",
+"^     c #E2E6FC",
+"/     c #BEC8E7",
+"(     c #929CCB",
+"_     c #BAC5E1",
+":     c #3E4066",
+"<     c #D0D4FA",
+"[     c #5F6693",
+"}     c #8892CE",
+"|     c #37385B",
+"1     c #D2D9F6",
+"2     c #515478",
+"3     c #A5ADE7",
+"4     c #6E78B1",
 "                ",
 "                ",
 "    ....        ",
@@ -45,9 +44,9 @@ static char * DIRECTORY_OPEN_XPM[] = {
 ".)!~!~!~!~!~.{].",
 ".^/(_(_(_(_(.{:.",
 " .<_(_(_(_(_[.:.",
-" }!|_(_(_(_(_.1.",
-"  }2(_(_(_(_(3..",
-"  .4(5(5(5(5(5..",
+" .!}_(_(_(_(_.|.",
+"  .1(_(_(_(_(2..",
+"  .3(4(4(4(4(4..",
 "   ............ ",
 "                ",
 "                "};
index 1f26090..7499261 100644 (file)
@@ -1,76 +1,62 @@
 /* XPM */
 static char * new_xpm[] = {
-"13 10 63 1",
+"13 10 49 1",
 "      c None",
-".     c #360000",
-"+     c #430000",
-"@     c #370000",
-"#     c #FF0000",
-"$     c #FFC7C4",
-"%     c #FFC7C5",
-"&     c #FFC7C3",
-"*     c #FFC6C1",
-"=     c #FFC6C2",
-"-     c #FFC6C3",
-";     c #FFC5C1",
-">     c #BA0000",
-",     c #FFC6C0",
-"'     c #FFC1B7",
-")     c #FFC2BA",
-"!     c #FFC4BE",
-"~     c #FF7163",
-"{     c #FFAC9F",
-"]     c #FFC7C0",
-"^     c #FFC5BB",
-"/     c #FFC4B7",
-"(     c #FFC5BC",
-"_     c #FFC4BA",
-":     c #FFADA2",
-"<     c #FF5846",
-"[     c #FFC7C6",
-"}     c #FFC6BF",
-"|     c #FFC7C2",
-"1     c #FFC6BB",
-"2     c #FFB7A9",
-"3     c #FFAEA1",
-"4     c #3B0000",
-"5     c #FFC0B8",
-"6     c #FFB8A7",
-"7     c #FFC6B9",
-"8     c #FFC3B7",
-"9     c #FFBFB4",
-"0     c #FF6A56",
-"a     c #FFC6BE",
-"b     c #FFC5B7",
-"c     c #FFC4B5",
-"d     c #FFBFAD",
-"e     c #FF8973",
-"f     c #FF4C36",
-"g     c #FFC2B9",
-"h     c #FFC5BA",
-"i     c #FFBCAA",
-"j     c #FFC2B4",
-"k     c #FFC0B3",
-"l     c #FF684E",
-"m     c #C70000",
-"n     c #FFAA9E",
-"o     c #FF503D",
-"p     c #FF4F39",
-"q     c #FF3B21",
-"r     c #FF6E54",
-"s     c #FF684B",
-"t     c #FF9078",
-"u     c #FF7E66",
-"v     c #FF543B",
-"w     c #FF8675",
-"x     c #8E0000",
-" .+...@..... ",
-".#$%&*=$$-;>.",
-".-#*,%'*)!#~.",
-"@={#]^/(_#:<.",
-".[=}#|1]#23:.",
-"45&6##7##890.",
-".$'#ab#cd#ef@",
-".-#g^hijklmn.",
-".#opqrstuvwx.",
-" ...@......@ "};
+".     c #000000",
+"+     c #D52828",
+"@     c #F5CECD",
+"#     c #F5CFCE",
+"$     c #F4CECB",
+"%     c #F4CDCB",
+"&     c #9C1D1D",
+"*     c #F4CDC9",
+"=     c #F3C8C2",
+"-     c #F3C8C4",
+";     c #F4CAC7",
+">     c #E5837C",
+",     c #EFB6AE",
+"'     c #F3CCC6",
+")     c #F3CAC2",
+"!     c #F3CBC6",
+"~     c #F3CBC4",
+"{     c #EFB7B0",
+"]     c #E06F63",
+"^     c #F5CECE",
+"/     c #F0BFB7",
+"(     c #F3C7C2",
+"_     c #F0C0B5",
+":     c #F3CCC4",
+"<     c #F2C6BF",
+"[     c #E37E70",
+"}     c #F4CDC7",
+"|     c #F3CBC2",
+"1     c #F2CAC1",
+"2     c #F1C6BA",
+"3     c #E89789",
+"4     c #DE6255",
+"5     c #F3CAC4",
+"6     c #F0C3B7",
+"7     c #F2C7BF",
+"8     c #E27A69",
+"9     c #A61F1F",
+"0     c #EEB4AD",
+"a     c #DF685C",
+"b     c #DE6559",
+"c     c #DA5345",
+"d     c #E37F6E",
+"e     c #E17968",
+"f     c #E89C8D",
+"g     c #E58C7E",
+"h     c #DF6A5A",
+"i     c #E8968B",
+"j     c #771616",
+" ........... ",
+".+@#@$%@@@%&.",
+".@+$*#=$-;+>.",
+".%,+*')!~+{].",
+".^%*+$'*+/{{.",
+".(@_++:++)<[.",
+".@=+}|+12+34.",
+".@+5'~677890.",
+".+abcdefghij.",
+" ........... "};
index 6cdbadc..a201902 100644 (file)
@@ -1,28 +1,28 @@
 /* XPM */
-static char *trash_xpm[] = {
+static char * trash_xpm[] = {
 "16 16 10 1",
 "      c None",
 ".     c #000000",
-"+     c #191B2E",
-"@     c #93A6D8",
-"#     c #7386BC",
-"$     c #3B4762",
-"%     c #272A42",
-"&     c #5A679D",
-"*     c #C1CDF4",
-"=     c #515E74",
+"+     c #A1B7E7",
+"@     c #7B92CE",
+"#     c #3B4766",
+"$     c #272A42",
+"%     c #1B1C2E",
+"&     c #5D6CAD",
+"*     c #D2DEFB",
+"=     c #52617C",
 "                ",
 "   ......       ",
-" +.@@#$##..     ",
-".#@@@%+###&.    ",
-".&@**####&=.    ",
-".=&##&&==$$.    ",
-" .+&==$$%+.     ",
-" .=++++++=.     ",
-" .=@$#$&$=....  ",
-" .=@$#$&$=..... ",
-" .=@$#$&$=..... ",
-" .&@$#$&$=....  ",
+" ..++@#@@..     ",
+".@+++$%@@@&.    ",
+".&+**@@@@&=.    ",
+".=&@@&&==##.    ",
+" .%&==##$%.     ",
+" .=%%%%%%=.     ",
+" .=+#@#&#=....  ",
+" .=+#@#&#=..... ",
+" .=+#@#&#=..... ",
+" .&+#@#&#=....  ",
 "  .&&&=&=...    ",
 "   .......      ",
 "                ",
index b1c2f76..c5a864b 100644 (file)
@@ -1,59 +1,51 @@
 /* XPM */
 static char * unread_xpm[] = {
-"13 10 46 1",
+"13 10 38 1",
 "      c None",
-".     c #000036",
-"+     c #000040",
-"@     c #0000FF",
-"#     c #C6C7FF",
-"$     c #C7C7FF",
-"%     c #C6C6FF",
-"&     c #C7C6FF",
-"*     c #C6C5FF",
-"=     c #0000AF",
-"-     c #C3C1FF",
-";     c #C3C2FF",
-">     c #C6C4FF",
-",     c #7371FF",
-"'     c #AEACFF",
-")     c #C7C5FF",
-"!     c #B1ADFF",
-"~     c #5E58FF",
-"{     c #0000DA",
-"]     c #BBB7FF",
-"^     c #B2AEFF",
-"/     c #000038",
-"(     c #C3C0FF",
-"_     c #BBB8FF",
-":     c #0000E3",
-"<     c #0000F9",
-"[     c #C6C3FF",
-"}     c #C3BFFF",
-"|     c #766AFF",
-"1     c #C7C4FF",
-"2     c #9289FF",
-"3     c #5A4CFF",
-"4     c #C0BCFF",
-"5     c #C6C2FF",
-"6     c #7368FF",
-"7     c #0000AD",
-"8     c #AEAAFF",
-"9     c #5250FF",
-"0     c #524FFF",
-"a     c #413BFF",
-"b     c #766EFF",
-"c     c #9890FF",
-"d     c #857EFF",
-"e     c #5D54FF",
-"f     c #8C86FF",
-"g     c #00007E",
-" .+......... ",
-".@#$$%&$$%*=.",
-".%@&&$-&;>@,.",
-".%'@$*>)>@!~.",
-".$&&@$&${]^!.",
-"/($_@:&<@[}|.",
-".$-@&)@1}@23.",
-".&@;*)45(678.",
-".@90ab6cdefg.",
+".     c #000000",
+"+     c #2828D5",
+"@     c #CECFF5",
+"#     c #D0D0F5",
+"$     c #CECEF5",
+"%     c #1B1B92",
+"&     c #CCCBF4",
+"*     c #CBCBF4",
+"=     c #CDCDF5",
+"-     c #8888E7",
+";     c #BAB8F1",
+">     c #CFCEF5",
+",     c #BDBAF1",
+"'     c #7572E3",
+")     c #2222B7",
+"!     c #C5C2F3",
+"~     c #CBC9F4",
+"{     c #C3C2F3",
+"]     c #2323BE",
+"^     c #2727D0",
+"/     c #CECDF5",
+"(     c #8881E6",
+"_     c #A29CEB",
+":     c #7068E1",
+"<     c #C8C6F3",
+"[     c #CDCBF4",
+"}     c #867FE6",
+"|     c #1B1B90",
+"1     c #B9B7F0",
+"2     c #6B6BE2",
+"3     c #5E5ADF",
+"4     c #8984E7",
+"5     c #A6A1EC",
+"6     c #9692E9",
+"7     c #746EE3",
+"8     c #9C99EA",
+"9     c #141469",
+" ........... ",
+".+@##$$##$$%.",
+".$+$$#&$*=+-.",
+".$;+#$=>=+,'.",
+".#$$+#$#)!,,.",
+".~#{+]$^+/~(.",
+".#&+$>+/~+_:.",
+".$+*$><[~}|1.",
+".+2234}56789.",
 " ........... "};
index 256105c..2a5df2c 100644 (file)
@@ -35,7 +35,7 @@ typedef struct _PrefsDialog   PrefsDialog;
 
 #include "account.h"
 
-#define VSPACING               12
+#define VSPACING               10
 #define VSPACING_NARROW                4
 #define VSPACING_NARROW_2      2
 #define VBOX_BORDER            16
index 1c97a30..588262a 100644 (file)
@@ -102,6 +102,7 @@ static struct Compose {
        GtkWidget *entry_fw_quotemark;
        GtkWidget *text_fw_quotefmt;
 
+       GtkWidget *checkbtn_autoextedit;
        GtkWidget *checkbtn_reply_account_autosel;
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
@@ -231,7 +232,7 @@ static PrefParam param[] = {
        {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
         &receive.checkbtn_incext,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_path, P_STRING,
+       {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
         &receive.entry_incext,
         prefs_set_data_from_entry, prefs_set_entry},
 
@@ -305,6 +306,9 @@ static PrefParam param[] = {
        {"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING,
         &compose.entry_sigsep, prefs_set_data_from_entry, prefs_set_entry},
 
+       {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
+        &compose.checkbtn_autoextedit,
+        prefs_set_data_from_toggle, prefs_set_toggle},
         {"reply_account_autoselect", "TRUE",
         &prefs_common.reply_account_autosel, P_BOOL,
         &compose.checkbtn_reply_account_autosel,
@@ -1201,6 +1205,8 @@ static void prefs_compose_btn_ispell_path_clicked_cb(GtkWidget *widget,
 static void prefs_compose_create(void)
 {
        GtkWidget *vbox1;
+        GtkWidget *vbox2;
+        GtkWidget *vbox3;
 
        /*
        GtkWidget *frame_quote;
@@ -1233,6 +1239,8 @@ static void prefs_compose_create(void)
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
 
+       GtkWidget *checkbtn_autoextedit;
+
         GtkWidget *vbox_linewrap;
 
        GtkWidget *hbox3;
@@ -1272,22 +1280,26 @@ static void prefs_compose_create(void)
        gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
        gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
 
-       PACK_CHECK_BUTTON (vbox_quote, checkbtn_quote,
-                          _("Quote message when replying"));
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
+       hbox1 = gtk_hbox_new (FALSE, 32);
        gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
+
+       hbox2 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox2);
+       gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
 
        label_quotemark = gtk_label_new (_("Quotation mark"));
        gtk_widget_show (label_quotemark);
-       gtk_box_pack_start (GTK_BOX (hbox1), label_quotemark, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
 
        entry_quotemark = gtk_entry_new ();
        gtk_widget_show (entry_quotemark);
-       gtk_box_pack_start (GTK_BOX (hbox1), entry_quotemark, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
        gtk_widget_set_usize (entry_quotemark, 64, -1);
 
+       PACK_CHECK_BUTTON (hbox1, checkbtn_quote,
+                          _("Quote message when replying"));
+
        hbox2 = gtk_hbox_new (FALSE, 0);
        gtk_widget_show (hbox2);
        gtk_box_pack_start (GTK_BOX (vbox_quote), hbox2, TRUE, TRUE, 0);
@@ -1367,7 +1379,16 @@ static void prefs_compose_create(void)
        PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
                           _("when re-editing"));
 
-       /* line-wrapping */
+       vbox2 = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox2);
+       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
+                          _("Automatically launch the external editor"));
+
+       PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
+
+        /* line-wrapping */
        vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
        gtk_widget_show (vbox_linewrap);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox_linewrap, FALSE, FALSE, 0);
@@ -1393,6 +1414,8 @@ static void prefs_compose_create(void)
        gtk_widget_show (label_linewrap);
        gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
 
+       PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
+
        hbox4 = gtk_hbox_new (FALSE, 32);
        gtk_widget_show (hbox4);
        gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
@@ -1467,6 +1490,7 @@ static void prefs_compose_create(void)
        compose.checkbtn_autosig = checkbtn_autosig;
        compose.entry_sigsep     = entry_sigsep;
 
+       compose.checkbtn_autoextedit = checkbtn_autoextedit;
         compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
        compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
        compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
@@ -2211,6 +2235,7 @@ static void prefs_other_create(void)
        gtk_box_pack_start (GTK_BOX (hbox1), exteditor_combo, TRUE, TRUE, 0);
        gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
                               "gedit %s",
+                              "kedit %s",
                               "mgedit --no-fork %s",
                               "emacs %s",
                               "xemacs %s",
index 0451c85..5a903d6 100644 (file)
@@ -42,7 +42,7 @@ struct _PrefsCommon
 {
        /* Receive */
        gboolean use_extinc;
-       gchar *extinc_path;
+       gchar *extinc_cmd;
        gboolean inc_local;
        gboolean filter_on_inc;
        gchar *spool_path;
@@ -69,6 +69,7 @@ struct _PrefsCommon
        gint linewrap_len;
        gboolean linewrap_quote;
        gboolean linewrap_at_send;
+       gboolean auto_exteditor;
        gboolean reply_account_autosel;
        gboolean forward_account_autosel;
        gboolean reedit_account_autosel;
index dcd362a..1a9e1da 100644 (file)
@@ -58,11 +58,6 @@ static struct CustomHdr {
        GtkWidget *customhdr_clist;
 } customhdr;
 
-#define VSPACING               12
-#define VSPACING_NARROW                4
-#define DEFAULT_ENTRY_WIDTH    80
-#define PREFSBUFSIZE           1024
-
 /* widget creating functions */
 static void prefs_custom_header_create (void);
 
index 99beec2..1acbc4b 100644 (file)
@@ -56,18 +56,6 @@ static struct DisplayHeader {
        GtkWidget *other_headers;
 } dispheader;
 
-/*
-   parameter name, default value, pointer to the prefs variable, data type,
-   pointer to the widget pointer,
-   pointer to the function for data setting,
-   pointer to the function for widget setting
- */
-
-#define VSPACING               12
-#define VSPACING_NARROW                4
-#define DEFAULT_ENTRY_WIDTH    80
-#define PREFSBUFSIZE           1024
-
 /* widget creating functions */
 static void prefs_display_header_create        (void);
 
index f0ae198..3c54b41 100644 (file)
@@ -81,11 +81,6 @@ static struct Filter {
    pointer to the function for widget setting
  */
 
-#define VSPACING               12
-#define VSPACING_NARROW                4
-#define DEFAULT_ENTRY_WIDTH    80
-#define PREFSBUFSIZE           1024
-
 /* widget creating functions */
 static void prefs_filter_create                (void);
 
index 7263f6c..0dc0bd1 100644 (file)
@@ -74,11 +74,6 @@ static struct Filtering {
        gint current_action;
 } filtering;
 
-#define VSPACING               12
-#define VSPACING_NARROW                4
-#define DEFAULT_ENTRY_WIDTH    80
-#define PREFSBUFSIZE           1024
-
 /* widget creating functions */
 static void prefs_filtering_create             (void);
 
index 5b3cea6..353f468 100644 (file)
@@ -157,29 +157,27 @@ static void summary_select_node           (SummaryView            *summaryview,
 static guint summary_get_msgnum                (SummaryView            *summaryview,
                                         GtkCTreeNode           *node);
 
-static GtkCTreeNode *summary_find_next_unread_msg
+static GtkCTreeNode *summary_find_prev_unread_msg
                                        (SummaryView            *summaryview,
                                         GtkCTreeNode           *current_node);
-static GtkCTreeNode *summary_find_next_marked_msg
+static GtkCTreeNode *summary_find_next_unread_msg
                                        (SummaryView            *summaryview,
                                         GtkCTreeNode           *current_node);
 static GtkCTreeNode *summary_find_prev_marked_msg
                                        (SummaryView            *summaryview,
                                         GtkCTreeNode           *current_node);
-static GtkCTreeNode *summary_find_next_labeled_msg
+static GtkCTreeNode *summary_find_next_marked_msg
                                        (SummaryView            *summaryview,
                                         GtkCTreeNode           *current_node);
 static GtkCTreeNode *summary_find_prev_labeled_msg
                                        (SummaryView            *summaryview,
                                         GtkCTreeNode           *current_node);
+static GtkCTreeNode *summary_find_next_labeled_msg
+                                       (SummaryView            *summaryview,
+                                        GtkCTreeNode           *current_node);
 static GtkCTreeNode *summary_find_msg_by_msgnum
                                        (SummaryView            *summaryview,
                                         guint                   msgnum);
-#if 0
-static GtkCTreeNode *summary_find_prev_unread_msg
-                                       (SummaryView            *summaryview,
-                                        GtkCTreeNode           *current_node);
-#endif
 
 static void summary_update_status      (SummaryView            *summaryview);
 
@@ -287,6 +285,16 @@ static void summary_show_all_header_cb     (SummaryView            *summaryview,
                                         guint                   action,
                                         GtkWidget              *widget);
 
+static void summary_add_address_cb     (SummaryView            *summaryview,
+                                        guint                   action,
+                                        GtkWidget              *widget);
+
+static void summary_mark_clicked       (GtkWidget              *button,
+                                        SummaryView            *summaryview);
+static void summary_unread_clicked     (GtkWidget              *button,
+                                        SummaryView            *summaryview);
+static void summary_mime_clicked       (GtkWidget              *button,
+                                        SummaryView            *summaryview);
 static void summary_num_clicked                (GtkWidget              *button,
                                         SummaryView            *summaryview);
 static void summary_score_clicked       (GtkWidget *button,
@@ -299,8 +307,6 @@ static void summary_from_clicked    (GtkWidget              *button,
                                         SummaryView            *summaryview);
 static void summary_subject_clicked    (GtkWidget              *button,
                                         SummaryView            *summaryview);
-static void summary_mark_clicked       (GtkWidget              *button,
-                                        SummaryView            *summaryview);
 
 static void summary_start_drag         (GtkWidget        *widget, 
                                         int button,
@@ -313,12 +319,17 @@ static void summary_drag_data_get       (GtkWidget        *widget,
                                         guint             time,
                                         SummaryView      *summaryview);
 
-static void summary_add_address_cb     (SummaryView            *summaryview,
-                                        guint                   action,
-                                        GtkWidget              *widget);
-
 /* custom compare functions for sorting */
 
+static gint summary_cmp_by_mark                (GtkCList               *clist,
+                                        gconstpointer           ptr1,
+                                        gconstpointer           ptr2);
+static gint summary_cmp_by_unread      (GtkCList               *clist,
+                                        gconstpointer           ptr1,
+                                        gconstpointer           ptr2);
+static gint summary_cmp_by_mime                (GtkCList               *clist,
+                                        gconstpointer           ptr1,
+                                        gconstpointer           ptr2);
 static gint summary_cmp_by_num         (GtkCList               *clist,
                                         gconstpointer           ptr1,
                                         gconstpointer           ptr2);
@@ -373,9 +384,7 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/_Mark/---"),              NULL, NULL,             0, "<Separator>"},
        {N_("/_Mark/Mark as unr_ead"),  NULL, summary_mark_as_unread, 0, NULL},
        {N_("/_Mark/Mark as rea_d"),    NULL, summary_mark_as_read, 0, NULL},
-#if MARK_ALL_READ      
        {N_("/_Mark/Mark all read"),    NULL, summary_mark_all_read, 0, NULL},
-#endif 
        {N_("/_Mark/Ignore thread"),    NULL, summary_ignore_thread, 0, NULL},
        {N_("/_Mark/Unignore thread"),  NULL, summary_unignore_thread, 0, NULL},
        {N_("/Color la_bel"),           NULL, NULL,             0, NULL},
@@ -494,41 +503,24 @@ SummaryView *summary_create(void)
                                       GTK_CAN_FOCUS);
 
        /* connect signal to the buttons for sorting */
-       gtk_signal_connect
-               (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_NUMBER].button),
-                "clicked",
-                GTK_SIGNAL_FUNC(summary_num_clicked),
-                summaryview);
-       gtk_signal_connect
-               (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_SCORE].button),
-                "clicked",
-                GTK_SIGNAL_FUNC(summary_score_clicked),
-                summaryview);
-       gtk_signal_connect
-               (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_SIZE].button),
-                "clicked",
-                GTK_SIGNAL_FUNC(summary_size_clicked),
-                summaryview);
-       gtk_signal_connect
-               (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_DATE].button),
-                "clicked",
-                GTK_SIGNAL_FUNC(summary_date_clicked),
-                summaryview);
-       gtk_signal_connect
-               (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_FROM].button),
-                "clicked",
-                GTK_SIGNAL_FUNC(summary_from_clicked),
-                summaryview);
-       gtk_signal_connect
-               (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_SUBJECT].button),
-                "clicked",
-                GTK_SIGNAL_FUNC(summary_subject_clicked),
-                summaryview);
-       gtk_signal_connect
-               (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_MARK].button),
-                "clicked",
-                GTK_SIGNAL_FUNC(summary_mark_clicked),
-                summaryview);
+#define CLIST_BUTTON_SIGNAL_CONNECT(col, func) \
+       gtk_signal_connect \
+               (GTK_OBJECT(GTK_CLIST(ctree)->column[col].button), \
+                "clicked", \
+                GTK_SIGNAL_FUNC(func), \
+                summaryview)
+
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_MARK   , summary_mark_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_UNREAD , summary_unread_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_MIME   , summary_mime_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_NUMBER , summary_num_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_SCORE  , summary_score_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_SIZE   , summary_size_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_DATE   , summary_date_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_FROM   , summary_from_clicked);
+       CLIST_BUTTON_SIGNAL_CONNECT(S_COL_SUBJECT, summary_subject_clicked);
+
+#undef CLIST_BUTTON_SIGNAL_CONNECT
 
        /* create status label */
        hbox = gtk_hbox_new(FALSE, 0);
@@ -629,7 +621,7 @@ void summary_init(SummaryView *summaryview)
                      ignorethread_xpm);
        PIXMAP_CREATE(summaryview->ctree, clipxpm, clipxpmmask, clip_xpm);
        PIXMAP_CREATE(summaryview->hbox, folderxpm, folderxpmmask,
-                     DIRECTORY_OPEN_XPM);
+                     dir_open_xpm);
 
        pixmap = gtk_pixmap_new(clipxpm, clipxpmmask);
        gtk_clist_set_column_widget(GTK_CLIST(summaryview->ctree),
@@ -1064,9 +1056,7 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
 
        menu_set_sensitive(ifactory, "/Mark/Mark as unread", TRUE);
        menu_set_sensitive(ifactory, "/Mark/Mark as read",   TRUE);
-#if MARK_ALL_READ
        menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE);
-#endif
        menu_set_sensitive(ifactory, "/Mark/Ignore thread",   TRUE);
        menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);
 
@@ -1080,7 +1070,7 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        menu_set_sensitive(ifactory, "/Forward as attachment",    TRUE);
 
        menu_set_sensitive(ifactory, "/Add sender to address book", sens);
-       
+
        menu_set_sensitive(ifactory, "/Open in new window", sens);
        menu_set_sensitive(ifactory, "/View source", sens);
        menu_set_sensitive(ifactory, "/Show all header", sens);
@@ -1102,59 +1092,56 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        menu_set_sensitive(ifactory, "/Follow-up and reply to", sens);
 }
 
-#if 0
-static void summary_set_add_sender_menu(SummaryView *summaryview)
+void summary_select_prev_unread(SummaryView *summaryview)
 {
-       GtkWidget *menu;
-       GtkWidget *submenu;
-       MsgInfo *msginfo;
-       gchar *from;
+       GtkCTreeNode *node;
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
-       menu = gtk_item_factory_get_item(summaryview->popupfactory,
-                                        "/Add sender to address book");
-       msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
-                                             summaryview->selected);
-       if (!msginfo || !msginfo->from) {
-               gtk_widget_set_sensitive(menu, FALSE);
-               submenu = gtk_menu_new();
-               gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), submenu);
-               return;
+       node = summary_find_prev_unread_msg(summaryview, summaryview->selected);
+
+       if (!node) {
+               AlertValue val;
+
+               val = alertpanel(_("No more unread messages"),
+                                _("No unread message found. "
+                                  "Search from the end?"),
+                                _("Yes"), _("No"), NULL);
+               if (val != G_ALERTDEFAULT) return;
+               node = summary_find_prev_unread_msg(summaryview, NULL);
        }
 
-       gtk_widget_set_sensitive(menu, TRUE);
-       Xstrdup_a(from, msginfo->from, return);
-       eliminate_address_comment(from);
-       extract_address(from);
-       addressbook_add_submenu(menu, msginfo->fromname, from, NULL);
+       if (!node) {
+               alertpanel_notice(_("No unread messages."));
+       } else {
+               gtkut_ctree_expand_parent_all(ctree, node);
+               gtk_sctree_unselect_all(GTK_SCTREE(ctree));
+               gtk_sctree_select(GTK_SCTREE(ctree), node);
+               if (summaryview->displayed == node)
+                       summaryview->displayed = NULL;
+               summary_display_msg(summaryview, node, FALSE);
+       }
 }
-#endif
 
 void summary_select_next_unread(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
-       node = summary_find_next_unread_msg(summaryview,
-                                           summaryview->selected);
+       node = summary_find_next_unread_msg(summaryview, summaryview->selected);
 
        if (node) {
                gtkut_ctree_expand_parent_all(ctree, node);
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
                gtk_sctree_select(GTK_SCTREE(ctree), node);
-
-               /* BUGFIX: select next unread message 
-                * REVERT: causes incorrect folder stats
-                * gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0.0); 
-                */
-
                if (summaryview->displayed == node)
                        summaryview->displayed = NULL;
                summary_display_msg(summaryview, node, FALSE);
        } else {
                AlertValue val;
 
-               val = alertpanel(_("No unread message"),
-                                _("No unread message found. Go to next folder?"),
+               val = alertpanel(_("No more unread messages"),
+                                _("No unread message found. "
+                                  "Go to next folder?"),
                                 _("Yes"), _("No"), NULL);
                if (val == G_ALERTDEFAULT) {
                        if (gtk_signal_n_emissions_by_name
@@ -1167,28 +1154,28 @@ void summary_select_next_unread(SummaryView *summaryview)
        }
 }
 
-void summary_select_next_marked(SummaryView *summaryview)
+void summary_select_prev_marked(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
-       node = summary_find_next_marked_msg(summaryview,
-                                           summaryview->selected);
+       node = summary_find_prev_marked_msg(summaryview, summaryview->selected);
 
        if (!node) {
                AlertValue val;
 
                val = alertpanel(_("No more marked messages"),
                                 _("No marked message found. "
-                                  "Search from the beginning?"),
+                                  "Search from the end?"),
                                 _("Yes"), _("No"), NULL);
                if (val != G_ALERTDEFAULT) return;
-               node = summary_find_next_marked_msg(summaryview,
-                                                   NULL);
+               node = summary_find_prev_marked_msg(summaryview, NULL);
        }
+
        if (!node) {
                alertpanel_notice(_("No marked messages."));
        } else {
+               gtkut_ctree_expand_parent_all(ctree, node);
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
                gtk_sctree_select(GTK_SCTREE(ctree), node);
                if (summaryview->displayed == node)
@@ -1197,28 +1184,28 @@ void summary_select_next_marked(SummaryView *summaryview)
        }
 }
 
-void summary_select_prev_marked(SummaryView *summaryview)
+void summary_select_next_marked(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
-       node = summary_find_prev_marked_msg(summaryview,
-                                           summaryview->selected);
+       node = summary_find_next_marked_msg(summaryview, summaryview->selected);
 
        if (!node) {
                AlertValue val;
 
                val = alertpanel(_("No more marked messages"),
                                 _("No marked message found. "
-                                  "Search from the end?"),
+                                  "Search from the beginning?"),
                                 _("Yes"), _("No"), NULL);
                if (val != G_ALERTDEFAULT) return;
-               node = summary_find_prev_marked_msg(summaryview,
-                                                   NULL);
+               node = summary_find_next_marked_msg(summaryview, NULL);
        }
+
        if (!node) {
                alertpanel_notice(_("No marked messages."));
        } else {
+               gtkut_ctree_expand_parent_all(ctree, node);
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
                gtk_sctree_select(GTK_SCTREE(ctree), node);
                if (summaryview->displayed == node)
@@ -1227,28 +1214,28 @@ void summary_select_prev_marked(SummaryView *summaryview)
        }
 }
 
-void summary_select_next_labeled(SummaryView *summaryview)
+void summary_select_prev_labeled(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
-       node = summary_find_next_labeled_msg(summaryview,
-                                           summaryview->selected);
+       node = summary_find_prev_labeled_msg(summaryview, summaryview->selected);
 
        if (!node) {
                AlertValue val;
 
                val = alertpanel(_("No more labeled messages"),
                                 _("No labeled message found. "
-                                  "Search from the beginning?"),
+                                  "Search from the end?"),
                                 _("Yes"), _("No"), NULL);
                if (val != G_ALERTDEFAULT) return;
-               node = summary_find_next_labeled_msg(summaryview,
-                                                   NULL);
+               node = summary_find_prev_labeled_msg(summaryview, NULL);
        }
+
        if (!node) {
                alertpanel_notice(_("No labeled messages."));
        } else {
+               gtkut_ctree_expand_parent_all(ctree, node);
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
                gtk_sctree_select(GTK_SCTREE(ctree), node);
                if (summaryview->displayed == node)
@@ -1257,28 +1244,28 @@ void summary_select_next_labeled(SummaryView *summaryview)
        }
 }
 
-void summary_select_prev_labeled(SummaryView *summaryview)
+void summary_select_next_labeled(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
-       node = summary_find_prev_labeled_msg(summaryview,
-                                           summaryview->selected);
+       node = summary_find_next_labeled_msg(summaryview, summaryview->selected);
 
        if (!node) {
                AlertValue val;
 
                val = alertpanel(_("No more labeled messages"),
                                 _("No labeled message found. "
-                                  "Search from the end?"),
+                                  "Search from the beginning?"),
                                 _("Yes"), _("No"), NULL);
                if (val != G_ALERTDEFAULT) return;
-               node = summary_find_prev_labeled_msg(summaryview,
-                                                   NULL);
+               node = summary_find_next_labeled_msg(summaryview, NULL);
        }
+
        if (!node) {
                alertpanel_notice(_("No labeled messages."));
        } else {
+               gtkut_ctree_expand_parent_all(ctree, node);
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
                gtk_sctree_select(GTK_SCTREE(ctree), node);
                if (summaryview->displayed == node)
@@ -1332,7 +1319,7 @@ static guint summary_get_msgnum(SummaryView *summaryview, GtkCTreeNode *node)
        return msginfo->msgnum;
 }
 
-static GtkCTreeNode *summary_find_next_unread_msg(SummaryView *summaryview,
+static GtkCTreeNode *summary_find_prev_unread_msg(SummaryView *summaryview,
                                                  GtkCTreeNode *current_node)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
@@ -1342,17 +1329,17 @@ static GtkCTreeNode *summary_find_next_unread_msg(SummaryView *summaryview,
        if (current_node)
                node = current_node;
        else
-               node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
+               node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list_end);
 
-       for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
+       for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) break;
+               if (MSG_IS_UNREAD(msginfo->flags)) break;
        }
 
        return node;
 }
 
-static GtkCTreeNode *summary_find_next_marked_msg(SummaryView *summaryview,
+static GtkCTreeNode *summary_find_next_unread_msg(SummaryView *summaryview,
                                                  GtkCTreeNode *current_node)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
@@ -1360,13 +1347,13 @@ static GtkCTreeNode *summary_find_next_marked_msg(SummaryView *summaryview,
        MsgInfo *msginfo;
 
        if (current_node)
-               node = GTK_CTREE_NODE_NEXT(current_node);
+               node = current_node;
        else
                node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
-       for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+       for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if (MSG_IS_MARKED(msginfo->flags)) break;
+               if (MSG_IS_UNREAD(msginfo->flags)) break;
        }
 
        return node;
@@ -1392,7 +1379,7 @@ static GtkCTreeNode *summary_find_prev_marked_msg(SummaryView *summaryview,
        return node;
 }
 
-static GtkCTreeNode *summary_find_next_labeled_msg(SummaryView *summaryview,
+static GtkCTreeNode *summary_find_next_marked_msg(SummaryView *summaryview,
                                                  GtkCTreeNode *current_node)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
@@ -1400,20 +1387,20 @@ static GtkCTreeNode *summary_find_next_labeled_msg(SummaryView *summaryview,
        MsgInfo *msginfo;
 
        if (current_node)
-               node = GTK_CTREE_NODE_NEXT(current_node);
+               node = gtkut_ctree_node_next(ctree, current_node);
        else
                node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
-       for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+       for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-                if (MSG_GET_COLORLABEL_VALUE(msginfo->flags) > 0) break;
+               if (MSG_IS_MARKED(msginfo->flags)) break;
        }
 
        return node;
 }
 
 static GtkCTreeNode *summary_find_prev_labeled_msg(SummaryView *summaryview,
-                                                 GtkCTreeNode *current_node)
+                                                  GtkCTreeNode *current_node)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCTreeNode *node;
@@ -1426,51 +1413,48 @@ static GtkCTreeNode *summary_find_prev_labeled_msg(SummaryView *summaryview,
 
        for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-                 if (MSG_GET_COLORLABEL_VALUE(msginfo->flags) > 0) break;
+               if (MSG_GET_COLORLABEL_VALUE(msginfo->flags) > 0) break;
        }
 
        return node;
 }
 
-static GtkCTreeNode *summary_find_msg_by_msgnum(SummaryView *summaryview,
-                                               guint msgnum)
+static GtkCTreeNode *summary_find_next_labeled_msg(SummaryView *summaryview,
+                                                  GtkCTreeNode *current_node)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCTreeNode *node;
        MsgInfo *msginfo;
 
-       node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
+       if (current_node)
+               node = gtkut_ctree_node_next(ctree, current_node);
+       else
+               node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
        for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if (msginfo->msgnum == msgnum) break;
+               if (MSG_GET_COLORLABEL_VALUE(msginfo->flags) > 0) break;
        }
 
        return node;
 }
 
-#if 0
-static GtkCTreeNode *summary_find_prev_unread_msg(SummaryView *summaryview,
-                                                 GtkCTreeNode *current_node)
+static GtkCTreeNode *summary_find_msg_by_msgnum(SummaryView *summaryview,
+                                               guint msgnum)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCTreeNode *node;
        MsgInfo *msginfo;
 
-       if (current_node)
-               node = current_node;
-               /*node = GTK_CTREE_NODE_PREV(current_node);*/
-       else
-               node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list_end);
+       node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
-       for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
+       for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if (MSG_IS_UNREAD(msginfo->flags)) break;
+               if (msginfo->msgnum == msgnum) break;
        }
 
        return node;
 }
-#endif
 
 static guint attract_hash_func(gconstpointer key)
 {
@@ -1721,6 +1705,15 @@ void summary_sort(SummaryView *summaryview, SummarySortType type)
                return;
 
        switch (type) {
+       case SORT_BY_MARK:
+               cmp_func = (GtkCListCompareFunc)summary_cmp_by_mark;
+               break;
+       case SORT_BY_UNREAD:
+               cmp_func = (GtkCListCompareFunc)summary_cmp_by_unread;
+               break;
+       case SORT_BY_MIME:
+               cmp_func = (GtkCListCompareFunc)summary_cmp_by_mime;
+               break;
        case SORT_BY_NUMBER:
                cmp_func = (GtkCListCompareFunc)summary_cmp_by_num;
                break;
@@ -2558,14 +2551,25 @@ void summary_mark_as_read(SummaryView *summaryview)
        summary_status_show(summaryview);
 }
 
-#if MARK_ALL_READ
-static void summary_mark_all_read(SummaryView *summaryview)
+void summary_mark_all_read(SummaryView *summaryview)
 {
-       summary_select_all(summaryview);
-       summary_mark_as_read(summaryview);
-       summary_unselect_all(summaryview);
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GtkCList *clist = GTK_CLIST(summaryview->ctree);
+       GtkCTreeNode *node;
+
+       gtk_clist_freeze(clist);
+       for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list); node != NULL;
+            node = gtkut_ctree_node_next(ctree, node))
+               summary_mark_row_as_read(summaryview, node);
+       for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list); node != NULL;
+            node = gtkut_ctree_node_next(ctree, node)) {
+               if (!GTK_CTREE_ROW(node)->expanded)
+                       summary_set_row_marks(summaryview, node);
+       }
+       gtk_clist_thaw(clist);
+
+       summary_status_show(summaryview);
 }
-#endif
 
 static void summary_mark_row_as_unread(SummaryView *summaryview,
                                       GtkCTreeNode *row)
@@ -2582,8 +2586,6 @@ static void summary_mark_row_as_unread(SummaryView *summaryview,
        MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_REPLIED | MSG_FORWARDED);
        if (!MSG_IS_UNREAD(msginfo->flags)) {
                MSG_SET_PERM_FLAGS(msginfo->flags, MSG_UNREAD);
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
-                                         unreadxpm, unreadxpmmask);
                summaryview->unread++;
                debug_print(_("Message %d is marked as unread\n"),
                            msginfo->msgnum);
@@ -2924,6 +2926,21 @@ void summary_copy_to(SummaryView *summaryview)
        summary_copy_selected_to(summaryview, to_folder);
 }
 
+void summary_add_address(SummaryView *summaryview)
+{
+       MsgInfo *msginfo;
+       gchar *from;
+
+       msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
+                                             summaryview->selected);
+       if (!msginfo) return;
+
+       Xstrdup_a(from, msginfo->from, return);
+       eliminate_address_comment(from);
+       extract_address(from);
+       addressbook_add_contact(msginfo->fromname, from, NULL);
+}
+
 void summary_select_all(SummaryView *summaryview)
 {
        if (summaryview->messages >= 500) {
@@ -3991,7 +4008,7 @@ static void summary_reply_cb(SummaryView *summaryview, guint action,
                                              summaryview->selected);
        if (!msginfo) return;
 
-       switch ((ComposeReplyMode)action) {
+       switch ((ComposeMode)action) {
        case COMPOSE_REPLY:
                compose_reply(msginfo, prefs_common.reply_with_quote,
                              FALSE, FALSE);
@@ -4060,17 +4077,22 @@ static void summary_show_all_header_cb(SummaryView *summaryview,
 static void summary_add_address_cb(SummaryView *summaryview,
                                   guint action, GtkWidget *widget)
 {
-       MsgInfo *msginfo;
-       gchar *from;
+       summary_add_address(summaryview);
+}
 
-       msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
-                                             summaryview->selected);
-       if (!msginfo) return;
+static void summary_mark_clicked(GtkWidget *button, SummaryView *summaryview)
+{
+       summary_sort(summaryview, SORT_BY_MARK);
+}
 
-       Xstrdup_a(from, msginfo->from, return);
-       eliminate_address_comment(from);
-       extract_address(from);
-       addressbook_add_contact(msginfo->fromname, from, NULL);
+static void summary_unread_clicked(GtkWidget *button, SummaryView *summaryview)
+{
+       summary_sort(summaryview, SORT_BY_UNREAD);
+}
+
+static void summary_mime_clicked(GtkWidget *button, SummaryView *summaryview)
+{
+       summary_sort(summaryview, SORT_BY_MIME);
 }
 
 static void summary_num_clicked(GtkWidget *button, SummaryView *summaryview)
@@ -4105,12 +4127,6 @@ static void summary_subject_clicked(GtkWidget *button,
        summary_sort(summaryview, SORT_BY_SUBJECT);
 }
 
-static void summary_mark_clicked(GtkWidget *button,
-                                SummaryView *summaryview)
-{
-       summary_sort(summaryview, SORT_BY_LABEL);
-}
-
 void summary_change_display_item(SummaryView *summaryview)
 {
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
@@ -4195,6 +4211,33 @@ static void summary_drag_data_get(GtkWidget        *widget,
 
 /* custom compare functions for sorting */
 
+static gint summary_cmp_by_mark(GtkCList *clist,
+                               gconstpointer ptr1, gconstpointer ptr2)
+{
+       MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
+       MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
+
+       return MSG_IS_MARKED(msginfo1->flags) - MSG_IS_MARKED(msginfo2->flags);
+}
+
+static gint summary_cmp_by_unread(GtkCList *clist,
+                                 gconstpointer ptr1, gconstpointer ptr2)
+{
+       MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
+       MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
+
+       return MSG_IS_UNREAD(msginfo1->flags) - MSG_IS_UNREAD(msginfo2->flags);
+}
+
+static gint summary_cmp_by_mime(GtkCList *clist,
+                               gconstpointer ptr1, gconstpointer ptr2)
+{
+       MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
+       MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
+
+       return MSG_IS_MIME(msginfo1->flags) - MSG_IS_MIME(msginfo2->flags);
+}
+
 static gint summary_cmp_by_num(GtkCList *clist,
                               gconstpointer ptr1, gconstpointer ptr2)
 {
@@ -4256,9 +4299,9 @@ static gint summary_cmp_by_label(GtkCList *clist,
        MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
        MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
 
-       return MSG_GET_COLORLABEL(msginfo1->flags) - MSG_GET_COLORLABEL(msginfo2->flags);
+       return MSG_GET_COLORLABEL(msginfo1->flags) -
+               MSG_GET_COLORLABEL(msginfo2->flags);
 }
-
 static gint summary_cmp_by_score(GtkCList *clist,
                                 gconstpointer ptr1, gconstpointer ptr2)
 {
index 06b83ac..f76ed6b 100644 (file)
@@ -61,7 +61,10 @@ typedef enum
        SORT_BY_FROM,
        SORT_BY_SUBJECT,
        SORT_BY_SCORE,
-       SORT_BY_LABEL
+       SORT_BY_LABEL,
+       SORT_BY_MARK,
+       SORT_BY_UNREAD,
+       SORT_BY_MIME
 } SummarySortType;
 
 typedef enum
@@ -160,9 +163,12 @@ void summary_clear_all               (SummaryView          *summaryview);
 
 SummarySelection summary_get_selection_type    (SummaryView    *summaryview);
 
+void summary_select_prev_unread          (SummaryView          *summaryview);
 void summary_select_next_unread          (SummaryView          *summaryview);
-void summary_select_next_marked   (SummaryView         *summaryview);
-void summary_select_prev_marked   (SummaryView         *summaryview);
+void summary_select_prev_marked          (SummaryView          *summaryview);
+void summary_select_next_marked          (SummaryView          *summaryview);
+void summary_select_prev_labeled  (SummaryView         *summaryview);
+void summary_select_next_labeled  (SummaryView         *summaryview);
 void summary_select_by_msgnum    (SummaryView          *summaryview,
                                   guint                 msgnum);
 guint summary_get_current_msgnum  (SummaryView         *summaryview);
@@ -201,6 +207,8 @@ void summary_mark             (SummaryView          *summaryview);
 void summary_unmark              (SummaryView          *summaryview);
 void summary_mark_as_unread      (SummaryView          *summaryview);
 void summary_mark_as_read        (SummaryView          *summaryview);
+void summary_mark_all_read       (SummaryView          *summaryview);
+void summary_add_address         (SummaryView          *summaryview);
 void summary_select_all                  (SummaryView          *summaryview);
 void summary_unselect_all        (SummaryView          *summaryview);
 
index 1cdb7d8..744d2f6 100644 (file)
@@ -27,8 +27,9 @@
 
 #ifdef USE_LDAP
 
-#include <sys/time.h>
 #include <glib.h>
+#include <sys/time.h>
+#include <string.h>
 #include <ldap.h>
 #include <lber.h>
 #include <pthread.h>
@@ -191,19 +192,22 @@ void syldap_force_refresh( SyldapServer *ldapServer ) {
 }
 
 gint syldap_get_status( SyldapServer *ldapServer ) {
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, -1 );
        return ldapServer->retVal;
 }
+
 ItemFolder *syldap_get_root_folder( SyldapServer *ldapServer ) {
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, NULL );
        return addrcache_get_root_folder( ldapServer->addressCache );
 }
+
 gchar *syldap_get_name( SyldapServer *ldapServer ) {
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, NULL );
        return ldapServer->name;
 }
+
 gboolean syldap_get_accessed( SyldapServer *ldapServer ) {
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, FALSE );
        return ldapServer->accessFlag;
 }
 
@@ -256,8 +260,8 @@ void syldap_free( SyldapServer *ldapServer ) {
 * Display object to specified stream.
 */
 void syldap_print_data( SyldapServer *ldapServer, FILE *stream ) {
-       GSList *node;
        g_return_if_fail( ldapServer != NULL );
+
        fprintf( stream, "SyldapServer:\n" );
        fprintf( stream, "     name: '%s'\n", ldapServer->name );
        fprintf( stream, "host name: '%s'\n", ldapServer->hostName );
@@ -278,8 +282,8 @@ void syldap_print_data( SyldapServer *ldapServer, FILE *stream ) {
 * Display object to specified stream.
 */
 void syldap_print_short( SyldapServer *ldapServer, FILE *stream ) {
-       GSList *node;
        g_return_if_fail( ldapServer != NULL );
+
        fprintf( stream, "SyldapServer:\n" );
        fprintf( stream, "     name: '%s'\n", ldapServer->name );
        fprintf( stream, "host name: '%s'\n", ldapServer->hostName );
@@ -302,6 +306,7 @@ static void syldap_build_items_cn( SyldapServer *ldapServer, GSList *listName, G
        ItemPerson *person;
        ItemEMail *email;
        GSList *nodeName = listName;
+
        while( nodeName ) {
                GSList *nodeAddress = listAddr;
                person = addritem_create_item_person();
@@ -399,7 +404,8 @@ static void syldap_build_items_fl( SyldapServer *ldapServer, GSList *listAddr, G
 static GSList *syldap_add_list_values( LDAP *ld, LDAPMessage *entry, char *attr ) {
        GSList *list = NULL;
        gint i;
-       char **vals;
+       gchar **vals;
+
        if( ( vals = ldap_get_values( ld, entry, attr ) ) != NULL ) {
                for( i = 0; vals[i] != NULL; i++ ) {
                        // printf( "lv\t%s: %s\n", attr, vals[i] );
@@ -415,7 +421,8 @@ static GSList *syldap_add_list_values( LDAP *ld, LDAPMessage *entry, char *attr
 */
 static GSList *syldap_add_single_value( LDAP *ld, LDAPMessage *entry, char *attr ) {
        GSList *list = NULL;
-       char **vals;
+       gchar **vals;
+
        if( ( vals = ldap_get_values( ld, entry, attr ) ) != NULL ) {
                if( vals[0] != NULL ) {
                        // printf( "sv\t%s: %s\n", attr, vals[0] );
@@ -444,7 +451,8 @@ static void syldap_free_lists( GSList *listName, GSList *listAddr, GSList *listI
 * Return: TRUE if search criteria appear OK.
 */
 gboolean syldap_check_search( SyldapServer *ldapServer ) {
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, FALSE );
+
        ldapServer->retVal = MGU_LDAP_CRITERIA;
 
        // Test search criteria
@@ -480,13 +488,13 @@ gint syldap_search( SyldapServer *ldapServer ) {
        char *attribute;
        gchar *criteria;
        BerElement *ber;
-       int rc, cnt;
+       gint rc;
        GSList *listName = NULL, *listAddress = NULL, *listID = NULL;
        GSList *listFirst = NULL, *listLast = NULL, *listDN = NULL;
        struct timeval timeout;
        gboolean entriesFound = FALSE;
 
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, -1 );
 
        ldapServer->retVal = MGU_SUCCESS;
        if( ! syldap_check_search( ldapServer ) ) {
@@ -622,7 +630,7 @@ gint syldap_search( SyldapServer *ldapServer ) {
 */
 // ============================================================================================
 gint syldap_read_data( SyldapServer *ldapServer ) {
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, -1 );
 
        ldapServer->accessFlag = FALSE;
        pthread_detach( pthread_self() );
@@ -654,6 +662,7 @@ gint syldap_read_data( SyldapServer *ldapServer ) {
 // ============================================================================================
 void syldap_cancel_read( SyldapServer *ldapServer ) {
        g_return_if_fail( ldapServer != NULL );
+
        if( ldapServer->thread ) {
                // printf( "thread cancelled\n" );
                pthread_cancel( *ldapServer->thread );
@@ -671,7 +680,8 @@ void syldap_cancel_read( SyldapServer *ldapServer ) {
 // ============================================================================================
 gint syldap_read_data_th( SyldapServer *ldapServer ) {
        pthread_t thread;
-       g_return_if_fail( ldapServer != NULL );
+
+       g_return_val_if_fail( ldapServer != NULL, -1 );
 
        ldapServer->busyFlag = FALSE;
        syldap_check_search( ldapServer );
@@ -687,7 +697,7 @@ gint syldap_read_data_th( SyldapServer *ldapServer ) {
 * Return link list of persons.
 */
 GList *syldap_get_list_person( SyldapServer *ldapServer ) {
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, NULL );
        return addrcache_get_list_person( ldapServer->addressCache );
 }
 
@@ -697,7 +707,7 @@ GList *syldap_get_list_person( SyldapServer *ldapServer ) {
 * Return: NULL.
 */
 GList *syldap_get_list_folder( SyldapServer *ldapServer ) {
-       g_return_if_fail( ldapServer != NULL );
+       g_return_val_if_fail( ldapServer != NULL, NULL );
        return NULL;
 }
 
@@ -721,12 +731,12 @@ GList *syldap_get_list_folder( SyldapServer *ldapServer ) {
 GList *syldap_read_basedn_s( const gchar *host, const gint port, const gchar *bindDN, const gchar *bindPW, const gint tov ) {
        GList *baseDN = NULL;
        LDAP *ld;
-       int rc, i;
+       gint rc, i;
        LDAPMessage *result, *e;
-       char *attribs[10];
+       gchar *attribs[10];
        BerElement *ber;
-       char *attribute;
-       char **vals;
+       gchar *attribute;
+       gchar **vals;
        struct timeval timeout;
 
        if( host == NULL ) return baseDN;
@@ -844,12 +854,12 @@ GList *syldap_read_basedn_s( const gchar *host, const gint port, const gchar *bi
 GList *syldap_read_basedn( SyldapServer *ldapServer ) {
        GList *baseDN = NULL;
        LDAP *ld;
-       int rc, i;
+       gint rc, i;
        LDAPMessage *result, *e;
-       char *attribs[10];
+       gchar *attribs[10];
        BerElement *ber;
-       char *attribute;
-       char **vals;
+       gchar *attribute;
+       gchar **vals;
        struct timeval timeout;
 
        ldapServer->retVal = MGU_BAD_ARGS;
@@ -981,6 +991,7 @@ GList *syldap_read_basedn( SyldapServer *ldapServer ) {
 gboolean syldap_test_connect_s( const gchar *host, const gint port ) {
        gboolean retVal = FALSE;
        LDAP *ld;
+
        if( host == NULL ) return retVal;
        if( port < 1 ) return retVal;
        if( ( ld = ldap_open( host, port ) ) != NULL ) {
@@ -1000,6 +1011,7 @@ gboolean syldap_test_connect_s( const gchar *host, const gint port ) {
 gboolean syldap_test_connect( SyldapServer *ldapServer ) {
        gboolean retVal = FALSE;
        LDAP *ld;
+
        ldapServer->retVal = MGU_BAD_ARGS;
        if( ldapServer == NULL ) return retVal;
        if( ldapServer->hostName == NULL ) return retVal;
index 717d58f..70a8fce 100644 (file)
@@ -947,55 +947,45 @@ gboolean is_ascii_str(const guchar *str)
 
 gint get_quote_level(const gchar *str)
 {
-       size_t firstquotepos;
-       size_t lastquotepos = -1;
+       const gchar *first_pos;
+       const gchar *last_pos;
        const gchar *p = str;
-       const gchar *pos;
-       gint quotelevel = -1;
-       gint i = 0;
+       gint quote_level = -1;
 
        /* speed up line processing by only searching to the last '>' */
-       if ((pos = strchr(str, '>')) != NULL) {
-               firstquotepos = pos - str;
-               lastquotepos = strrchr(str, '>') - str + 1;
-
+       if ((first_pos = strchr(str, '>')) != NULL) {
                /* skip a line if it contains a '<' before the initial '>' */
-               if (memchr(str, '<', pos - str) != NULL)
+               if (memchr(str, '<', first_pos - str) != NULL)
                        return -1;
+               last_pos = strrchr(first_pos, '>');
        } else
                return -1;
 
-       while (i < lastquotepos) {
-               while (i < lastquotepos) {
-                       if (isspace(*p) || (*p == '\t')) {
+       while (p <= last_pos) {
+               while (p < last_pos) {
+                       if (isspace(*p))
                                p++;
-                               i++;
-                       } else
+                       else
                                break;
                }
-               if (i >= lastquotepos)
-                       break;
 
                if (*p == '>')
-                       quotelevel++;
-               else if ((*p != '-') && !isspace(*p) && (i < lastquotepos)) {
+                       quote_level++;
+               else if (*p != '-' && !isspace(*p) && p <= last_pos) {
                        /* any characters are allowed except '-' and space */
-                       while ((*p != '-') && (*p != '>') && !isspace(*p) &&
-                              (i < lastquotepos)) {
+                       while (*p != '-' && *p != '>' && !isspace(*p) &&
+                              p < last_pos)
                                p++;
-                               i++;
-                       }
                        if (*p == '>')
-                               quotelevel++;
-                       else if ((i >= lastquotepos) || isspace(*p))
+                               quote_level++;
+                       else
                                break;
                }
 
                p++;
-               i++;
        }
 
-       return quotelevel;
+       return quote_level;
 }
 
 GList *uri_list_extract_filenames(const gchar *uri_list)
@@ -1795,7 +1785,28 @@ gint execute_async(gchar *const argv[])
        return 0;
 }
 
-gint execute_command_line(const gchar *cmdline)
+gint execute_sync(gchar *const argv[])
+{
+       pid_t pid;
+
+       if ((pid = fork()) < 0) {
+               perror("fork");
+               return -1;
+       }
+
+       if (pid == 0) {         /* child process */
+               execvp(argv[0], argv);
+
+               perror("execvp");
+               _exit(1);
+       }
+
+       waitpid(pid, NULL, 0);
+
+       return 0;
+}
+
+gint execute_command_line(const gchar *cmdline, gboolean async)
 {
        gchar **argv;
        gint i;
@@ -1817,7 +1828,10 @@ gint execute_command_line(const gchar *cmdline)
                }
        }
 
-       ret = execute_async(argv);
+       if (async)
+               ret = execute_async(argv);
+       else
+               ret = execute_sync(argv);
        g_strfreev(argv);
 
        return ret;
@@ -1842,7 +1856,7 @@ gint open_uri(const gchar *uri, const gchar *cmdline)
                g_snprintf(buf, sizeof(buf), default_cmdline, uri);
        }
 
-       execute_command_line(buf);
+       execute_command_line(buf, TRUE);
 
        return 0;
 }
index 1f15843..eb7034e 100644 (file)
@@ -282,7 +282,9 @@ FILE *my_tmpfile            (void);
 
 /* process execution */
 gint execute_async             (gchar *const    argv[]);
-gint execute_command_line      (const gchar    *cmdline);
+gint execute_sync              (gchar *const    argv[]);
+gint execute_command_line      (const gchar    *cmdline,
+                                gboolean        async);
 
 /* open URI with external browser */
 gint open_uri(const gchar *uri, const gchar *cmdline);
index 9f42c58..d6c63a7 100644 (file)
@@ -23,8 +23,9 @@
  * card information. Refer to RFC2426 for more information.
  */
 
-#include <sys/stat.h>
 #include <glib.h>
+#include <sys/stat.h>
+#include <string.h>
 
 #include "mgutils.h"
 #include "vcard.h"
@@ -78,11 +79,11 @@ void vcard_set_accessed( VCardFile *cardFile, const gboolean value ) {
 * Return: TRUE if file was modified.
 */
 gboolean vcard_get_modified( VCardFile *vcardFile ) {
-       g_return_if_fail( vcardFile != NULL );
+       g_return_val_if_fail( vcardFile != NULL, FALSE );
        return addrcache_check_file( vcardFile->addressCache, vcardFile->path );
 }
 gboolean vcard_get_accessed( VCardFile *vcardFile ) {
-       g_return_if_fail( vcardFile != NULL );
+       g_return_val_if_fail( vcardFile != NULL, FALSE );
        return addrcache_check_file( vcardFile->addressCache, vcardFile->path );
 }
 
@@ -91,7 +92,7 @@ gboolean vcard_get_accessed( VCardFile *vcardFile ) {
 * Return: TRUE if file was read.
 */
 gboolean vcard_get_read_flag( VCardFile *vcardFile ) {
-       g_return_if_fail( vcardFile != NULL );
+       g_return_val_if_fail( vcardFile != NULL, FALSE );
        return vcardFile->addressCache->dataRead;
 }
 
@@ -100,16 +101,16 @@ gboolean vcard_get_read_flag( VCardFile *vcardFile ) {
 * Return: Status code.
 */
 gint vcard_get_status( VCardFile *cardFile ) {
-       g_return_if_fail( cardFile != NULL );
+       g_return_val_if_fail( cardFile != NULL, -1 );
        return cardFile->retVal;
 }
 
 ItemFolder *vcard_get_root_folder( VCardFile *cardFile ) {
-       g_return_if_fail( cardFile != NULL );
+       g_return_val_if_fail( cardFile != NULL, NULL );
        return addrcache_get_root_folder( cardFile->addressCache );
 }
 gchar *vcard_get_name( VCardFile *cardFile ) {
-       g_return_if_fail( cardFile != NULL );
+       g_return_val_if_fail( cardFile != NULL, NULL );
        return cardFile->name;
 }
 
@@ -126,7 +127,7 @@ void vcard_force_refresh( VCardFile *cardFile ) {
 VCardFile *vcard_create_path( const gchar *path ) {
        VCardFile *cardFile;
        cardFile = vcard_create();
-       vcard_set_file(cardFile, path );
+       vcard_set_file(cardFile, path);
        return cardFile;
 }
 
@@ -164,8 +165,8 @@ void vcard_free( VCardFile *cardFile ) {
 * Display object to specified stream.
 */
 void vcard_print_file( VCardFile *cardFile, FILE *stream ) {
-       GSList *node;
        g_return_if_fail( cardFile != NULL );
+
        fprintf( stream, "VCardFile:\n" );
        fprintf( stream, "     name: '%s'\n", cardFile->name );
        fprintf( stream, "file spec: '%s'\n", cardFile->path );
@@ -179,7 +180,7 @@ void vcard_print_file( VCardFile *cardFile, FILE *stream ) {
 * return: TRUE if file opened successfully.
 */
 static gint vcard_open_file( VCardFile* cardFile ) {
-       g_return_if_fail( cardFile != NULL );
+       g_return_val_if_fail( cardFile != NULL, -1 );
 
        // fprintf( stdout, "Opening file\n" );
        cardFile->addressCache->dataRead = FALSE;
@@ -238,7 +239,7 @@ static gchar *vcard_get_line( VCardFile *cardFile ) {
 
        if (vcard_read_line( cardFile ) == NULL ) {
                buf[0] = '\0';
-               return;
+               return NULL;
        }
 
        /* Copy into private buffer */
@@ -411,8 +412,8 @@ static void vcard_build_items( VCardFile *cardFile, GSList *listName, GSList *li
 // Unescape characters in quoted-printable string.
 static void vcard_unescape_qp( gchar *value ) {
        gchar *ptr, *src, *dest;
-       int d, v;
-       char ch;
+       gint d, v = 0;
+       gchar ch;
        gboolean gotch;
        ptr = value;
        while( *ptr ) {
@@ -461,9 +462,9 @@ static void vcard_unescape_qp( gchar *value ) {
 * it will generate duplicate address entries for each person listed.
 */
 static void vcard_read_file( VCardFile *cardFile ) {
-       gchar *tagtemp = NULL, *tagname = NULL, *tagvalue = NULL, *tagtype = NULL, *tagrest = NULL;
+       gchar *tagtemp = NULL, *tagname = NULL, *tagvalue = NULL, *tagtype = NULL;
        GSList *listName = NULL, *listAddress = NULL, *listRemarks = NULL, *listID = NULL;
-       GSList *listQP = NULL;
+       //GSList *listQP = NULL;
 
        for( ;; ) {
                gchar *line =  vcard_get_line( cardFile );
@@ -542,7 +543,8 @@ static void vcard_read_file( VCardFile *cardFile ) {
 */
 // ============================================================================================
 gint vcard_read_data( VCardFile *cardFile ) {
-       g_return_if_fail( cardFile != NULL );
+       g_return_val_if_fail( cardFile != NULL, -1 );
+
        cardFile->retVal = MGU_SUCCESS;
        cardFile->accessFlag = FALSE;
        if( addrcache_check_file( cardFile->addressCache, cardFile->path ) ) {
@@ -566,7 +568,7 @@ gint vcard_read_data( VCardFile *cardFile ) {
 * Return link list of persons.
 */
 GList *vcard_get_list_person( VCardFile *cardFile ) {
-       g_return_if_fail( cardFile != NULL );
+       g_return_val_if_fail( cardFile != NULL, NULL );
        return addrcache_get_list_person( cardFile->addressCache );
 }
 
@@ -576,7 +578,7 @@ GList *vcard_get_list_person( VCardFile *cardFile ) {
 * Return: NULL.
 */
 GList *vcard_get_list_folder( VCardFile *cardFile ) {
-       g_return_if_fail( cardFile != NULL );
+       g_return_val_if_fail( cardFile != NULL, NULL );
        return NULL;
 }
 
@@ -587,7 +589,7 @@ GList *vcard_get_list_folder( VCardFile *cardFile ) {
 * Return: List of items, or NULL if none.
 */
 GList *vcard_get_all_persons( VCardFile *cardFile ) {
-       g_return_if_fail( cardFile != NULL );
+       g_return_val_if_fail( cardFile != NULL, NULL );
        return addrcache_get_all_persons( cardFile->addressCache );
 }
 
@@ -597,7 +599,8 @@ GList *vcard_get_all_persons( VCardFile *cardFile ) {
 */
 gboolean vcard_validate( const VCardFile *cardFile ) {
        gboolean retVal;
-       g_return_if_fail( cardFile != NULL );
+
+       g_return_val_if_fail( cardFile != NULL, FALSE );
 
        retVal = TRUE;
        if( cardFile->path ) {
@@ -685,7 +688,7 @@ gchar *vcard_find_gnomecard( void ) {
 */
 gint vcard_test_read_file( const gchar *fileSpec ) {
        gboolean haveStart;
-       gchar *tagtemp = NULL, *tagname = NULL, *tagvalue = NULL, *tagtype = NULL, *tagrest = NULL, *line;
+       gchar *tagtemp = NULL, *tagname = NULL, *tagvalue = NULL, *tagtype = NULL, *line;
        VCardFile *cardFile;
        gint retVal, lines;