aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/Makefile.am4
-rw-r--r--mail/folder-browser-factory.c7
-rw-r--r--mail/mail-ops.c38
-rw-r--r--mail/mail.h2
5 files changed, 59 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 0d0782101b..79dff4f13b 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+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.
+
2000-05-16 Christopher James Lahey <clahey@helixcode.com>
* mail-format.c: Removed usage of bonobo_object_destroy.
diff --git a/mail/Makefile.am b/mail/Makefile.am
index 83c047e632..700fb60eb6 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -17,8 +17,9 @@ INCLUDES = \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
-DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \
-DEVOLUTION_LOCALEDIR=\""$(datadir)/locale"\" \
+ -DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DCAMEL_PROVIDERDIR=\""$(providerdir)"\" \
- -DG_LOG_DOMAIN=\"evolution-mail\"
+ -DG_LOG_DOMAIN=\"evolution-mail\"
EVOLUTION_MAIL_CORBA_GENERATED = \
Mail.h \
@@ -57,6 +58,7 @@ evolution_mail_LDADD = \
../camel/libcamel.la \
../e-util/libeutil.la \
../libibex/libibex.la \
+ ../filter/libfilter.la \
$(BONOBO_HTML_GNOME_LIBS) \
$(UNICODE_LIBS)
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c
index b999d822bc..10696fd536 100644
--- a/mail/folder-browser-factory.c
+++ b/mail/folder-browser-factory.c
@@ -173,6 +173,12 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih)
GNOME_STOCK_PIXMAP_TRASH,
0, 0, expunge_folder, folder_browser);
+ bonobo_ui_handler_menu_new_item (uih, "/Tools/Filter Druid ...", N_("_Filter Druid"),
+ NULL, -1,
+ BONOBO_UI_HANDLER_PIXMAP_NONE,
+ 0,
+ 0, 0, filter_edit, folder_browser);
+
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL,
GTK_TOOLBAR_BOTH);
@@ -195,6 +201,7 @@ control_deactivate (BonoboControl *control, BonoboUIHandler *uih)
{
bonobo_ui_handler_menu_remove (uih, "/File/Mail");
bonobo_ui_handler_menu_remove (uih, "/Tools/Expunge");
+ bonobo_ui_handler_menu_remove (uih, "/Tools/Filter Druid ...");
bonobo_ui_handler_dock_remove (uih, "/Toolbar");
}
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);
+}
+
+
diff --git a/mail/mail.h b/mail/mail.h
index 60a3113f59..b9275a29d6 100644
--- a/mail/mail.h
+++ b/mail/mail.h
@@ -51,6 +51,8 @@ void reply_to_all (GtkWidget *button, gpointer user_data);
void delete_msg (GtkWidget *button, gpointer user_data);
void expunge_folder (GtkWidget *button, gpointer user_data);
+void filter_edit (GtkWidget *button, gpointer user_data);
+
/* session */
void session_init (void);
extern CamelSession *session;