From 2f95668944daf2989a58abcd1328458d35f4bfdb Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 15 Mar 2001 06:56:17 +0000 Subject: If we click on the edit menu, then bring up a rule editor. If the user 2001-03-15 Not Zed * e-filter-bar.c (menubar_activated): If we click on the edit menu, then bring up a rule editor. If the user adds/removes rules though, they are neither saved, nor added to the menu's. sigh. svn path=/trunk/; revision=8730 --- widgets/misc/ChangeLog | 6 ++++++ widgets/misc/e-filter-bar.c | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'widgets/misc') diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 6f104db461..b3c1f1e04e 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,9 @@ +2001-03-15 Not Zed + + * e-filter-bar.c (menubar_activated): If we click on the edit + menu, then bring up a rule editor. If the user adds/removes rules + though, they are neither saved, nor added to the menu's. sigh. + 2001-03-04 Damon Chaplin * e-cell-date-edit.c: pretty much working now. diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c index 6679059963..709a0dc837 100644 --- a/widgets/misc/e-filter-bar.c +++ b/widgets/misc/e-filter-bar.c @@ -29,6 +29,7 @@ #include "e-dropdown-button.h" #include "e-filter-bar.h" +#include "filter/rule-editor.h" #include #include @@ -58,6 +59,21 @@ static void rule_editor_destroyed(GtkWidget *w, EFilterBar *efb) e_search_bar_set_menu_sensitive((ESearchBar *)efb, E_FILTERBAR_SAVE_ID, TRUE); } +/* FIXME: need to update the popup menu to match any edited rules, sigh */ +static void full_rule_editor_clicked(GtkWidget *w, int button, void *data) +{ + EFilterBar *efb = data; + + switch (button) { + case 0: + rule_context_save(efb->context, efb->userrules); + case 1: + default: + gnome_dialog_close((GnomeDialog *)w); + case -1: + } +} + static void rule_editor_clicked(GtkWidget *w, int button, void *data) { EFilterBar *efb = data; @@ -121,6 +137,16 @@ menubar_activated (ESearchBar *esb, int id, void *data) gtk_object_set((GtkObject *)esb, "text", NULL, NULL); gtk_widget_set_sensitive(esb->entry, TRUE); break; + case E_FILTERBAR_EDIT_ID: + if (!efb->save_dialogue) { + GnomeDialog *gd; + + gd = (GnomeDialog *)rule_editor_new(efb->context, FILTER_SOURCE_INCOMING); + gtk_signal_connect((GtkObject *)gd, "clicked", full_rule_editor_clicked, efb); + gtk_signal_connect((GtkObject *)gd, "destroy", rule_editor_destroyed, efb); + gtk_widget_show((GtkWidget *)gd); + } + break; case E_FILTERBAR_SAVE_ID: if (efb->current_query && !efb->save_dialogue) { GtkWidget *w; -- cgit v1.2.3