+2002-01-21 [paul] 0.7.0claws20
+
+ * sync with sylpheed 0.7.0cvs12
+ see ChangeLog entries 2002-01-20 and 2002-01-21
+
2002-01-21 [carsten] 0.7.0claws19
* src/mainwindow.c
* src/menu.[ch]
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws19
+EXTRA_VERSION=claws20
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
do_delete = FALSE;
}
+ /* skip delete if it is continuous URL */
+ if (do_delete && (line_pos - p_pos <= i_len) &&
+ gtkut_stext_is_uri_string(text, line_pos, tlen))
+ do_delete = FALSE;
+
#ifdef WRAP_DEBUG
printf("qlen=%d l_len=%d wrap_len=%d do_del=%d\n",
qlen, line_len, linewrap_len, do_delete);
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
GNode *next = gnode->next;
item = FOLDER_ITEM(gnode->data);
- if (g_slist_find_custom(new_subscr, item->name,
+ if (g_slist_find_custom(new_subscr, item->path,
(GCompareFunc)g_strcasecmp) != NULL) {
gnode = next;
continue;
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
subscribed = NULL;
for (node = folder->node->children; node != NULL; node = node->next) {
item = FOLDER_ITEM(node->data);
- subscribed = g_slist_append(subscribed, g_strdup(item->name));
+ subscribed = g_slist_append(subscribed, g_strdup(item->path));
}
grouplist_dialog_set_list(NULL, TRUE);
node = node->next) {
item = FOLDER_ITEM(node->data);
subscribed = g_slist_append(subscribed,
- g_strdup(item->name));
+ g_strdup(item->path));
}
}
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
guint action,
GtkWidget *widget);
+static void create_filter_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+
static void prefs_common_open_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
NULL, add_address_cb, 0, NULL},
{N_("/_Tool/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Tool/_Filter messages"), NULL, filter_cb, 0, NULL},
+ {N_("/_Tool/_Create filter rule"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_Tool/_Create filter rule/_Automatically"),
+ NULL, create_filter_cb, FILTER_BY_AUTO, NULL},
+ {N_("/_Tool/_Create filter rule/by _From"),
+ NULL, create_filter_cb, FILTER_BY_FROM, NULL},
+ {N_("/_Tool/_Create filter rule/by _To"),
+ NULL, create_filter_cb, FILTER_BY_TO, NULL},
+ {N_("/_Tool/_Create filter rule/by _Subject"),
+ NULL, create_filter_cb, FILTER_BY_SUBJECT, NULL},
{N_("/_Tool/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Tool/E_xecute"), "x", execute_summary_cb, 0, NULL},
{N_("/_Tool/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Configuration/_Filtering ..."),
NULL, prefs_filtering_open_cb, 0, NULL},
{N_("/_Configuration/_Template..."), NULL, prefs_template_open_cb, 0, NULL},
+ {N_("/_Configuration/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Configuration/_Preferences for current account..."),
NULL, prefs_account_open_cb, 0, NULL},
- {N_("/_Configuration/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Configuration/Create _new account..."),
NULL, new_account_cb, 0, NULL},
{N_("/_Configuration/_Edit accounts..."),
{"/Tool/Add sender to address book", M_SINGLE_TARGET_EXIST},
{"/Tool/Filter messages" , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+ {"/Tool/Create filter rule" , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
{"/Tool/Execute" , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
{"/Configuration", M_UNLOCKED},
messageview_select_all(mainwin->messageview);
}
+static void create_filter_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_filter_open(mainwin->summaryview, (PrefsFilterType)action);
+}
+
static void prefs_common_open_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
static void prefs_filter_open_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- prefs_filter_open();
+ prefs_filter_open(NULL, NULL);
}
static void prefs_scoring_open_cb(MainWindow *mainwin, guint action,
GtkWidget *pred_combo2;
GtkWidget *pred_entry1;
GtkWidget *pred_entry2;
- GtkWidget *op_combo;
- GtkWidget *op_entry;
+ GtkWidget *cond_combo;
+ GtkWidget *cond_entry;
GtkWidget *dest_entry;
GtkWidget *regex_chkbtn;
/* widget creating functions */
static void prefs_filter_create (void);
-static void prefs_filter_set_dialog (void);
+static void prefs_filter_set_dialog (const gchar *header,
+ const gchar *key);
static void prefs_filter_set_list (void);
static gint prefs_filter_clist_set_row (gint row);
static void prefs_filter_cancel (void);
static void prefs_filter_ok (void);
-void prefs_filter_open(void)
+void prefs_filter_open(const gchar *header, const gchar *key)
{
if (prefs_rc_is_readonly(FILTER_RC))
return;
manage_window_set_transient(GTK_WINDOW(filter.window));
gtk_widget_grab_focus(filter.ok_btn);
- prefs_filter_set_dialog();
+ prefs_filter_set_dialog(header, key);
gtk_widget_show(filter.window);
}
GtkWidget *vbox1;
GtkWidget *table1;
- GtkWidget *op_label;
- GtkWidget *op_combo;
- GtkWidget *op_entry;
+ GtkWidget *cond_label;
+ GtkWidget *cond_combo;
+ GtkWidget *cond_entry;
GtkWidget *hdr_label;
GtkWidget *hdr_combo1;
GtkWidget *hdr_combo2;
gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
- op_label = gtk_label_new (_("Operator"));
- gtk_widget_show (op_label);
- gtk_table_attach (GTK_TABLE (table1), op_label, 0, 1, 0, 1,
+ cond_label = gtk_label_new (_("Condition"));
+ gtk_widget_show (cond_label);
+ gtk_table_attach (GTK_TABLE (table1), cond_label, 0, 1, 0, 1,
GTK_FILL, 0, 0, 0);
- gtk_misc_set_alignment (GTK_MISC (op_label), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (cond_label), 0, 0.5);
- op_combo = gtk_combo_new ();
- gtk_widget_show (op_combo);
- gtk_table_attach (GTK_TABLE (table1), op_combo, 0, 1, 2, 3,
+ cond_combo = gtk_combo_new ();
+ gtk_widget_show (cond_combo);
+ gtk_table_attach (GTK_TABLE (table1), cond_combo, 0, 1, 2, 3,
0, 0, 0, 0);
- gtk_widget_set_usize (op_combo, 52, -1);
- gtkut_combo_set_items (GTK_COMBO (op_combo), "and", "or", NULL);
+ gtk_widget_set_usize (cond_combo, 52, -1);
+ gtkut_combo_set_items (GTK_COMBO (cond_combo), "and", "or", NULL);
- op_entry = GTK_COMBO (op_combo)->entry;
- gtk_entry_set_editable (GTK_ENTRY (op_entry), FALSE);
+ cond_entry = GTK_COMBO (cond_combo)->entry;
+ gtk_entry_set_editable (GTK_ENTRY (cond_entry), FALSE);
hdr_label = gtk_label_new (_("Header"));
gtk_widget_show (hdr_label);
filter.pred_combo2 = pred_combo2;
filter.pred_entry1 = pred_entry1;
filter.pred_entry2 = pred_entry2;
- filter.op_combo = op_combo;
- filter.op_entry = op_entry;
+ filter.cond_combo = cond_combo;
+ filter.cond_entry = cond_entry;
filter.dest_entry = dest_entry;
filter.destsel_btn = destsel_btn;
}
}
-static void prefs_filter_set_dialog(void)
+static void prefs_filter_set_dialog(const gchar *header, const gchar *key)
{
GtkCList *clist = GTK_CLIST(filter.cond_clist);
GSList *cur;
}
gtk_clist_thaw(clist);
+
+ if (header && key) {
+ gtk_entry_set_text(GTK_ENTRY(filter.hdr_entry1), header);
+ gtk_entry_set_text(GTK_ENTRY(filter.key_entry1), key);
+ }
}
static void prefs_filter_set_list(void)
if (!strcmp(entry_text, _("contains")))
flt->flag2 |= FLT_CONTAIN;
- GET_ENTRY(filter.op_entry);
+ GET_ENTRY(filter.cond_entry);
if (!strcmp(entry_text, "and"))
flt->cond = FLT_AND;
else
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON(filter.regex_chkbtn), is_regex);
- gtk_entry_set_text(GTK_ENTRY(filter.op_entry),
+ gtk_entry_set_text(GTK_ENTRY(filter.cond_entry),
flt->cond == FLT_OR ? "or" : "and");
if (flt->action == FLT_NOTRECV)
gtk_toggle_button_set_active
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
#ifndef __PREFS_FILTER_H__
#define __PREFS_FILTER_H__
+typedef enum
+{
+ FILTER_BY_NONE,
+ FILTER_BY_AUTO,
+ FILTER_BY_FROM,
+ FILTER_BY_TO,
+ FILTER_BY_SUBJECT
+} PrefsFilterType;
+
void prefs_filter_read_config (void);
void prefs_filter_write_config (void);
-void prefs_filter_open (void);
+void prefs_filter_open (const gchar *header,
+ const gchar *key);
#endif /* __PREFS_FILTER_H__ */
#include "sourcewindow.h"
#include "prefs_common.h"
#include "prefs_summary_column.h"
+#include "prefs_filter.h"
#include "account.h"
#include "compose.h"
#include "utils.h"
summaryview->folder_table);
}
+void summary_filter_open(SummaryView *summaryview, PrefsFilterType type)
+{
+ static HeaderEntry hentry[] = {{"List-Id:", NULL, FALSE},
+ {"X-ML-Name:", NULL, FALSE},
+ {"X-List:", NULL, FALSE},
+ {"X-Mailing-list:", NULL, FALSE},
+ {NULL, NULL, FALSE}};
+ enum
+ {
+ H_LIST_ID = 0,
+ H_X_ML_NAME = 1,
+ H_X_LIST = 2,
+ H_X_MAILING_LIST = 3
+ };
+
+ MsgInfo *msginfo;
+ gchar *header = NULL;
+ gchar *key = NULL;
+ FILE *fp;
+
+ if (!summaryview->selected) return;
+
+ msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
+ summaryview->selected);
+ if (!msginfo) return;
+
+ switch (type) {
+ case FILTER_BY_NONE:
+ break;
+ case FILTER_BY_AUTO:
+ if ((fp = procmsg_open_message(msginfo)) == NULL) return;
+ procheader_get_header_fields(fp, hentry);
+ fclose(fp);
+
+ if (hentry[H_LIST_ID].body != NULL) {
+ header = "List-Id";
+ Xstrdup_a(key, hentry[H_LIST_ID].body, );
+ } else if (hentry[H_X_ML_NAME].body != NULL) {
+ header = "X-ML-Name";
+ Xstrdup_a(key, hentry[H_X_ML_NAME].body, );
+ } else if (hentry[H_X_LIST].body != NULL) {
+ header = "X-List";
+ Xstrdup_a(key, hentry[H_X_LIST].body, );
+ } else if (hentry[H_X_MAILING_LIST].body != NULL) {
+ header = "X-Mailing-list";
+ Xstrdup_a(key, hentry[H_X_MAILING_LIST].body, );
+ } else if (msginfo->subject) {
+ header = "Subject";
+ key = msginfo->subject;
+ }
+
+ g_free(hentry[H_LIST_ID].body);
+ hentry[H_LIST_ID].body = NULL;
+ g_free(hentry[H_X_ML_NAME].body);
+ hentry[H_X_ML_NAME].body = NULL;
+ g_free(hentry[H_X_LIST].body);
+ hentry[H_X_LIST].body = NULL;
+ g_free(hentry[H_X_MAILING_LIST].body);
+ hentry[H_X_MAILING_LIST].body = NULL;
+
+ break;
+ case FILTER_BY_FROM:
+ header = "From";
+ key = msginfo->from;
+ break;
+ case FILTER_BY_TO:
+ header = "To";
+ key = msginfo->to;
+ break;
+ case FILTER_BY_SUBJECT:
+ header = "Subject";
+ key = msginfo->subject;
+ break;
+ default:
+ break;
+ }
+
+ prefs_filter_open(header, key);
+}
+
/* color label */
#define N_COLOR_LABELS colorlabel_get_color_count()
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
#include "headerview.h"
#include "messageview.h"
#include "headerwindow.h"
+#include "prefs_filter.h"
#include "folder.h"
#include "gtksctree.h"
void summary_unthread (SummaryView *summaryview);
void summary_filter (SummaryView *summaryview);
+void summary_filter_open (SummaryView *summaryview,
+ PrefsFilterType type);
void summary_sort (SummaryView *summaryview,
SummarySortType type);
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
Xstrdup_a(fontstr, s, ); \
if ((p = strchr(fontstr, ',')) != NULL) *p = '\0'; \
font = gdk_font_load(fontstr); \
+ if (!font) \
+ g_warning("Couldn't load the font '%s'\n", fontstr); \
}
typedef struct _RemoteURI RemoteURI;
gtk_widget_ensure_style(text_mb);
if (text_sb->style && text_sb->style->font->type == GDK_FONT_FONTSET) {
GtkStyle *style;
-
- style = gtk_style_copy(text_sb->style);
- gdk_font_unref(style->font);
- FONT_LOAD(style->font, NORMAL_FONT);
- gtk_widget_set_style(text_sb, style);
+ GdkFont *font;
+
+ FONT_LOAD(font, prefs_common.normalfont);
+ if (font) {
+ style = gtk_style_copy(text_sb->style);
+ gdk_font_unref(style->font);
+ style->font = font;
+ gtk_widget_set_style(text_sb, style);
+ }
}
if (text_mb->style && text_mb->style->font->type == GDK_FONT_FONT) {
GtkStyle *style;
-
- style = gtk_style_copy(text_mb->style);
- gdk_font_unref(style->font);
- style->font = gdk_fontset_load(NORMAL_FONT);
- gtk_widget_set_style(text_mb, style);
+ GdkFont *font;
+
+ font = gdk_fontset_load(prefs_common.normalfont);
+ if (font) {
+ style = gtk_style_copy(text_mb->style);
+ gdk_font_unref(style->font);
+ style->font = font;
+ gtk_widget_set_style(text_mb, style);
+ }
}
gtk_widget_ref(scrolledwin_sb);
gtk_widget_ref(scrolledwin_mb);