2005-10-06 [colin] 1.9.15cvs17
authorColin Leroy <colin@colino.net>
Thu, 6 Oct 2005 19:31:50 +0000 (19:31 +0000)
committerColin Leroy <colin@colino.net>
Thu, 6 Oct 2005 19:31:50 +0000 (19:31 +0000)
* src/summaryview.c
Little optimisations + bugfix
* src/toolbar.c
Remove default useless items - useless being defined
                by the default relevant prefs
* src/wizard.c
include config.h to make gettext work
* src/prefs_themes.c
Fix selection of current theme in prefs

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/prefs_themes.c
src/summaryview.c
src/toolbar.c
src/wizard.c

index c6b3bdeace51076b5cde4de2339c9a28bc5b2032..271fca79a31c51715cbc0c655effaca8f1d2a86f 100644 (file)
@@ -1,3 +1,15 @@
+2005-10-06 [colin]     1.9.15cvs17
+
+       * src/summaryview.c
+               Little optimisations + bugfix
+       * src/toolbar.c
+               Remove default useless items - useless being defined
+                by the default relevant prefs
+       * src/wizard.c
+               include config.h to make gettext work
+       * src/prefs_themes.c
+               Fix selection of current theme in prefs
+
 2005-10-06 [colin]     1.9.15cvs16
 
        * src/prefs_common.c
index 38f41214d25a83b2ec719c15b6824541dd15e514..d6809fb64ae5320d66cc7118db3ccf7da73e5111 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.213.2.61 -r 1.213.2.62 src/folder.c;  cvs diff -u -r 1.87.2.20 -r 1.87.2.21 src/folder.h;  cvs diff -u -r 1.207.2.67 -r 1.207.2.68 src/folderview.c;  cvs diff -u -r 1.20.2.8 -r 1.20.2.9 src/folderview.h;  cvs diff -u -r 1.179.2.75 -r 1.179.2.76 src/imap.c;  cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/imap_gtk.c;  cvs diff -u -r 1.274.2.69 -r 1.274.2.70 src/mainwindow.c;  cvs diff -u -r 1.2.2.12 -r 1.2.2.13 src/mh_gtk.c;  cvs diff -u -r 1.5.2.8 -r 1.5.2.9 src/setup.c;  cvs diff -u -r 1.395.2.130 -r 1.395.2.131 src/summaryview.c;  ) > 1.9.15cvs14.patchset
 ( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 po/nb.po;  cvs diff -u -r 1.50.2.11 -r 1.50.2.12 po/pt_BR.po;  ) > 1.9.15cvs15.patchset
 ( cvs diff -u -r 1.204.2.59 -r 1.204.2.60 src/prefs_common.c;  cvs diff -u -r 1.103.2.30 -r 1.103.2.31 src/prefs_common.h;  cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/prefs_summaries.c;  cvs diff -u -r 1.207.2.68 -r 1.207.2.69 src/folderview.c;  ) > 1.9.15cvs16.patchset
+( cvs diff -u -r 1.395.2.131 -r 1.395.2.132 src/summaryview.c;  cvs diff -u -r 1.43.2.28 -r 1.43.2.29 src/toolbar.c;  cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/wizard.c;  cvs diff -u -r 1.3.2.28 -r 1.3.2.29 src/prefs_themes.c;  ) > 1.9.15cvs17.patchset
index 9076a330c1d38cb9aeab365b6782dab22e2f57f6..d9b5e7b9efeb6d67c0438251f052227f4e9542aa 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=15
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=16
+EXTRA_VERSION=17
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 536efb97f285e00281fe3f0f5bb8783840cbb6f3..947612f6c12b72a46f1e9707ccee04635091d1e4 100644 (file)
@@ -318,6 +318,9 @@ static void prefs_themes_get_themes_and_names(ThemesData *tdata)
                name->item = tpaths;
                        
                tdata->names = g_list_append(tdata->names, name);
+               if (!strcmp2(tpaths->data, prefs_common.pixmap_theme_path)) {
+                       tdata->displayed = (gchar *)tpaths->data;
+               }
                tpaths = g_list_next(tpaths);
                g_free(sname);  
        }
@@ -353,7 +356,8 @@ void prefs_themes_init(void)
        tdata->page = page;
 
        tpaths = g_list_first(tdata->themes);
-       tdata->displayed = (gchar *)(tpaths->data);
+       if (tdata->displayed == NULL)
+               tdata->displayed = (gchar *)(tpaths->data);
 }
 
 static void prefs_themes_free_names(ThemesData *tdata)
index 16c48cc65fd1c5bc397b341ec015b6cce4f9dcde..a2a327653044e8ca165caff38295f4384ebdd3cc 100644 (file)
@@ -861,7 +861,6 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
        gtk_clist_freeze(GTK_CLIST(ctree));
 
        summary_clear_list(summaryview);
-       summary_set_column_titles(summaryview);
 
        buf = NULL;
        if (!item || !item->path || !folder_item_parent(item) || item->no_select) {
@@ -1041,7 +1040,6 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                summary_lock(summaryview);
        }
 
-       summary_set_column_titles(summaryview);
        summary_status_show(summaryview);
        summary_set_menu_sensitive(summaryview);
        toolbar_main_set_sensitive(summaryview->mainwin);
@@ -1847,10 +1845,6 @@ static void summary_set_marks_func(GtkCTree *ctree, GtkCTreeNode *node,
            msginfo->folder->folder->klass->type == F_NEWS)
                news_flag_crosspost(msginfo);
 
-       if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
-       && procmsg_msg_has_marked_parent(msginfo))
-               summaryview->unreadmarked++;
-
        if (MSG_IS_DELETED(msginfo->flags))
                summaryview->deleted++;
 
@@ -1872,9 +1866,6 @@ static void summary_update_status(SummaryView *summaryview)
             node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
 
-               if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
-               && procmsg_msg_has_marked_parent(msginfo))
-                       summaryview->unreadmarked++;
                if (MSG_IS_DELETED(msginfo->flags))
                        summaryview->deleted++;
                if (MSG_IS_MOVE(msginfo->flags))
@@ -2035,8 +2026,7 @@ static void summary_set_column_titles(SummaryView *summaryview)
                        gtk_widget_show(label);
                        gtk_clist_set_column_widget(clist, pos, label);
                        continue;
-               }
-               if (single_char) {
+               } else if (single_char) {
                        gtk_clist_set_column_title(clist, pos, title);
                        continue;
                }
@@ -2208,7 +2198,7 @@ gboolean summary_insert_gnode_func(GtkCTree *ctree, guint depth, GNode *gnode,
        SET_TEXT(S_COL_DATE);
        SET_TEXT(S_COL_FROM);
        SET_TEXT(S_COL_TO);
-       SET_TEXT(S_COL_SUBJECT);
+       /* SET_TEXT(S_COL_SUBJECT);  already set by node info */
 
 #undef SET_TEXT
 
@@ -2317,11 +2307,13 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
 
        node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
-       while (prefs_common.bold_unread && node) {
-               GtkCTreeNode *next = GTK_CTREE_NODE_NEXT(node);
-               if (GTK_CTREE_ROW(node)->children)
-                       summary_set_row_marks(summaryview, node);
-               node = next;
+       if (prefs_common.bold_unread) {
+               while (node) {
+                       GtkCTreeNode *next = GTK_CTREE_NODE_NEXT(node);
+                       if (GTK_CTREE_ROW(node)->children)
+                               summary_set_row_marks(summaryview, node);
+                       node = next;
+               }
        }
 
        g_signal_handlers_unblock_by_func(G_OBJECT(ctree),
@@ -2361,14 +2353,17 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
        static gchar col_score[11];
        static gchar buf[BUFFSIZE];
        gint *col_pos = summaryview->col_pos;
-       FolderType ftype = F_UNKNOWN;
        gchar *from_text = NULL, *to_text = NULL;
        gboolean should_swap = FALSE;
 
-       text[col_pos[S_COL_MARK]]   = NULL;
-       text[col_pos[S_COL_STATUS]] = NULL;
-       text[col_pos[S_COL_MIME]]   = NULL;
-       text[col_pos[S_COL_LOCKED]] = NULL;
+       text[col_pos[S_COL_FROM]]   = "";
+       text[col_pos[S_COL_TO]]     = "";
+       text[col_pos[S_COL_SUBJECT]]= "";
+       text[col_pos[S_COL_MARK]]   = "";
+       text[col_pos[S_COL_STATUS]] = "";
+       text[col_pos[S_COL_MIME]]   = "";
+       text[col_pos[S_COL_LOCKED]] = "";
+       text[col_pos[S_COL_DATE]]   = "";
        text[col_pos[S_COL_NUMBER]] = itos(msginfo->msgnum);
        text[col_pos[S_COL_SIZE]]   = to_human_readable(msginfo->size);
        text[col_pos[S_COL_SCORE]]  = itos_buf(col_score, msginfo->score);
@@ -2383,7 +2378,7 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
        else
                text[col_pos[S_COL_DATE]] = _("(No Date)");
 
-       if (ftype != F_NEWS && prefs_common.swap_from && msginfo->from && msginfo->to) {
+       if (prefs_common.swap_from && msginfo->from && msginfo->to) {
                gchar *addr = NULL;
                
                addr = g_strdup(msginfo->from);
@@ -2425,9 +2420,6 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
                text[col_pos[S_COL_TO]] = tmp;
        }
        
-       if (msginfo->folder && msginfo->folder->folder)
-               ftype = msginfo->folder->folder->klass->type; 
-               
        if (summaryview->simplify_subject_preg != NULL)
                text[col_pos[S_COL_SUBJECT]] = msginfo->subject ? 
                        string_remove_match(buf, BUFFSIZE, msginfo->subject, 
@@ -2450,9 +2442,6 @@ static void msginfo_mark_as_read (SummaryView *summaryview, MsgInfo *msginfo,
        g_return_if_fail(msginfo != NULL);
        g_return_if_fail(row != NULL);
 
-       if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags) 
-       && procmsg_msg_has_marked_parent(msginfo))
-               summaryview->unreadmarked--;
        if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
                procmsg_msginfo_unset_flags
                        (msginfo, MSG_NEW | MSG_UNREAD, 0);
@@ -2726,7 +2715,7 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                                          forwardedxpm, forwardedxpmmask);
        } else {
                gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_STATUS],
-                                       NULL);
+                                       "");
        }
 
        if (prefs_common.bold_unread &&
@@ -2778,7 +2767,7 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                                              &summaryview->color_important);
 #endif
        } else {
-               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MARK], NULL);
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MARK], "");
        }
 
        if (MSG_IS_LOCKED(flags)) {
@@ -2786,7 +2775,7 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                                          lockedxpm, lockedxpmmask);
        }
        else {
-               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_LOCKED], NULL);
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_LOCKED], "");
        }
 
        if (MSG_IS_WITH_ATTACHMENT(flags) && MSG_IS_SIGNED(flags)) {
@@ -2805,7 +2794,7 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                gtk_ctree_node_set_pixmap(ctree, row, col_pos[S_COL_MIME],
                                          clipxpm, clipxpmmask);
        } else {
-               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MIME], NULL);
+               gtk_ctree_node_set_text(ctree, row, col_pos[S_COL_MIME], "");
        }
        if (!style)
                style = small_style;
@@ -2816,16 +2805,6 @@ static void summary_set_row_marks(SummaryView *summaryview, GtkCTreeNode *row)
                summary_set_colorlabel_color(ctree, row, MSG_GET_COLORLABEL_VALUE(flags));
 }
 
-void summary_set_marks_selected(SummaryView *summaryview)
-{
-       GList *cur;
-       summary_lock(summaryview);
-       for (cur = GTK_CLIST(summaryview->ctree)->selection; cur != NULL && cur->data != NULL;
-            cur = cur->next)
-               summary_set_row_marks(summaryview, GTK_CTREE_NODE(cur->data));
-       summary_unlock(summaryview);
-}
-
 static void summary_mark_row(SummaryView *summaryview, GtkCTreeNode *row)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
@@ -2909,10 +2888,6 @@ static void summary_mark_row_as_read(SummaryView *summaryview,
        if(!(MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)))
                return;
 
-       if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
-       && procmsg_msg_has_marked_parent(msginfo))
-               summaryview->unreadmarked--;
-
        procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
        summary_set_row_marks(summaryview, row);
        debug_print("Message %d is marked as read\n",
@@ -2997,10 +2972,6 @@ static void summary_mark_row_as_unread(SummaryView *summaryview,
                summaryview->deleted--;
        }
 
-       if (!MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
-       && procmsg_msg_has_marked_parent(msginfo))
-               summaryview->unreadmarked++;
-
        procmsg_msginfo_set_flags(msginfo, MSG_UNREAD, 0);
        debug_print("Message %d is marked as unread\n",
                msginfo->msgnum);
@@ -4368,6 +4339,7 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
                summaryview->col_state[pos] = col_state[pos];
                type = col_state[pos].type;
                col_pos[type] = pos;
+               titles[pos] = "dummy";
        }
        col_state = summaryview->col_state;
 
@@ -4714,11 +4686,13 @@ static void summary_tree_expanded(GtkCTree *ctree, GtkCTreeNode *node,
                                  SummaryView *summaryview)
 {
        summary_set_row_marks(summaryview, node);
-       while (prefs_common.bold_unread && node) {
-               GtkCTreeNode *next = GTK_CTREE_NODE_NEXT(node);
-               if (GTK_CTREE_ROW(node)->children)
-                       summary_set_row_marks(summaryview, node);
-               node = next;
+       if (prefs_common.bold_unread) {
+               while (node) {
+                       GtkCTreeNode *next = GTK_CTREE_NODE_NEXT(node);
+                       if (GTK_CTREE_ROW(node)->children)
+                               summary_set_row_marks(summaryview, node);
+                       node = next;
+               }
        }
 }
 
@@ -4903,11 +4877,13 @@ static void summary_sort_by_column_click(SummaryView *summaryview,
 
        node = GTK_CTREE_NODE(GTK_CLIST(summaryview->ctree)->row_list);
 
-       while (prefs_common.bold_unread && node) {
-               GtkCTreeNode *next = GTK_CTREE_NODE_NEXT(node);
-               if (GTK_CTREE_ROW(node)->children)
-                       summary_set_row_marks(summaryview, node);
-               node = next;
+       if (prefs_common.bold_unread) {
+               while (node) {
+                       GtkCTreeNode *next = GTK_CTREE_NODE_NEXT(node);
+                       if (GTK_CTREE_ROW(node)->children)
+                               summary_set_row_marks(summaryview, node);
+                       node = next;
+               }
        }
        END_TIMING();
 }
@@ -5213,9 +5189,6 @@ static void summary_ignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpoin
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
 
-       if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
-               summaryview->unreadmarked--;
-
        procmsg_msginfo_change_flags(msginfo, MSG_IGNORE_THREAD, 0, MSG_NEW | MSG_UNREAD, 0);
 
        summary_set_row_marks(summaryview, row);
@@ -5246,9 +5219,6 @@ static void summary_unignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpo
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
 
-       if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
-               summaryview->unreadmarked++;
-
        procmsg_msginfo_unset_flags(msginfo, MSG_IGNORE_THREAD, 0);
 
        summary_set_row_marks(summaryview, row);
@@ -5363,10 +5333,15 @@ void processing_apply(SummaryView * summaryview)
 
 void summary_toggle_show_read_messages(SummaryView *summaryview)
 {
-       if (summaryview->folder_item->hide_read_msgs)
+       FolderItemUpdateData source;
+       if (summaryview->folder_item->hide_read_msgs)
                summaryview->folder_item->hide_read_msgs = 0;
        else
                summaryview->folder_item->hide_read_msgs = 1;
+
+       source.item = summaryview->folder_item;
+       source.update_flags = F_ITEM_UPDATE_NAME;
+       hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
        summary_show(summaryview, summaryview->folder_item);
 }
  
index c5f7717256ed933e11e507728c54c13070cabb9d..6e136cc5bb8ae1a0e35b2f23da4eb8a51bef29e1 100644 (file)
@@ -394,7 +394,7 @@ static void toolbar_set_default_main(void)
                { A_FORWARD,       STOCK_PIXMAP_MAIL_FORWARD,         _("Forward") },
                { A_SEPARATOR,     0,                                 ("")         },
                { A_TRASH,         STOCK_PIXMAP_TRASH,                _("Trash")   },
-               { A_EXECUTE,       STOCK_PIXMAP_EXEC,                 _("Execute") },
+               { A_SEPARATOR,     0,                                 ("")         },
                { A_GOTO_PREV,     STOCK_PIXMAP_UP_ARROW,             _("Previous")},
                { A_GOTO_NEXT,     STOCK_PIXMAP_DOWN_ARROW,           _("Next")    }
        };
@@ -439,11 +439,6 @@ static void toolbar_set_default_compose(void)
                { A_SEPARATOR,          0,                               ("")                   }, 
                { A_INSERT,             STOCK_PIXMAP_INSERT_FILE,       _("Insert")             },
                { A_ATTACH,             STOCK_PIXMAP_MAIL_ATTACH,       _("Attach")             },
-               { A_SIG,                STOCK_PIXMAP_MAIL_SIGN,         _("Signature")          },
-               { A_SEPARATOR,          0,                               ("")                   },
-               { A_EXTEDITOR,          STOCK_PIXMAP_EDIT_EXTERN,       _("Editor")             },
-               { A_LINEWRAP_CURRENT,   STOCK_PIXMAP_LINEWRAP_CURRENT,  _("Wrap paragraph")     },
-               { A_LINEWRAP_ALL,       STOCK_PIXMAP_LINEWRAP_ALL,      _("Wrap all")           },
                { A_SEPARATOR,          0,                               ("")                   },
                { A_ADDRBOOK,           STOCK_PIXMAP_ADDRESS_BOOK,      _("Address")            }
        };
index aad17528c0bf957e5c0b03a1403688a89977dd8a..11845a94137d13c2302bd68a523c91f416787ed5 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include "defs.h"
 
 #include <glib.h>