aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/search/e-addressbook-search-dialog.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-08-23 17:09:21 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-08-23 17:09:21 +0800
commitf05ae9ba25935518ca945a4bf4fe80a6a4ff38e7 (patch)
treec12caa3307aa54884ca71fcfe6793d0763978f31 /addressbook/gui/search/e-addressbook-search-dialog.c
parentc3d7a35a9f00bae329978b56abb09c1500797b49 (diff)
downloadgsoc2013-evolution-f05ae9ba25935518ca945a4bf4fe80a6a4ff38e7.tar
gsoc2013-evolution-f05ae9ba25935518ca945a4bf4fe80a6a4ff38e7.tar.gz
gsoc2013-evolution-f05ae9ba25935518ca945a4bf4fe80a6a4ff38e7.tar.bz2
gsoc2013-evolution-f05ae9ba25935518ca945a4bf4fe80a6a4ff38e7.tar.lz
gsoc2013-evolution-f05ae9ba25935518ca945a4bf4fe80a6a4ff38e7.tar.xz
gsoc2013-evolution-f05ae9ba25935518ca945a4bf4fe80a6a4ff38e7.tar.zst
gsoc2013-evolution-f05ae9ba25935518ca945a4bf4fe80a6a4ff38e7.zip
Fixed fullname->full_name for search field.
2000-08-14 Not Zed <NotZed@HelixCode.com> * gui/search/addresstypes.xml: Fixed fullname->full_name for search field. * gui/search/e-addressbook-search-dialog.c (get_widget): Check we actually got any parts to build the dialogue with. 2000-08-13 Not Zed <NotZed@HelixCode.com> * gui/component/addressbook-component.c (owner_set_cb): Set the global_shell_client nastyhack when we know it. This is only required to link with the filter code ... * gui/component/Makefile.am (evolution_addressbook_LDADD): Added libfilter.a to the link line. * gui/search/Makefile.am (noinst_LIBRARIES): Change library name from libaddressbooksearchdialog to libaddressbooksearch, as used elsewhere. * gui/search/e-addressbook-search-dialog.c (get_widget): Implement. (get_query): Likewise. (e_addressbook_search_dialog_destroy): Unref filter stuff when done. * gui/component/addressbook.c (control_deactivate): Added chris's patch to put the meny in svn path=/trunk/; revision=4980
Diffstat (limited to 'addressbook/gui/search/e-addressbook-search-dialog.c')
-rw-r--r--addressbook/gui/search/e-addressbook-search-dialog.c42
1 files changed, 36 insertions, 6 deletions
diff --git a/addressbook/gui/search/e-addressbook-search-dialog.c b/addressbook/gui/search/e-addressbook-search-dialog.c
index 4acfd1585c..0109b1914a 100644
--- a/addressbook/gui/search/e-addressbook-search-dialog.c
+++ b/addressbook/gui/search/e-addressbook-search-dialog.c
@@ -89,23 +89,46 @@ e_addressbook_search_dialog_class_init (EAddressbookSearchDialogClass *klass)
}
static GtkWidget *
-get_widget ()
+get_widget (EAddressbookSearchDialog *view)
{
- return gtk_entry_new();
+ FilterPart *part;
+
+ view->context = rule_context_new();
+ /* FIXME: hide this in a class */
+ rule_context_add_part_set(view->context, "partset", filter_part_get_type(),
+ rule_context_add_part, rule_context_next_part);
+ rule_context_load(view->context, SEARCH_RULE_DIR "/addresstypes.xml", "");
+ view->rule = filter_rule_new();
+ part = rule_context_next_part(view->context, NULL);
+ if (part == NULL) {
+ g_warning("Problem loading search for addressbook no parts to load");
+ return gtk_entry_new();
+ } else {
+ filter_rule_add_part(view->rule, filter_part_clone(part));
+ return filter_rule_get_widget(view->rule, view->context);
+ }
}
static char *
-get_query ()
+get_query (EAddressbookSearchDialog *view)
{
- return "(contains \"email\" \"\")";
+ GString *out = g_string_new("");
+ char *ret;
+
+ filter_rule_build_code(view->rule, out);
+ ret = out->str;
+ printf("Searching using %s\n", ret);
+ g_string_free(out, FALSE);
+ return ret;
}
static void
button_press (GtkWidget *widget, EAddressbookSearchDialog *dialog)
{
char *query;
+
gtk_widget_show(dialog->scrolled_window);
- query = get_query();
+ query = get_query(dialog);
gtk_object_set(GTK_OBJECT(dialog->view),
"query", query,
NULL);
@@ -120,7 +143,7 @@ e_addressbook_search_dialog_init (EAddressbookSearchDialog *view)
gtk_window_set_policy(GTK_WINDOW(view), FALSE, TRUE, FALSE);
- view->search = get_widget();
+ view->search = get_widget(view);
gtk_box_pack_start(GTK_BOX(dialog->vbox), view->search, TRUE, TRUE, 0);
gtk_widget_show(view->search);
@@ -188,5 +211,12 @@ e_addressbook_search_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_i
static void
e_addressbook_search_dialog_destroy (GtkObject *object)
{
+ EAddressbookSearchDialog *view;
+
+ view = E_ADDRESSBOOK_SEARCH_DIALOG (object);
+
+ gtk_object_unref((GtkObject *)view->context);
+ gtk_object_unref((GtkObject *)view->rule);
+
GTK_OBJECT_CLASS(parent_class)->destroy (object);
}