aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-03-12 04:18:43 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-03-12 04:18:43 +0800
commit2087067750cbb6cf0124a464af06d08b3974f082 (patch)
treecb5c009b6f390b099ec354606cbe0a2a23e1a33c /widgets
parent8b2a5cd9b34a3f396b8dbb15e82e55678149e9de (diff)
downloadgsoc2013-evolution-2087067750cbb6cf0124a464af06d08b3974f082.tar
gsoc2013-evolution-2087067750cbb6cf0124a464af06d08b3974f082.tar.gz
gsoc2013-evolution-2087067750cbb6cf0124a464af06d08b3974f082.tar.bz2
gsoc2013-evolution-2087067750cbb6cf0124a464af06d08b3974f082.tar.lz
gsoc2013-evolution-2087067750cbb6cf0124a464af06d08b3974f082.tar.xz
gsoc2013-evolution-2087067750cbb6cf0124a464af06d08b3974f082.tar.zst
gsoc2013-evolution-2087067750cbb6cf0124a464af06d08b3974f082.zip
Use efb->setquery properly (set to TRUE before calling set_item_id and
2004-03-11 Jeffrey Stedfast <fejj@ximian.com> * e-filter-bar.c (set_property): Use efb->setquery properly (set to TRUE before calling set_item_id and FLASE afterwards). Also setquery to TRUE before emitting the "search-activated" signal so that we don't run the callback for the signal we are emitting. svn path=/trunk/; revision=25031
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/ChangeLog7
-rw-r--r--widgets/misc/e-filter-bar.c29
-rw-r--r--widgets/misc/e-filter-bar.h2
3 files changed, 29 insertions, 9 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 373b8a2dd0..9bd88a5342 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-11 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-filter-bar.c (set_property): Use efb->setquery properly (set
+ to TRUE before calling set_item_id and FLASE afterwards). Also
+ setquery to TRUE before emitting the "search-activated" signal so
+ that we don't run the callback for the signal we are emitting.
+
2004-03-02 Jeffrey Stedfast <fejj@ximian.com>
* e-filter-bar.c (set_property): Emit the "search-activated"
diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c
index 0b59c70b74..edfc3c68ee 100644
--- a/widgets/misc/e-filter-bar.c
+++ b/widgets/misc/e-filter-bar.c
@@ -183,6 +183,8 @@ menubar_activated (ESearchBar *esb, int id, void *data)
EFilterBar *efb = (EFilterBar *)esb;
GtkWidget *dialog, *w;
+ d(printf ("menubar activated!\n"));
+
switch (id) {
case E_FILTERBAR_EDIT_ID:
if (!efb->save_dialog) {
@@ -245,9 +247,10 @@ menubar_activated (ESearchBar *esb, int id, void *data)
g_string_free (out, TRUE);
#endif
efb->current_query = (FilterRule *)efb->menu_rules->pdata[id - efb->menu_base];
- efb->setquery = TRUE;
+ efb->setquery = TRUE;
e_search_bar_set_item_id (esb, E_FILTERBAR_ADVANCED_ID);
+ efb->setquery = FALSE;
gtk_widget_set_sensitive (esb->entry, FALSE);
} else {
@@ -266,10 +269,14 @@ option_changed (ESearchBar *esb, void *data)
int id = e_search_bar_get_item_id (esb);
char *query;
- d(printf("option changed, id = %d\n", id));
+ d(printf("option changed, id = %d, setquery = %s\n", id, efb->setquery ? "true" : "false"));
+
+ if (efb->setquery)
+ return;
switch (id) {
case E_FILTERBAR_ADVANCED_ID:
+ d(printf ("do_advanced\n"));
do_advanced (esb);
break;
default:
@@ -286,7 +293,6 @@ option_changed (ESearchBar *esb, void *data)
efb->current_query = NULL;
}
}
- efb->setquery = FALSE;
}
static void
@@ -504,7 +510,7 @@ set_option (ESearchBar *esb, ESearchBarItem *items)
menu = build_items (esb, items, 1, &efb->option_base, efb->option_rules);
((ESearchBarClass *)parent_class)->set_option (esb, (ESearchBarItem *)menu->data);
free_built_items (menu);
-
+
e_search_bar_set_item_id (esb, efb->option_base);
}
@@ -631,6 +637,8 @@ set_property (GObject *object, guint property_id, const GValue *value, GParamSpe
const char *state;
xmlDocPtr doc;
+
+
switch (property_id) {
case PROP_STATE:
if ((state = g_value_get_string (value))) {
@@ -662,6 +670,7 @@ set_property (GObject *object, guint property_id, const GValue *value, GParamSpe
efb->setquery = TRUE;
e_search_bar_set_item_id ((ESearchBar *) efb, E_FILTERBAR_ADVANCED_ID);
+ efb->setquery = FALSE;
break;
} else if (!strcmp (node->name, "search-bar")) {
@@ -677,10 +686,12 @@ set_property (GObject *object, guint property_id, const GValue *value, GParamSpe
item_id = xml_get_prop_int (node, "item_id");
subitem_id = xml_get_prop_int (node, "subitem_id");
+ efb->setquery = TRUE;
if (subitem_id >= 0)
e_search_bar_set_ids ((ESearchBar *) efb, item_id, subitem_id);
else
e_search_bar_set_item_id ((ESearchBar *) efb, item_id);
+ efb->setquery = FALSE;
break;
}
@@ -689,15 +700,17 @@ set_property (GObject *object, guint property_id, const GValue *value, GParamSpe
}
xmlFreeDoc (doc);
-
- g_signal_emit_by_name (efb, "search-activated", NULL);
} else {
/* set default state */
e_search_bar_set_text ((ESearchBar *) efb, "");
e_search_bar_set_item_id ((ESearchBar *) efb, 0);
-
- g_signal_emit_by_name (efb, "search-activated", NULL);
}
+
+ /* we don't want to run option_changed */
+ efb->setquery = TRUE;
+ g_signal_emit_by_name (efb, "search-activated", NULL);
+ efb->setquery = FALSE;
+
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
diff --git a/widgets/misc/e-filter-bar.h b/widgets/misc/e-filter-bar.h
index 5bded81afa..c15343d86f 100644
--- a/widgets/misc/e-filter-bar.h
+++ b/widgets/misc/e-filter-bar.h
@@ -64,7 +64,7 @@ struct _EFilterBar {
GtkWidget *save_dialog; /* current save dialogue (so we dont pop up multiple ones) */
FilterRule *current_query; /* as it says */
- int setquery; /* true when we're setting a query directly to advanced, so dont popup the dialogue */
+ int setquery; /* true when we're setting a query directly to advanced, so dont popup the dialog */
RuleContext *context;
char *systemrules;