diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2008-09-26 06:11:11 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2008-09-26 06:11:11 +0000 |
commit | 2569f2416f350e29ff414671b74f2524fa883113 (patch) | |
tree | 73665a52ff8ae74186082d7733374f88a3495522 /src/prefs_filter_edit.c | |
parent | f8c3b6a8f6f9bf86ea02fb8220d24cccf6520869 (diff) |
use target header field as a default filter name when creating filter rule automatically.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2042 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/prefs_filter_edit.c')
-rw-r--r-- | src/prefs_filter_edit.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/prefs_filter_edit.c b/src/prefs_filter_edit.c index 97601e05..dbdc5462 100644 --- a/src/prefs_filter_edit.c +++ b/src/prefs_filter_edit.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2007 Hiroyuki Yamamoto + * Copyright (C) 1999-2008 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 @@ -81,7 +81,8 @@ static struct FilterEditHeaderListDialog { static void prefs_filter_edit_create (void); static void prefs_filter_edit_clear (void); -static void prefs_filter_edit_rule_to_dialog (FilterRule *rule); +static void prefs_filter_edit_rule_to_dialog (FilterRule *rule, + const gchar *default_name); static void prefs_filter_edit_update_header_list(FilterCondEdit *cond_list); static void prefs_filter_edit_set_action_hbox_menu_sensitive @@ -144,7 +145,8 @@ static void prefs_filter_action_add_cb (GtkWidget *widget, gpointer data); -FilterRule *prefs_filter_edit_open(FilterRule *rule, const gchar *header) +FilterRule *prefs_filter_edit_open(FilterRule *rule, const gchar *header, + const gchar *key) { static gboolean lock = FALSE; FilterRule *new_rule; @@ -160,7 +162,7 @@ FilterRule *prefs_filter_edit_open(FilterRule *rule, const gchar *header) manage_window_set_transient(GTK_WINDOW(rule_edit_window.window)); prefs_filter_edit_set_header_list(&rule_edit_window.cond_edit, rule); - prefs_filter_edit_rule_to_dialog(rule); + prefs_filter_edit_rule_to_dialog(rule, key); if (header) prefs_filter_edit_activate_cond_header (&rule_edit_window.cond_edit, header); @@ -362,7 +364,8 @@ static void prefs_filter_edit_clear(void) } } -static void prefs_filter_edit_rule_to_dialog(FilterRule *rule) +static void prefs_filter_edit_rule_to_dialog(FilterRule *rule, + const gchar *default_name) { gint index = 0; static gint count = 1; @@ -370,6 +373,9 @@ static void prefs_filter_edit_rule_to_dialog(FilterRule *rule) if (rule && rule->name) gtk_entry_set_text(GTK_ENTRY(rule_edit_window.name_entry), rule->name); + else if (default_name) + gtk_entry_set_text(GTK_ENTRY(rule_edit_window.name_entry), + default_name); else { gchar rule_name[32]; g_snprintf(rule_name, sizeof(rule_name), "Rule %d", count++); |