aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2004-06-04 11:28:29 +0800
committerHans Petter <hansp@src.gnome.org>2004-06-04 11:28:29 +0800
commit99ec0bcf5e38a79c1a5965e5e95b8a839a68bc3e (patch)
tree9a687a4b96e28bb55e16c1f2c29fd83e61dbd2d7 /addressbook/gui/widgets
parentf9d996db29d5e8a9697409b1dbe25b99df0a1387 (diff)
downloadgsoc2013-evolution-99ec0bcf5e38a79c1a5965e5e95b8a839a68bc3e.tar
gsoc2013-evolution-99ec0bcf5e38a79c1a5965e5e95b8a839a68bc3e.tar.gz
gsoc2013-evolution-99ec0bcf5e38a79c1a5965e5e95b8a839a68bc3e.tar.bz2
gsoc2013-evolution-99ec0bcf5e38a79c1a5965e5e95b8a839a68bc3e.tar.lz
gsoc2013-evolution-99ec0bcf5e38a79c1a5965e5e95b8a839a68bc3e.tar.xz
gsoc2013-evolution-99ec0bcf5e38a79c1a5965e5e95b8a839a68bc3e.tar.zst
gsoc2013-evolution-99ec0bcf5e38a79c1a5965e5e95b8a839a68bc3e.zip
Fixes #53643 and #26903.
2004-06-03 Hans Petter Jansson <hpj@ximian.com> Fixes #53643 and #26903. * gui/search/addresstypes.xml: category -> category_list * gui/search/e-addressbook-search-dialog.c (get_widget): Get filter rule from parent view. (eab_search_dialog_set_property): Implement. (eab_search_dialog_get_property): Impleent. (eab_search_dialog_class_init): Set up property methods. (get_query): Get filter rule from parent view. (eab_search_dialog_init): Don't get the filter widget here, wait until parent view property is set. (eab_search_dialog_new): Don't poke the parent view in, set it as a property instead. (eab_search_dialog_dispose): No longer needs to unref rule. * gui/search/e-addressbook-search-dialog.c: EABSearchDialog no longer needs to keep rule internally. * gui/widgets/Makefile.am: Set SEARCH_RULE_DIR define. * gui/widgets/e-addressbook-view.c (eab_view_new): Set up filter rule and context. (eab_view_peek_search_context): Implement. (eab_view_peek_search_rule): Implement. * gui/widgets/e-addressbook-view.h: Keep track of filter rule and context. Add protos for added API. svn path=/trunk/; revision=26207
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/Makefile.am3
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c27
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.h10
3 files changed, 37 insertions, 3 deletions
diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am
index ce5cc32275..6842ce14d5 100644
--- a/addressbook/gui/widgets/Makefile.am
+++ b/addressbook/gui/widgets/Makefile.am
@@ -1,3 +1,5 @@
+ruledir = $(privdatadir)
+
INCLUDES = \
-DG_LOG_DOMAIN=\"eab-widgets\" \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
@@ -12,6 +14,7 @@ INCLUDES = \
-I$(top_srcdir)/addressbook/gui/component \
-I$(top_srcdir)/widgets/misc \
-I$(top_builddir)/shell \
+ -DSEARCH_RULE_DIR=\"$(ruledir)\" \
$(EVOLUTION_ADDRESSBOOK_CFLAGS)
CORBA_COMPOSER_SOURCE_H = \
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index a842d3040e..44db0a1edd 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -411,6 +411,7 @@ eab_view_new (void)
{
GtkWidget *widget = GTK_WIDGET (g_object_new (E_TYPE_AB_VIEW, NULL));
EABView *eav = EAB_VIEW (widget);
+ FilterPart *part;
/* create our model */
eav->model = eab_model_new ();
@@ -450,6 +451,20 @@ eab_view_new (void)
gtk_widget_show (GTK_WIDGET (eav->search));
gtk_widget_set_sensitive (GTK_WIDGET (eav->search), FALSE);
+ /* create the search context */
+ eav->search_context = rule_context_new ();
+ rule_context_add_part_set (eav->search_context, "partset", filter_part_get_type (),
+ rule_context_add_part, rule_context_next_part);
+ rule_context_load (eav->search_context, SEARCH_RULE_DIR "/addresstypes.xml", "");
+
+ eav->search_rule = filter_rule_new ();
+ part = rule_context_next_part (eav->search_context, NULL);
+
+ if (part == NULL)
+ g_warning ("Could not load addressbook search; no parts.");
+ else
+ filter_rule_add_part (eav->search_rule, filter_part_clone (part));
+
/* create the paned window and contact display */
eav->paned = gtk_vpaned_new ();
gtk_box_pack_start (GTK_BOX (eav), eav->paned, TRUE, TRUE, 0);
@@ -488,6 +503,18 @@ eab_view_new (void)
return widget;
}
+RuleContext *
+eab_view_peek_search_context (EABView *view)
+{
+ return view->search_context;
+}
+
+FilterRule *
+eab_view_peek_search_rule (EABView *view)
+{
+ return view->search_rule;
+}
+
static void
writable_status (GtkObject *object, gboolean writable, EABView *eav)
{
diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h
index c90356beee..6f937f4587 100644
--- a/addressbook/gui/widgets/e-addressbook-view.h
+++ b/addressbook/gui/widgets/e-addressbook-view.h
@@ -92,9 +92,10 @@ struct _EABView
BonoboUIComponent *uic;
/* the search bar and related machinery */
- ESearchBar *search;
- gint ecml_changed_id;
-
+ ESearchBar *search;
+ gint ecml_changed_id;
+ RuleContext *search_context;
+ FilterRule *search_rule;
};
struct _EABViewClass
@@ -119,6 +120,9 @@ void eab_view_setup_menus (EABView *view,
BonoboUIComponent *uic);
void eab_view_discard_menus (EABView *view);
+RuleContext *eab_view_peek_search_context (EABView *view);
+FilterRule *eab_view_peek_search_rule (EABView *view);
+
void eab_view_save_as (EABView *view);
void eab_view_view (EABView *view);
void eab_view_send (EABView *view);