diff options
author | NotZed <NotZed@HelixCode.com> | 2000-05-17 07:09:26 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-05-17 07:09:26 +0800 |
commit | 464b02c84709394ad80a9f4d3d18d3105a852d84 (patch) | |
tree | 2ab3906d9d12c7480164dc7ec32659fce9e6fd7d /mail/mail-ops.c | |
parent | 30871da932e684894f88483bf4934bf989a5242d (diff) | |
download | gsoc2013-evolution-464b02c84709394ad80a9f4d3d18d3105a852d84.tar.gz gsoc2013-evolution-464b02c84709394ad80a9f4d3d18d3105a852d84.tar.zst gsoc2013-evolution-464b02c84709394ad80a9f4d3d18d3105a852d84.zip |
New menu to bring up the filter editor, and edit filters. They dont
get invoked yet though.
2000-05-16 NotZed <NotZed@HelixCode.com>
* mail-ops.c (filter_edit): Function to bring up the filter editor.
(filter_druid_clicked): Save/close dialogue.
* Makefile.am (evolution_mail_LDADD): Added libfilter.
(INCLUDES): Add EVOLUTION_DATADIR, and fix matt's brokeneditor(tm)
for putting spaces instead of tabs in.
svn path=/trunk/; revision=3099
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 1d97d0b1ca..9a773d62f8 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -29,6 +29,7 @@ #include "mail.h" #include "folder-browser.h" #include "e-util/e-setup.h" +#include "filter/filter-editor.h" #ifndef HAVE_MKSTEMP #include <fcntl.h> @@ -423,3 +424,40 @@ expunge_folder (GtkWidget *button, gpointer user_data) } } +static void +filter_druid_clicked(FilterEditor *fe, int button, FolderBrowser *fb) +{ + printf("closing dialog\n"); + if (button == 0) { + char *user; + + user = g_strdup_printf ("%s/filters.xml", evolution_dir); + filter_editor_save_rules(fe, user); + printf("saving filter options to '%s'\n", user); + g_free(user); + } + if (button != -1) { + gnome_dialog_close(fe); + } +} + +void filter_edit (GtkWidget *button, gpointer user_data) +{ + FolderBrowser *fb = FOLDER_BROWSER(user_data); + FilterEditor *fe; + char *user, *system; + + printf("Editing filters ...\n"); + fe = filter_editor_new(); + + user = g_strdup_printf ("%s/filters.xml", evolution_dir); + system = g_strdup_printf("%s/filtertypes.xml", EVOLUTION_DATADIR); + filter_editor_set_rule_files(fe, system, user); + g_free(user); + g_free(system); + gnome_dialog_append_buttons((GnomeDialog *)fe, GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, 0); + gtk_signal_connect(fe, "clicked", filter_druid_clicked, fb); + gtk_widget_show(fe); +} + + |