/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 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
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
ACTION_CHANGE_SCORE,
ACTION_SET_SCORE,
ACTION_HIDE,
+ ACTION_IGNORE,
ACTION_STOP,
/* add other action constants */
} Action;
{ N_("Change score"), ACTION_CHANGE_SCORE},
{ N_("Set score"), ACTION_SET_SCORE},
{ N_("Hide"), ACTION_HIDE },
+ { N_("Ignore thread"), ACTION_IGNORE },
{ N_("Stop filter"), ACTION_STOP },
};
gtk_widget_show(filtering_action.window);
}
+/*!
+ *\brief Save Gtk object size to prefs dataset
+ */
+static void prefs_filtering_action_size_allocate_cb(GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ g_return_if_fail(allocation != NULL);
+
+ prefs_common.filteringactionwin_width = allocation->width;
+ prefs_common.filteringactionwin_height = allocation->height;
+}
+
/*!
*\brief Create the matcher dialog
*/
GList *combo_items;
gint i;
+ static GdkGeometry geometry;
GList * accounts;
gtk_widget_show(vbox);
gtk_container_add(GTK_CONTAINER(window), vbox);
- gtkut_stock_button_set_create(&confirm_area, &ok_btn, GTK_STOCK_OK,
- &cancel_btn, GTK_STOCK_CANCEL, NULL, NULL);
+ gtkut_stock_button_set_create(&confirm_area,
+ &cancel_btn, GTK_STOCK_CANCEL,
+ &ok_btn, GTK_STOCK_OK,
+ NULL, NULL);
gtk_widget_show(confirm_area);
gtk_box_pack_end(GTK_BOX(vbox), confirm_area, FALSE, FALSE, 0);
gtk_widget_grab_default(ok_btn);
_("Filtering action configuration"));
g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(prefs_filtering_action_deleted), NULL);
+ g_signal_connect(G_OBJECT(window), "size_allocate",
+ G_CALLBACK(prefs_filtering_action_size_allocate_cb), NULL);
g_signal_connect(G_OBJECT(window), "key_press_event",
G_CALLBACK(prefs_filtering_action_key_pressed), NULL);
MANAGE_WINDOW_SIGNALS_CONNECT(window);
G_CALLBACK(prefs_filtering_action_select_dest),
NULL);
- exec_btn = gtk_button_new_with_label (_("Info ..."));
+#if GTK_CHECK_VERSION(2, 8, 0)
+ exec_btn = gtk_button_new_from_stock(GTK_STOCK_INFO);
+#else
+ exec_btn = gtk_button_new_with_label (_("Info..."));
+#endif
gtk_widget_show (exec_btn);
gtk_box_pack_start (GTK_BOX (hbox1), exec_btn, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (exec_btn), "clicked",
g_signal_connect(G_OBJECT(reg_btn), "clicked",
G_CALLBACK(prefs_filtering_action_register_cb), NULL);
- subst_btn = gtk_button_new_with_label(_(" Replace "));
+ subst_btn = gtkut_get_replace_btn(_("Replace"));
gtk_widget_show(subst_btn);
gtk_box_pack_start(GTK_BOX(btn_hbox), subst_btn, FALSE, TRUE, 0);
g_signal_connect(G_OBJECT(subst_btn), "clicked",
G_CALLBACK(prefs_filtering_action_substitute_cb),
NULL);
- del_btn = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
+ del_btn = gtk_button_new_from_stock(GTK_STOCK_DELETE);
gtk_widget_show(del_btn);
gtk_box_pack_start(GTK_BOX(btn_hbox), del_btn, FALSE, TRUE, 0);
g_signal_connect(G_OBJECT(del_btn), "clicked",
g_signal_connect(G_OBJECT(down_btn), "clicked",
G_CALLBACK(prefs_filtering_action_down), NULL);
+ if (!geometry.min_height) {
+ geometry.min_width = 490;
+ geometry.min_height = 328;
+ }
+
+ gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+ GDK_HINT_MIN_SIZE);
+ gtk_widget_set_size_request(window, prefs_common.filteringactionwin_width,
+ prefs_common.filteringactionwin_height);
+
gtk_widget_show_all(window);
filtering_action.window = window;
if (row == NULL && action == NULL) {
prefs_filtering_action_list_view_insert_action
(filtering_action.action_list_view,
- NULL, _("New"), FALSE);
+ NULL, _("(New)"), FALSE);
return;
}
*/
static void prefs_filtering_action_set_dialog(GSList *action_list)
{
- GtkTreeView *list_view = GTK_TREE_VIEW
- (filtering_action.action_list_view);
GSList *cur;
gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model
return MATCHACTION_COLOR;
case ACTION_HIDE:
return MATCHACTION_HIDE;
+ case ACTION_IGNORE:
+ return MATCHACTION_IGNORE;
case ACTION_STOP:
return MATCHACTION_STOP;
case ACTION_CHANGE_SCORE:
break;
case ACTION_STOP:
case ACTION_HIDE:
+ case ACTION_IGNORE:
case ACTION_DELETE:
case ACTION_MARK:
case ACTION_UNMARK:
GtkTreeModel *model;
gboolean is_valid;
GtkTreeIter row;
- FilteringAction *action;
if (!gtk_tree_selection_get_selected(selection, &model, &row))
return;
{
GtkTreePath *prev, *sel, *try;
GtkTreeIter isel;
- GtkListStore *store;
+ GtkListStore *store = NULL;
+ GtkTreeModel *model = NULL;
GtkTreeIter iprev;
if (!gtk_tree_selection_get_selected
(gtk_tree_view_get_selection
(GTK_TREE_VIEW(filtering_action.action_list_view)),
- (GtkTreeModel **) &store,
+ &model,
&isel))
return;
-
+ store = (GtkListStore *)model;
sel = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &isel);
if (!sel)
return;
*/
static void prefs_filtering_action_down(void)
{
- GtkListStore *store;
+ GtkListStore *store = NULL;
+ GtkTreeModel *model = NULL;
GtkTreeIter next, sel;
GtkTreePath *try;
if (!gtk_tree_selection_get_selected
(gtk_tree_view_get_selection
(GTK_TREE_VIEW(filtering_action.action_list_view)),
- (GtkTreeModel **) &store,
+ &model,
&sel))
return;
-
+ store = (GtkListStore *)model;
try = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &sel);
if (!try)
return;
* When adding new lines, remember to put 2 strings for each line
*/
static gchar *exec_desc_strings[] = {
- "%%", "%",
+ "%%", N_("literal %"),
"%s", N_("Subject"),
"%f", N_("From"),
"%t", N_("To"),
"%i", N_("Message-ID"),
"%n", N_("Newsgroups"),
"%r", N_("References"),
- "%F", N_("Filename - should not be modified"),
+ "%F", N_("filename (should not be modified)"),
"\\n", N_("new line"),
"\\", N_("escape character for quotes"),
- "\\\"",N_("quote character"),
+ "\\\"", N_("quote character"),
NULL, NULL
};
static DescriptionWindow exec_desc_win = {
+ NULL,
NULL,
2,
- N_("Description of symbols"),
- exec_desc_strings
+ N_("Filtering Action: 'Execute'"),
+ N_("'Execute' allows you to send a message or message element "
+ "to an external program or script.\n\n"
+ "The following symbols can be used:"),
+ exec_desc_strings
};
/*!
case ACTION_MARK_AS_UNREAD:
case ACTION_STOP:
case ACTION_HIDE:
+ case ACTION_IGNORE:
gtk_widget_show(filtering_action.account_label);
gtk_widget_set_sensitive(filtering_action.account_label, FALSE);
gtk_widget_set_sensitive(filtering_action.account_combo, FALSE);
{
GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model
(GTK_TREE_VIEW(list_view)));
- gint result = -1;
GtkTreeIter iter;
list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model));
g_object_unref(model);
- gtk_tree_view_set_rules_hint(list_view, TRUE);
+ gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere);
selector = gtk_tree_view_get_selection(list_view);
gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE);
gtk_list_select_item(GTK_LIST(filtering_action.action_type_list),
ACTION_HIDE);
break;
+ case MATCHACTION_IGNORE:
+ gtk_list_select_item(GTK_LIST(filtering_action.action_type_list),
+ ACTION_IGNORE);
+ break;
}
filteringaction_free(action); /* XXX: memleak */