sync with sylpheed 0.6.3cvs6
authorPaul Mangan <paul@claws-mail.org>
Fri, 12 Oct 2001 10:23:58 +0000 (10:23 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 12 Oct 2001 10:23:58 +0000 (10:23 +0000)
12 files changed:
.cvsignore
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/folderview.c
src/gtkutils.c
src/mainwindow.c
src/prefs_common.c
src/procmsg.c
src/summaryview.c
src/summaryview.h

index 41ee7a0..5ea29b5 100644 (file)
@@ -1,18 +1,18 @@
-config.log
+aclocal.m4
+config.cache
 config.h
 config.h.in
-config.cache
-libtool
+config.log
 config.status
-stamp-h
-Makefile
-sylpheed.spec
 configure
+depcomp
+libtool
+Makefile
 Makefile.in
-aclocal.m4
 stamp-h
-stamp-h1
 stamp-h.in
+stamp-h1
+sylpheed.spec
 tags
 TAGS
 *.swp
index 89c1d73..344cecf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2001-10-12
+
+       * src/prefs_common.c
+         src/summaryview.[ch]: initial modification for reorderable columns.
+
+2001-10-12
+
+       * src/procmsg.c: procmsg_get_mark_sum(), mark_sum_func(): fixed a
+         memory leak.
+       * src/folderview.c: folderview_button_pressed(): code cleanup, and
+         turn sensitivity off if main window is locked.
+       * src/syldap.c: syldap_read_data(): removed unnecessary and
+         unportable sched_yield().
+
+2001-10-11
+
+       * src/folderview.c: renamed "Update folder tree" context menu to
+         "Rescan folder tree", and made "Update folder tree" only updates
+         folder status.
+         folderview_update_all_node(): don't show message dialog.
+       * src/gtkutils.c: gtkut_widget_get_uposition()
+         src/mainwindow.c: main_window_popup(): clip the coordinate to
+         nonnegative value.
+
 2001-10-10
 
        * src/utils.c: to_human_readable(): made a bit of optimization.
@@ -14,7 +38,7 @@
          infinite loop when failed to convert encoding.
        * src/codeconv.[ch]: a fix for older version of libjconv
          (jconv_info_get_current_codeset() returned "EUCJP" instead of
-         "EUC-JP".
+         "EUC-JP").
 
 2001-10-08
 
index 4e5b42a..5669bd8 100644 (file)
@@ -1,3 +1,12 @@
+2001-10-12 [paul]      0.6.3claws10
+
+       * sync with sylpheed 0.6.3cvs6
+               see ChangeLog entries 2001-10-11 and 2001-11-12
+
+       * src/folderview.c
+               incorporated mbox folders, scoring, and folder
+               properties into the sync
+
 2001-10-12 [darko]     0.6.3claws9
 
        * README.claws
index cad277e..c2cd99e 100644 (file)
@@ -1,3 +1,29 @@
+2001-10-12
+
+       * src/prefs_common.c
+         src/summaryview.[ch]: ½ç½øÊѹ¹²Äǽ¤Ê¥«¥é¥à¤Î¤¿¤á¤ÎºÇ½é¤Î½¤Àµ¡£
+
+2001-10-12
+
+       * src/procmsg.c: procmsg_get_mark_sum(), mark_sum_func(): ¥á¥â¥ê
+         ¥ê¡¼¥¯¤ò½¤Àµ¡£
+       * src/folderview.c: folderview_button_pressed(): ¥³¡¼¥É¤ÎÀ°Íý¤È¡¢
+         ¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¤é sensitivity ¤ò off ¤Ë¤¹¤ë
+         ¤è¤¦¤Ë¤·¤¿¡£
+       * src/syldap.c: syldap_read_data(): ÉÔÍפ«¤Ä°Ü¿¢À­¤ËÌäÂê¤Î¤¢¤ë
+         sched_yield() ¤òºï½ü¡£
+
+2001-10-11
+
+       * src/folderview.c: ¡Ö¥Õ¥©¥ë¥À¥Ä¥ê¡¼¤ò¹¹¿·¡×¥³¥ó¥Æ¥­¥¹¥È¥á¥Ë¥å¡¼
+         ¤ò¡Ö¥Õ¥©¥ë¥À¥Ä¥ê¡¼¤òºÆ¥¹¥­¥ã¥ó¡×¤ËÊѹ¹¤·¡¢¡Ö¥Õ¥©¥ë¥À¥Ä¥ê¡¼¤ò¹¹¿·¡×
+         ¤ò¥Õ¥©¥ë¥À¤Î¾õÂ֤Τߤò¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         folderview_update_all_node(): ¥á¥Ã¥»¡¼¥¸¥À¥¤¥¢¥í¥°¤òɽ¼¨¤·¤Ê¤¤
+         ¤è¤¦¤Ë¤·¤¿¡£
+       * src/gtkutils.c: gtkut_widget_get_uposition()
+         src/mainwindow.c: main_window_popup(): ºÂɸ¤òÈóÉé¤ÎÃͤË
+         ¥¯¥ê¥Ã¥Ô¥ó¥°¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2001-10-10
 
        * src/utils.c: to_human_readable(): ¾¯¤·ºÇŬ²½¡£
@@ -12,6 +38,9 @@
        * ¤¤¤¯¤Ä¤«¤Î autotool ¥¹¥¯¥ê¥×¥È¤ò¹¹¿·¡£
        * src/codeconv.c: conv_encode_header(): ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ÎÊÑ´¹¤Ë
          ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë̵¸Â¥ë¡¼¥×¤òµ¯¤³¤¹¥Ð¥°¤ò½¤Àµ¡£
+       * src/codeconv.[ch]: µì¥Ð¡¼¥¸¥ç¥ó¤Î libjconv ¤Î¤¿¤á¤Î½¤Àµ
+         (jconv_info_get_current_codeset() ¤¬ "EUC-JP" ¤ÎÂå¤ï¤ê¤Ë "EUCJP"
+         ¤òÊÖ¤·¤Æ¤¤¤¿)¡£
 
 2001-10-08
 
index 7265cd9..4b0fce2 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws9
+EXTRA_VERSION=claws10
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index a54ef4d..f218b00 100644 (file)
@@ -54,6 +54,7 @@
 #include "prefs_account.h"
 #include "account.h"
 #include "folder.h"
+#include "inc.h"
 
 #include "pixmaps/inbox.xpm"
 #include "pixmaps/outbox.xpm"
@@ -237,6 +238,8 @@ static GtkItemFactoryEntry folderview_mail_popup_entries[] =
        {N_("/_Delete folder"),         NULL, folderview_delete_folder_cb, 0, NULL},
        {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/_Update folder tree"),    NULL, folderview_update_tree_cb, 0, NULL},
+       {N_("/Re_scan folder tree"),    NULL, folderview_update_tree_cb, 1, NULL},
+       {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/Remove _mailbox"),        NULL, folderview_remove_mailbox_cb, 0, NULL},
        {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/_Property..."),           NULL, folderview_property_cb, 0, NULL},
@@ -249,7 +252,9 @@ static GtkItemFactoryEntry folderview_imap_popup_entries[] =
        {N_("/_Rename folder..."),      NULL, NULL, 0, NULL},
        {N_("/_Delete folder"),         NULL, folderview_rm_imap_folder_cb, 0, NULL},
        {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
-       {N_("/_Update folder tree"),    NULL, folderview_update_tree_cb, 0, NULL},
+       {N_("/Re_scan folder tree"),    NULL, folderview_update_tree_cb, 0, NULL},
+       {N_("/_Update folder tree"),    NULL, folderview_update_tree_cb, 1, NULL},
+       {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/Remove _IMAP4 account"),  NULL, folderview_rm_imap_server_cb, 0, NULL},
        {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/_Property..."),           NULL, NULL, 0, NULL},
@@ -450,7 +455,6 @@ void folderview_init(FolderView *folderview)
                normal_color_style = gtk_style_copy(normal_style);
                normal_color_style->fg[GTK_STATE_NORMAL] = folderview->color_new;
        }
-
 }
 
 void folderview_set(FolderView *folderview)
@@ -493,7 +497,7 @@ void folderview_select(FolderView *folderview, FolderItem *item)
        GtkCTreeNode *old_selected = folderview->selected;
 
        if (!item) return;
-       
+
        node = gtk_ctree_find_by_row_data(ctree, NULL, item);
        if (node) folderview_select_node(folderview, node);
 
@@ -665,7 +669,8 @@ void folderview_update_tree(Folder *folder)
 
        if (!folder->scan_tree) return;
 
-       window = label_window_create(_("Updating folder tree..."));
+       inc_lock();
+       window = label_window_create(_("Rescanning folder tree..."));
 
        folder_set_ui_func(folder, folderview_scan_tree_func, NULL);
        folder->scan_tree(folder);
@@ -675,6 +680,7 @@ void folderview_update_tree(Folder *folder)
        folderview_set_all();
 
        gtk_widget_destroy(window);
+       inc_unlock();
 }
 
 void folderview_update_all(void)
@@ -682,7 +688,8 @@ void folderview_update_all(void)
        GList *list;
        GtkWidget *window;
 
-       window = label_window_create(_("Updating all folders..."));
+       inc_lock();
+       window = label_window_create(_("Rescanning all folder trees..."));
 
        list = folder_get_list();
        for (; list != NULL; list = list->next) {
@@ -696,8 +703,8 @@ void folderview_update_all(void)
 
        folder_write_list();
        folderview_set_all();
-
        gtk_widget_destroy(window);
+       inc_unlock();
 }
 
 void folderview_update_all_node(void)
@@ -707,14 +714,15 @@ void folderview_update_all_node(void)
        FolderView *folderview;
        GtkCTree *ctree;
        GtkCTreeNode *node;
-       GtkWidget *window;
-
-       window = label_window_create(_("Updating all folders..."));
 
        for (list = folderview_list; list != NULL; list = list->next) {
                folderview = (FolderView *)list->data;
                ctree = GTK_CTREE(folderview->ctree);
 
+               inc_lock();
+               main_window_lock(folderview->mainwin);
+               gtk_widget_set_sensitive(folderview->ctree, FALSE);
+
                for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
                     node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                        item = gtk_ctree_node_get_row_data(ctree, node);
@@ -725,10 +733,13 @@ void folderview_update_all_node(void)
                        folder_item_scan(item);
                        folderview_update_node(folderview, node);
                }
+
+               gtk_widget_set_sensitive(folderview->ctree, TRUE);
+               main_window_unlock(folderview->mainwin);
+               inc_unlock();
        }
 
        folder_write_list();
-       gtk_widget_destroy(window);
 }
 
 static gboolean folderview_search_new_recursive(GtkCTree *ctree,
@@ -1183,6 +1194,15 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
        gint prev_row = -1, row = -1, column = -1;
        FolderItem *item;
        Folder *folder;
+       GtkWidget *popup;
+       gboolean new_folder      = FALSE;
+       gboolean rename_folder   = FALSE;
+       gboolean delete_folder   = FALSE;
+       gboolean update_tree     = FALSE;
+       gboolean rescan_tree     = FALSE;
+       gboolean remove_tree     = FALSE;
+       gboolean folder_property = FALSE;
+       gboolean folder_scoring  = FALSE;
 
        if (!event) return;
 
@@ -1224,97 +1244,66 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
        g_return_if_fail(item->folder != NULL);
        folder = item->folder;
 
-       menu_set_insensitive_all(GTK_MENU_SHELL(folderview->mail_popup));
-       menu_set_insensitive_all(GTK_MENU_SHELL(folderview->imap_popup));
-       menu_set_insensitive_all(GTK_MENU_SHELL(folderview->news_popup));
-       menu_set_insensitive_all(GTK_MENU_SHELL(folderview->mbox_popup));
-
-       if (FOLDER_IS_LOCAL(folder) && item->parent == NULL) {
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Create new folder...", TRUE);
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Update folder tree", TRUE);
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Remove mailbox", TRUE);
-       } else if (FOLDER_IS_LOCAL(folder) && item->stype != F_NORMAL) {
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Create new folder...", TRUE);
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Scoring...", TRUE);
-       } else if (FOLDER_IS_LOCAL(folder)) {
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Create new folder...", TRUE);
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Rename folder...", TRUE);
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Delete folder", TRUE);
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Scoring...", TRUE);
-               menu_set_sensitive(folderview->mail_factory,
-                                  "/Property...", TRUE);
-       } else if (folder->type == F_IMAP && item->parent == NULL) {
-               menu_set_sensitive(folderview->imap_factory,
-                                  "/Create new folder...", TRUE);
-               menu_set_sensitive(folderview->imap_factory,
-                                  "/Update folder tree", TRUE);
-               menu_set_sensitive(folderview->imap_factory,
-                                  "/Remove IMAP4 account", TRUE);
-       } else if (folder->type == F_IMAP && item->stype != F_NORMAL) {
-               menu_set_sensitive(folderview->imap_factory,
-                                  "/Create new folder...", TRUE);
-       } else if (folder->type == F_IMAP) {
-               menu_set_sensitive(folderview->imap_factory,
-                                  "/Create new folder...", TRUE);
-               menu_set_sensitive(folderview->imap_factory,
-                                  "/Delete folder", TRUE);
-               menu_set_sensitive(folderview->imap_factory,
-                                  "/Scoring...", TRUE);
-       } else if (folder->type == F_NEWS && item->parent == NULL) {
-               menu_set_sensitive(folderview->news_factory,
-                                  "/Subscribe to newsgroup...", TRUE);
-               menu_set_sensitive(folderview->news_factory,
-                                  "/Remove news account", TRUE);
-       } else if (folder->type == F_NEWS) {
-               menu_set_sensitive(folderview->news_factory,
-                                  "/Subscribe to newsgroup...", TRUE);
-               menu_set_sensitive(folderview->news_factory,
-                                  "/Remove newsgroup", TRUE);
-               menu_set_sensitive(folderview->news_factory,
-                                  "/Scoring...", TRUE);
-       }
-       if (folder->type == F_MBOX && item->parent == NULL) {
-               menu_set_sensitive(folderview->mbox_factory,
-                                  "/Create new folder...", TRUE);
-               menu_set_sensitive(folderview->mbox_factory,
-                                  "/Remove mailbox", TRUE);
-       } else if (folder->type == F_MBOX && item->stype != F_NORMAL) {
-               menu_set_sensitive(folderview->mbox_factory,
-                                  "/Create new folder...", TRUE);
-               menu_set_sensitive(folderview->mbox_factory,
-                                  "/Scoring...", TRUE);
-       } else if (folder->type == F_MBOX) {
-               menu_set_sensitive(folderview->mbox_factory,
-                                  "/Create new folder...", TRUE);
-               menu_set_sensitive(folderview->mbox_factory,
-                                  "/Rename folder...", TRUE);
-               menu_set_sensitive(folderview->mbox_factory,
-                                  "/Delete folder", TRUE);
-               menu_set_sensitive(folderview->mbox_factory,
-                                  "/Scoring...", TRUE);
+       if (folderview->mainwin->lock_count == 0) {
+               new_folder = TRUE;
+               if (item->parent == NULL)
+                       update_tree = remove_tree = TRUE;
+               if (FOLDER_IS_LOCAL(folder) || FOLDER_TYPE(folder) == F_IMAP || FOLDER_TYPE(folder) == F_MBOX) {
+                       if (item->parent == NULL)
+                               update_tree = rescan_tree = TRUE;
+                       else if (item->stype == F_NORMAL)
+                               rename_folder = delete_folder = folder_property = folder_scoring = TRUE;
+               } else if (FOLDER_TYPE(folder) == F_NEWS) {
+                       if (item->parent != NULL)
+                               delete_folder = folder_scoring = TRUE;
+               }
        }
 
-       if (FOLDER_IS_LOCAL(folder))
-               gtk_menu_popup(GTK_MENU(folderview->mail_popup), NULL, NULL,
-                              NULL, NULL, event->button, event->time);
-       else if (folder->type == F_IMAP)
-               gtk_menu_popup(GTK_MENU(folderview->imap_popup), NULL, NULL,
-                              NULL, NULL, event->button, event->time);
-       else if (folder->type == F_NEWS)
-               gtk_menu_popup(GTK_MENU(folderview->news_popup), NULL, NULL,
-                              NULL, NULL, event->button, event->time);
-       else if (folder->type == F_MBOX)
-               gtk_menu_popup(GTK_MENU(folderview->mbox_popup), NULL, NULL,
-                              NULL, NULL, event->button, event->time);
+#define SET_SENS(factory, name, sens) \
+       menu_set_sensitive(folderview->factory, name, sens)
+
+       if (FOLDER_IS_LOCAL(folder)) {
+               popup = folderview->mail_popup;
+               menu_set_insensitive_all(GTK_MENU_SHELL(popup));
+               SET_SENS(mail_factory, "/Create new folder...", new_folder);
+               SET_SENS(mail_factory, "/Rename folder...", rename_folder);
+               SET_SENS(mail_factory, "/Delete folder", delete_folder);
+               SET_SENS(mail_factory, "/Update folder tree", update_tree);
+               SET_SENS(mail_factory, "/Rescan folder tree", rescan_tree);
+               SET_SENS(mail_factory, "/Remove mailbox", remove_tree);
+               SET_SENS(mail_factory, "/Property...", folder_property);
+               SET_SENS(mail_factory, "/Scoring...", folder_scoring);
+       } else if (FOLDER_TYPE(folder) == F_IMAP) {
+               popup = folderview->imap_popup;
+               menu_set_insensitive_all(GTK_MENU_SHELL(popup));
+               SET_SENS(imap_factory, "/Create new folder...", new_folder);
+               SET_SENS(imap_factory, "/Rename folder...", rename_folder);
+               SET_SENS(imap_factory, "/Delete folder", delete_folder);
+               SET_SENS(imap_factory, "/Update folder tree", update_tree);
+               SET_SENS(imap_factory, "/Rescan folder tree", rescan_tree);
+               SET_SENS(imap_factory, "/Remove IMAP4 account", remove_tree);
+               SET_SENS(imap_factory, "/Scoring...", folder_scoring);
+       } else if (FOLDER_TYPE(folder) == F_NEWS) {
+               popup = folderview->news_popup;
+               menu_set_insensitive_all(GTK_MENU_SHELL(popup));
+               SET_SENS(news_factory, "/Subscribe to newsgroup...", new_folder);
+               SET_SENS(news_factory, "/Remove newsgroup", delete_folder);
+               SET_SENS(news_factory, "/Remove news account", remove_tree);
+               SET_SENS(news_factory, "/Scoring...", folder_scoring);
+       } else if (FOLDER_TYPE(folder) == F_MBOX) {
+               popup = folderview->mbox_popup;
+               menu_set_insensitive_all(GTK_MENU_SHELL(popup));
+               SET_SENS(mbox_factory, "/Create new folder...", new_folder);
+               SET_SENS(mbox_factory, "/Rename folder...", rename_folder);
+               SET_SENS(mbox_factory, "/Delete folder", delete_folder);
+               SET_SENS(mbox_factory, "/Scoring...", folder_scoring);
+       } else
+               return;
+
+#undef SET_SENS
+
+       gtk_menu_popup(GTK_MENU(popup), NULL, NULL, NULL, NULL,
+                      event->button, event->time);
 }
 
 static void folderview_button_released(GtkWidget *ctree, GdkEventButton *event,
@@ -1513,7 +1502,10 @@ static void folderview_update_tree_cb(FolderView *folderview, guint action,
        g_return_if_fail(item != NULL);
        g_return_if_fail(item->folder != NULL);
 
-       folderview_update_tree(item->folder);
+       if (action == 0)
+               folderview_update_all_node();
+       else
+               folderview_update_tree(item->folder);
 }
 
 static void folderview_new_folder_cb(FolderView *folderview, guint action,
index 581c98d..c102551 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -319,8 +319,8 @@ void gtkut_widget_get_uposition(GtkWidget *widget, gint *px, gint *py)
 
        sx = gdk_screen_width();
        sy = gdk_screen_height();
-       x %= sx; if (x < 0) x += sx;
-       y %= sy; if (y < 0) y += sy;
+       x %= sx; if (x < 0) x = 0;
+       y %= sy; if (y < 0) y = 0;
        *px = x;
        *py = y;
 }
index fd2fd73..94d4e5d 100644 (file)
@@ -400,7 +400,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_File"),                          NULL, NULL, 0, "<Branch>"},
        {N_("/_File/_Add mailbox..."),          NULL, add_mailbox_cb, 0, NULL},
        {N_("/_File/_Add mbox mailbox..."),     NULL, add_mbox_cb, 0, NULL},
-       {N_("/_File/_Update folder tree"),      NULL, update_folderview_cb, 0, NULL},
+       {N_("/_File/_Rescan folder tree"),      NULL, update_folderview_cb, 0, NULL},
        {N_("/_File/_Folder"),                  NULL, NULL, 0, "<Branch>"},
        {N_("/_File/_Folder/Create _new folder..."),
                                                NULL, new_folder_cb, 0, NULL},
@@ -1313,7 +1313,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        } entry[] = {
                {"/File/Add mailbox..."        , M_UNLOCKED},
                 {"/File/Add mbox mailbox..."   , M_UNLOCKED},
-               {"/File/Update folder tree"    , M_UNLOCKED},
+               {"/File/Rescan folder tree"    , M_UNLOCKED},
                {"/File/Folder"                , M_UNLOCKED},
                {"/File/Import mbox file..."   , M_UNLOCKED},
                {"/File/Export to mbox file...", M_UNLOCKED},
@@ -1381,8 +1381,8 @@ void main_window_popup(MainWindow *mainwin)
        gdk_window_get_origin(mainwin->window->window, &x, &y);
        sx = gdk_screen_width();
        sy = gdk_screen_height();
-       x %= sx; if (x < 0) x += sx;
-       y %= sy; if (y < 0) y += sy;
+       x %= sx; if (x < 0) x = 0;
+       y %= sy; if (y < 0) y = 0;
        gdk_window_move(mainwin->window->window, x, y);
        gdk_window_raise(mainwin->window->window);
        gdk_window_show(mainwin->window->window);
@@ -1393,30 +1393,30 @@ void main_window_popup(MainWindow *mainwin)
        case SEPARATE_FOLDER:
                widget = mainwin->win.sep_folder.folderwin;
                gdk_window_get_origin(widget->window, &x, &y);
-               x %= sx; if (x < 0) x += sx;
-               y %= sy; if (y < 0) y += sy;
+               x %= sx; if (x < 0) x = 0;
+               y %= sy; if (y < 0) y = 0;
                gdk_window_move(widget->window, x, y);
                gdk_window_raise(widget->window);
                break;
        case SEPARATE_MESSAGE:
                widget = mainwin->win.sep_message.messagewin;
                gdk_window_get_origin(widget->window, &x, &y);
-               x %= sx; if (x < 0) x += sx;
-               y %= sy; if (y < 0) y += sy;
+               x %= sx; if (x < 0) x = 0;
+               y %= sy; if (y < 0) y = 0;
                gdk_window_move(widget->window, x, y);
                gdk_window_raise(widget->window);
                break;
        case SEPARATE_BOTH:
                widget = mainwin->win.sep_both.folderwin;
                gdk_window_get_origin(widget->window, &x, &y);
-               x %= sx; if (x < 0) x += sx;
-               y %= sy; if (y < 0) y += sy;
+               x %= sx; if (x < 0) x = 0;
+               y %= sy; if (y < 0) y = 0;
                gdk_window_move(widget->window, x, y);
                gdk_window_raise(widget->window);
                widget = mainwin->win.sep_both.messagewin;
                gdk_window_get_origin(widget->window, &x, &y);
-               x %= sx; if (x < 0) x += sx;
-               y %= sy; if (y < 0) y += sy;
+               x %= sx; if (x < 0) x = 0;
+               y %= sy; if (y < 0) y = 0;
                gdk_window_move(widget->window, x, y);
                gdk_window_raise(widget->window);
                break;
index c9c3d59..3d57841 100644 (file)
@@ -3055,6 +3055,9 @@ void prefs_summary_display_item_set(void)
        }
 }
 
+#undef SET_ACTIVE
+#undef GET_ACTIVE
+
 #define SET_CHECK_BUTTON(column, label) \
 { \
        summarydispitem.chkbtn[column] = \
@@ -3119,6 +3122,8 @@ static void prefs_summary_display_item_dialog_create(gboolean *cancelled)
        summarydispitem.cancel_btn = cancel_btn;
 }
 
+#undef SET_CHECK_BUTTON
+
 static void display_item_ok(GtkWidget *widget, gboolean *cancelled)
 {
        *cancelled = FALSE;
index 250881e..c529fcb 100644 (file)
@@ -404,6 +404,8 @@ static void mark_sum_func(gpointer key, gpointer value, gpointer data)
        if (MSG_IS_NEW(*flags) && !MSG_IS_IGNORE_THREAD(*flags)) (*marksum->new)++;
        if (MSG_IS_UNREAD(*flags) && !MSG_IS_IGNORE_THREAD(*flags)) (*marksum->unread)++;
        (*marksum->total)++;
+
+       g_free(flags);
 }
 
 void procmsg_get_mark_sum(const gchar *folder,
index c585318..4459a11 100644 (file)
@@ -187,7 +187,8 @@ static void summary_update_status   (SummaryView            *summaryview);
 static void summary_status_show                (SummaryView            *summaryview);
 static void summary_set_ctree_from_list        (SummaryView            *summaryview,
                                         GSList                 *mlist);
-static void summary_set_header         (gchar                  *text[],
+static void summary_set_header         (SummaryView            *summaryview,
+                                        gchar                  *text[],
                                         MsgInfo                *msginfo);
 static void summary_display_msg                (SummaryView            *summaryview,
                                         GtkCTreeNode           *row,
@@ -410,10 +411,35 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/Select _all"),            NULL, summary_select_all, 0, NULL}
 };
 
+static const gchar *const col_label[N_SUMMARY_COLS] = {
+       N_("M"),        /* S_COL_MARK    */
+       N_("U"),        /* S_COL_UNREAD  */
+       "",             /* S_COL_MIME    */
+       N_("No."),      /* S_COL_NUMBER  */
+       N_("Score"),    /* S_COL_SCORE   */
+       N_("Size"),     /* S_COL_SIZE    */
+       N_("Date"),     /* S_COL_DATE    */
+       N_("From"),     /* S_COL_FROM    */
+       N_("Subject")   /* S_COL_SUBJECT */
+};
+
 SummaryView *summary_create(void)
 {
        SummaryView *summaryview;
-       gchar *titles[N_SUMMARY_COLS] = {_("M"), _("U")};
+       SummaryColumnState *col_state;
+       gint *col_pos;
+       SummaryColumnType col_default[N_SUMMARY_COLS] = {
+               S_COL_MARK,
+               S_COL_UNREAD,
+               S_COL_MIME,
+               S_COL_NUMBER,
+               S_COL_SCORE,
+               S_COL_SIZE,
+               S_COL_DATE,
+               S_COL_FROM,
+               S_COL_SUBJECT
+       };
+       const gchar *titles[N_SUMMARY_COLS];
        GtkWidget *vbox;
        GtkWidget *scrolledwin;
        GtkWidget *ctree;
@@ -442,56 +468,69 @@ SummaryView *summary_create(void)
                             prefs_common.summaryview_width,
                             prefs_common.summaryview_height);
 
-       if (prefs_common.trans_hdr) {
-               titles[S_COL_NUMBER]  = _("No.");
-               titles[S_COL_DATE]    = _("Date");
-               titles[S_COL_FROM]    = _("From");
-               titles[S_COL_SUBJECT] = _("Subject");
-       } else {
-               titles[S_COL_NUMBER]  = "No.";
-               titles[S_COL_DATE]    = "Date";
-               titles[S_COL_FROM]    = "From";
-               titles[S_COL_SUBJECT] = "Subject";
+       col_state = summaryview->col_state;
+       col_pos = summaryview->col_pos;
+
+       for (i = 0; i < N_SUMMARY_COLS; i++) {
+               SummaryColumnType type;
+
+               type = col_state[i].type = col_default[i];
+               col_state[i].visible = TRUE;
+               col_pos[i] = i;
+               switch (type) {
+               case S_COL_SCORE:
+               case S_COL_SIZE:
+               case S_COL_NUMBER:
+               case S_COL_DATE:
+               case S_COL_FROM:
+               case S_COL_SUBJECT:
+                       if (prefs_common.trans_hdr)
+                               titles[i] = gettext(col_label[type]);
+                       else
+                               titles[i] = col_label[type];
+                       break;
+               default:
+                       titles[i] = gettext(col_label[type]);
+               }
        }
-       titles[S_COL_SIZE]  = _("Size");
-       titles[S_COL_SCORE] = _("Score");
 
-       ctree = gtk_sctree_new_with_titles(N_SUMMARY_COLS, S_COL_SUBJECT, titles);
+       ctree = gtk_sctree_new_with_titles
+               (N_SUMMARY_COLS, col_pos[S_COL_SUBJECT], (gchar **)titles);
        gtk_scrolled_window_set_hadjustment(GTK_SCROLLED_WINDOW(scrolledwin),
                                            GTK_CLIST(ctree)->hadjustment);
        gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(scrolledwin),
                                            GTK_CLIST(ctree)->vadjustment);
        gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
        gtk_clist_set_selection_mode(GTK_CLIST(ctree), GTK_SELECTION_EXTENDED);
-       gtk_clist_set_column_justification(GTK_CLIST(ctree), S_COL_MARK,
+       gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_MARK],
                                           GTK_JUSTIFY_CENTER);
-       gtk_clist_set_column_justification(GTK_CLIST(ctree), S_COL_UNREAD,
+       gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_UNREAD],
                                           GTK_JUSTIFY_CENTER);
-       gtk_clist_set_column_justification(GTK_CLIST(ctree), S_COL_MIME,
+       gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_MIME],
                                           GTK_JUSTIFY_CENTER);
-       gtk_clist_set_column_justification(GTK_CLIST(ctree), S_COL_NUMBER,
+       gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_NUMBER],
                                           GTK_JUSTIFY_RIGHT);
-       gtk_clist_set_column_justification(GTK_CLIST(ctree), S_COL_SCORE,
+       gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_SCORE],
                                           GTK_JUSTIFY_RIGHT);
-       gtk_clist_set_column_justification(GTK_CLIST(ctree), S_COL_SIZE,
+       gtk_clist_set_column_justification(GTK_CLIST(ctree), col_pos[S_COL_SIZE],
                                           GTK_JUSTIFY_RIGHT);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_MARK,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_MARK],
                                   SUMMARY_COL_MARK_WIDTH);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_UNREAD,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_UNREAD],
                                   SUMMARY_COL_UNREAD_WIDTH);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_MIME,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_MIME],
                                   SUMMARY_COL_MIME_WIDTH);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_NUMBER,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_NUMBER],
                                   prefs_common.summary_col_number);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_SCORE,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_SCORE],
                                   prefs_common.summary_col_score);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_SIZE,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_SIZE],
                                   prefs_common.summary_col_size);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_DATE,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_DATE],
                                   prefs_common.summary_col_date);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_FROM,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_FROM],
                                   prefs_common.summary_col_from);
-       gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_SUBJECT,
+       gtk_clist_set_column_width(GTK_CLIST(ctree), col_pos[S_COL_SUBJECT],
                                   prefs_common.summary_col_subject);
        gtk_ctree_set_line_style(GTK_CTREE(ctree), GTK_CTREE_LINES_DOTTED);
        gtk_ctree_set_expander_style(GTK_CTREE(ctree),
@@ -512,7 +551,7 @@ SummaryView *summary_create(void)
        /* connect signal to the buttons for sorting */
 #define CLIST_BUTTON_SIGNAL_CONNECT(col, func) \
        gtk_signal_connect \
-               (GTK_OBJECT(GTK_CLIST(ctree)->column[col].button), \
+               (GTK_OBJECT(GTK_CLIST(ctree)->column[col_pos[col]].button), \
                 "clicked", \
                 GTK_SIGNAL_FUNC(func), \
                 summaryview)
@@ -633,7 +672,7 @@ void summary_init(SummaryView *summaryview)
 
        pixmap = gtk_pixmap_new(clipxpm, clipxpmmask);
        gtk_clist_set_column_widget(GTK_CLIST(summaryview->ctree),
-                                   S_COL_MIME, pixmap);
+                                   summaryview->col_pos[S_COL_MIME], pixmap);
        gtk_widget_show(pixmap);
 
        if (!small_style) {
@@ -1004,8 +1043,13 @@ void summary_clear_list(SummaryView *summaryview)
        summaryview->sort_type = GTK_SORT_ASCENDING;
 
        gtk_clist_clear(clist);
-       optimal_width = gtk_clist_optimal_column_width(clist, S_COL_SUBJECT);
-       gtk_clist_set_column_width(clist, S_COL_SUBJECT, optimal_width);
+       if (summaryview->col_pos[S_COL_SUBJECT] == N_SUMMARY_COLS - 1) {
+               optimal_width = gtk_clist_optimal_column_width
+                       (clist, summaryview->col_pos[S_COL_SUBJECT]);
+               gtk_clist_set_column_width
+                       (clist, summaryview->col_pos[S_COL_SUBJECT],
+                        optimal_width);
+       }
 
        gtk_clist_thaw(clist);
 }
@@ -1934,7 +1978,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                        msginfo = (MsgInfo *)mlist->data;
                        parent = NULL;
 
-                       summary_set_header(text, msginfo);
+                       summary_set_header(summaryview, text, msginfo);
 
                        /* search parent node for threading */
                        if (msginfo->inreplyto && *msginfo->inreplyto) {
@@ -2017,7 +2061,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                for (; mlist != NULL; mlist = mlist->next) {
                        msginfo = (MsgInfo *)mlist->data;
 
-                       summary_set_header(text, msginfo);
+                       summary_set_header(summaryview, text, msginfo);
 
                        node = gtk_ctree_insert_node
                                (ctree, NULL, NULL, text, 2,
@@ -2042,12 +2086,14 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                }
        }
 
-       if (prefs_common.enable_hscrollbar) {
+       if (prefs_common.enable_hscrollbar &&
+           summaryview->col_pos[S_COL_SUBJECT] == N_SUMMARY_COLS - 1) {
                gint optimal_width;
 
                optimal_width = gtk_clist_optimal_column_width
-                       (GTK_CLIST(ctree), S_COL_SUBJECT);
-               gtk_clist_set_column_width(GTK_CLIST(ctree), S_COL_SUBJECT,
+                       (GTK_CLIST(ctree), summaryview->col_pos[S_COL_SUBJECT]);
+               gtk_clist_set_column_width(GTK_CLIST(ctree),
+                                          summaryview->col_pos[S_COL_SUBJECT],
                                           optimal_width);
        }
 
@@ -2172,34 +2218,37 @@ static void summary_write_cache_func(GtkCTree *ctree, GtkCTreeNode *node,
        procmsg_write_flags(msginfo, fps->mark_fp);
 }
 
-static void summary_set_header(gchar *text[], MsgInfo *msginfo)
+static void summary_set_header(SummaryView *summaryview, gchar *text[],
+                              MsgInfo *msginfo)
 {
        static gchar date_modified[80];
        static gchar *to = NULL;
        static gchar *from_name = NULL;
        static gchar col_number[11];
        static gchar col_score[11];
+       gint *col_pos = summaryview->col_pos;
+
+       text[col_pos[S_COL_MARK]]   = NULL;
+       text[col_pos[S_COL_UNREAD]] = NULL;
+       text[col_pos[S_COL_MIME]]   = NULL;
+       text[col_pos[S_COL_NUMBER]] = itos(msginfo->msgnum);
+       text[col_pos[S_COL_SIZE]]   = to_human_readable(msginfo->size);
 
-       text[S_COL_MARK]   = NULL;
-       text[S_COL_UNREAD] = NULL;
-       text[S_COL_MIME]   = NULL;
-       text[S_COL_NUMBER] = itos_buf(col_number, msginfo->msgnum);
-       text[S_COL_SIZE]   = to_human_readable(msginfo->size);
 #if 0
-       text[S_COL_SCORE]  = itos_buf(col_score, msginfo->threadscore);
+       text[col_pos[S_COL_SCORE]]  = itos_buf(col_score, msginfo->threadscore);
 #else
-       text[S_COL_SCORE]  = itos_buf(col_score, msginfo->score);
+       text[col_pos[S_COL_SCORE]]  = itos_buf(col_score, msginfo->score);
 #endif
 
        if (msginfo->date_t) {
                procheader_date_get_localtime(date_modified,
                                              sizeof(date_modified),
                                              msginfo->date_t);
-               text[S_COL_DATE] = date_modified;
+               text[col_pos[S_COL_DATE]] = date_modified;
        } else if (msginfo->date)
-               text[S_COL_DATE] = msginfo->date;
+               text[col_pos[S_COL_DATE]] = msginfo->date;
        else
-               text[S_COL_DATE] = _("(No Date)");
+               text[col_pos[S_COL_DATE]] = _("(No Date)");
 
        text[S_COL_FROM] = msginfo->fromname ? msginfo->fromname :
                _("(No From)");
@@ -2213,7 +2262,7 @@ static void summary_set_header(gchar *text[], MsgInfo *msginfo)
                if (account_find_from_address(from)) {
                        g_free(to);
                        to = g_strconcat("-->", msginfo->to, NULL);
-                       text[S_COL_FROM] = to;
+                       text[col_pos[S_COL_FROM]] = to;
                }
        }
 
@@ -2237,7 +2286,7 @@ static void summary_set_header(gchar *text[], MsgInfo *msginfo)
                }
        }
 
-       text[S_COL_SUBJECT] = msginfo->subject ? msginfo->subject :
+       text[col_pos[S_COL_SUBJECT]] = msginfo->subject ? msginfo->subject :
                _("(No Subject)");
 }
 
@@ -2468,6 +2517,7 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
        GtkStyle *style = NULL;
        MsgInfo *msginfo;
        MsgFlags flags;
+       gint *col_pos = summaryview->col_pos;
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
        if (!msginfo) return;
@@ -2478,22 +2528,23 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
 
        /* set new/unread column */
        if (MSG_IS_IGNORE_THREAD(flags)) {
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_UNREAD],
                                          ignorethreadxpm, ignorethreadxpmmask);
        } else if (MSG_IS_NEW(flags)) {
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_UNREAD],
                                          newxpm, newxpmmask);
        } else if (MSG_IS_UNREAD(flags)) {
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_UNREAD],
                                          unreadxpm, unreadxpmmask);
        } else if (MSG_IS_REPLIED(flags)) {
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_UNREAD],
                                          repliedxpm, repliedxpmmask);
        } else if (MSG_IS_FORWARDED(flags)) {
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_UNREAD],
                                          forwardedxpm, forwardedxpmmask);
        } else {
-               gtk_ctree_node_set_text(ctree, row, S_COL_UNREAD, NULL);
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_UNREAD],
+                                       NULL);
        }
 
        if (prefs_common.bold_unread &&
@@ -2505,7 +2556,7 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
 
        /* set mark column */
        if (MSG_IS_DELETED(flags)) {
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_MARK,
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MARK],
                                          deletedxpm, deletedxpmmask);
                if (style)
                        style = bold_deleted_style;
@@ -2515,10 +2566,10 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                        gtk_ctree_node_set_foreground
                                (ctree, row, &summaryview->color_dim);
        } else if (MSG_IS_MARKED(flags)) {
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_MARK,
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MARK],
                                          markxpm, markxpmmask);
        } else if (MSG_IS_MOVE(flags)) {
-               gtk_ctree_node_set_text(ctree, row, S_COL_MARK, "o");
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MARK], "o");
                if (style)
                        style = bold_marked_style;
                else {
@@ -2527,8 +2578,8 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                        gtk_ctree_node_set_foreground
                                (ctree, row, &summaryview->color_marked);
        } else if (MSG_IS_COPY(flags)) {
-               gtk_ctree_node_set_text(ctree, row, S_COL_MARK, "O");
-                if (style)
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MARK], "O");
+               if (style)
                        style = bold_marked_style;
                else {
                        style = small_marked_style;
@@ -2544,14 +2595,14 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                gtk_ctree_node_set_foreground(ctree, row,
                                              &summaryview->color_important);
        } else {
-               gtk_ctree_node_set_text(ctree, row, S_COL_MARK, NULL);
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MARK], NULL);
        }
 
        if (MSG_IS_MIME(flags)) {
-               gtk_ctree_node_set_pixmap(ctree, row, S_COL_MIME,
+               gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MIME],
                                          clipxpm, clipxpmmask);
        } else {
-               gtk_ctree_node_set_text(ctree, row, S_COL_MIME, NULL);
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MIME], NULL);
        }
         if (!style)
                style = small_style;
@@ -4086,7 +4137,7 @@ static void summary_selected(GtkCTree *ctree, GtkCTreeNode *row,
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
 
-       switch (column) {
+       switch (column < 0 ? column : summaryview->col_state[column].type) {
        case S_COL_MARK:
                if (MSG_IS_MARKED(msginfo->flags)) {
                        MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_MARKED);
@@ -4118,7 +4169,7 @@ static void summary_selected(GtkCTree *ctree, GtkCTreeNode *row,
 static void summary_col_resized(GtkCList *clist, gint column, gint width,
                                SummaryView *summaryview)
 {
-       switch (column) {
+       switch (summaryview->col_state[column].type) {
        case S_COL_MARK:
                prefs_common.summary_col_mark = width;
                break;
@@ -4290,15 +4341,21 @@ void summary_change_display_item(SummaryView *summaryview)
 {
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
 
-       gtk_clist_set_column_visibility(clist, S_COL_MARK, prefs_common.show_mark);
-       gtk_clist_set_column_visibility(clist, S_COL_UNREAD, prefs_common.show_unread);
-       gtk_clist_set_column_visibility(clist, S_COL_MIME, prefs_common.show_mime);
-       gtk_clist_set_column_visibility(clist, S_COL_NUMBER, prefs_common.show_number);
-       gtk_clist_set_column_visibility(clist, S_COL_SCORE, prefs_common.show_score);
-       gtk_clist_set_column_visibility(clist, S_COL_SIZE, prefs_common.show_size);
-       gtk_clist_set_column_visibility(clist, S_COL_DATE, prefs_common.show_date);
-       gtk_clist_set_column_visibility(clist, S_COL_FROM, prefs_common.show_from);
-       gtk_clist_set_column_visibility(clist, S_COL_SUBJECT, prefs_common.show_subject);
+#define SET_VISIBLE(col, visible) \
+       gtk_clist_set_column_visibility(clist, summaryview->col_pos[col], \
+                                       prefs_common.visible)
+
+       SET_VISIBLE(S_COL_MARK   , show_mark);
+       SET_VISIBLE(S_COL_UNREAD , show_unread);
+       SET_VISIBLE(S_COL_MIME   , show_mime);
+       SET_VISIBLE(S_COL_NUMBER , show_number);
+       SET_VISIBLE(S_COL_SCORE  , show_score);
+       SET_VISIBLE(S_COL_SIZE   , show_size);
+       SET_VISIBLE(S_COL_DATE   , show_date);
+       SET_VISIBLE(S_COL_FROM   , show_from);
+       SET_VISIBLE(S_COL_SUBJECT, show_subject);
+
+#undef SET_VISIBLE
 }
 
 static void summary_start_drag(GtkWidget *widget, gint button, GdkEvent *event,
index 86a89d6..49f4bc9 100644 (file)
@@ -27,7 +27,8 @@
 #include <gtk/gtkctree.h>
 #include <gtk/gtkdnd.h>
 
-typedef struct _SummaryView    SummaryView;
+typedef struct _SummaryView            SummaryView;
+typedef struct _SummaryColumnState     SummaryColumnState;
 
 #include "mainwindow.h"
 #include "folderview.h"
@@ -39,16 +40,16 @@ typedef struct _SummaryView SummaryView;
 
 typedef enum
 {
-       S_COL_MARK      = 0,
-       S_COL_UNREAD    = 1,
-       S_COL_MIME      = 2,
-       S_COL_NUMBER    = 3,
-       S_COL_SCORE     = 4,
-       S_COL_SIZE      = 5,
-       S_COL_DATE      = 6,
-       S_COL_FROM      = 7,
-       S_COL_SUBJECT   = 8
-} SummaryColumnPos;
+       S_COL_MARK,
+       S_COL_UNREAD,
+       S_COL_MIME,
+       S_COL_NUMBER,
+       S_COL_SCORE,
+       S_COL_SIZE,
+       S_COL_DATE,
+       S_COL_FROM,
+       S_COL_SUBJECT,
+} SummaryColumnType;
 
 #define N_SUMMARY_COLS 9
 
@@ -83,6 +84,12 @@ typedef enum
 
 extern GtkTargetEntry summary_drag_types[1];
 
+struct _SummaryColumnState
+{
+       SummaryColumnType type;
+       gboolean visible;
+};
+
 struct _SummaryView
 {
        GtkWidget *vbox;
@@ -108,6 +115,9 @@ struct _SummaryView
        gboolean display_msg;
 
        GdkColor color_important;
+       SummaryColumnState col_state[N_SUMMARY_COLS];
+       gint col_pos[N_SUMMARY_COLS];
+
        GdkColor color_marked;
        GdkColor color_dim;