aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-10-24 09:48:20 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-10-24 09:48:20 +0800
commit4b68843dfa4f807b5b768e65d353b30d3ca91d1a (patch)
treede10c105fc9cf0029268ead7e572c0678a889165
parentd45b7b4852ed7972f40f65af0b04b02de8b696a5 (diff)
downloadgsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.tar
gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.tar.gz
gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.tar.bz2
gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.tar.lz
gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.tar.xz
gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.tar.zst
gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.zip
If the clear button was pressed, we want the entry to be sensitive (not
2002-10-23 Jeffrey Stedfast <fejj@ximian.com> * e-filter-bar.c (option_changed): If the clear button was pressed, we want the entry to be sensitive (not insensitive). * e-search-bar.c (e_search_bar_set_item_id): If the item id is CLEAR_ID, we want to select the first item (0) but still set the esb->item_id to CLEAR_ID. (set_find_now_sensitive): Don't bother getting the GtkEntry text, we don't even use it? (clear_search): Set the item id as E_SEARCHBAR_CLEAR_ID rather than 0 so that it can be checked for. svn path=/trunk/; revision=18421
-rw-r--r--widgets/misc/ChangeLog13
-rw-r--r--widgets/misc/e-filter-bar.c8
-rw-r--r--widgets/misc/e-filter-bar.h6
-rw-r--r--widgets/misc/e-search-bar.c24
-rw-r--r--widgets/misc/e-search-bar.h4
5 files changed, 31 insertions, 24 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 0416f07b3e..abb7449a3c 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,16 @@
+2002-10-23 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-filter-bar.c (option_changed): If the clear button was
+ pressed, we want the entry to be sensitive (not insensitive).
+
+ * e-search-bar.c (e_search_bar_set_item_id): If the item id is
+ CLEAR_ID, we want to select the first item (0) but still set the
+ esb->item_id to CLEAR_ID.
+ (set_find_now_sensitive): Don't bother getting the GtkEntry text,
+ we don't even use it?
+ (clear_search): Set the item id as E_SEARCHBAR_CLEAR_ID rather
+ than 0 so that it can be checked for.
+
2002-10-23 Ettore Perazzoli <ettore@ximian.com>
[#26128, thanks to Federico Mena Quintero <federico@ximian.com>
diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c
index 514abad6d9..649f6b7d1e 100644
--- a/widgets/misc/e-filter-bar.c
+++ b/widgets/misc/e-filter-bar.c
@@ -138,7 +138,7 @@ do_advanced (ESearchBar *esb)
EFilterBar *efb = (EFilterBar *)esb;
d(printf("Advanced search!\n"));
-
+
if (!efb->save_dialogue && !efb->setquery) {
GtkWidget *w, *gd;
FilterRule *rule;
@@ -166,7 +166,7 @@ do_advanced (ESearchBar *esb)
gtk_object_set_data_full (GTK_OBJECT (gd), "rule", rule, (GtkDestroyNotify)gtk_object_unref);
gtk_signal_connect (GTK_OBJECT (gd), "clicked", rule_advanced_clicked, efb);
gtk_signal_connect (GTK_OBJECT (gd), "destroy", rule_editor_destroyed, efb);
-
+
e_search_bar_set_menu_sensitive (esb, E_FILTERBAR_SAVE_ID, FALSE);
gtk_widget_set_sensitive (esb->entry, FALSE);
@@ -243,7 +243,7 @@ menubar_activated (ESearchBar *esb, int id, void *data)
efb->current_query = (FilterRule *)efb->menu_rules->pdata[id - efb->menu_base];
efb->setquery = TRUE;
-
+
e_search_bar_set_item_id (esb, E_FILTERBAR_ADVANCED_ID);
gtk_widget_set_sensitive (esb->entry, FALSE);
@@ -279,7 +279,7 @@ option_changed (ESearchBar *esb, void *data)
}
gtk_widget_set_sensitive (esb->entry, TRUE);
} else {
- gtk_widget_set_sensitive (esb->entry, FALSE);
+ gtk_widget_set_sensitive (esb->entry, id == E_SEARCHBAR_CLEAR_ID);
efb->current_query = NULL;
}
}
diff --git a/widgets/misc/e-filter-bar.h b/widgets/misc/e-filter-bar.h
index 15663c41d4..c824b5fced 100644
--- a/widgets/misc/e-filter-bar.h
+++ b/widgets/misc/e-filter-bar.h
@@ -81,11 +81,11 @@ struct _EFilterBarClass
/* "preset" items */
enum {
/* preset menu options */
- E_FILTERBAR_SAVE_ID = -2,
- E_FILTERBAR_EDIT_ID = -3,
+ E_FILTERBAR_SAVE_ID = -3,
+ E_FILTERBAR_EDIT_ID = -4,
/* preset option options */
- E_FILTERBAR_ADVANCED_ID = -4,
+ E_FILTERBAR_ADVANCED_ID = -5,
};
#define E_FILTERBAR_SAVE { N_("_Save Search..."), E_FILTERBAR_SAVE_ID, NULL }
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index 784ff94979..76a26f0e98 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -78,15 +78,11 @@ static void
set_find_now_sensitive (ESearchBar *search_bar,
gboolean sensitive)
{
- const char *text;
-
- text = gtk_entry_get_text (GTK_ENTRY (search_bar->entry));
-
if (search_bar->ui_component != NULL)
bonobo_ui_component_set_prop (search_bar->ui_component,
"/commands/ESearchBar:FindNow",
"sensitive", sensitive ? "1" : "0", NULL);
-
+
gtk_widget_set_sensitive (search_bar->activate_button, sensitive);
}
@@ -103,7 +99,7 @@ static void
clear_search (ESearchBar *esb)
{
e_search_bar_set_text (esb, "");
- e_search_bar_set_item_id (esb, 0);
+ e_search_bar_set_item_id (esb, E_SEARCHBAR_CLEAR_ID);
}
/* Frees an array of subitem information */
@@ -966,10 +962,9 @@ e_search_bar_set_suboption (ESearchBar *search_bar, int option_id, ESearchBarSub
GtkWidget *item;
ESearchBarSubitem *old_subitems;
ESearchBarSubitem *new_subitems;
-
- g_return_if_fail (search_bar != NULL);
+
g_return_if_fail (E_IS_SEARCH_BAR (search_bar));
-
+
row = find_id (search_bar->option_menu, option_id, "EsbChoiceId", &item);
g_return_if_fail (row != -1);
g_assert (item != NULL);
@@ -1079,13 +1074,13 @@ void
e_search_bar_set_item_id (ESearchBar *search_bar, int id)
{
int row;
-
- g_return_if_fail (search_bar != NULL);
+
g_return_if_fail (E_IS_SEARCH_BAR (search_bar));
-
- row = find_id (search_bar->option_menu, id, "EsbChoiceId", NULL);
+
+ row = id == E_SEARCHBAR_CLEAR_ID ? 0 : id;
+ row = find_id (search_bar->option_menu, row, "EsbChoiceId", NULL);
g_return_if_fail (row != -1);
-
+
search_bar->item_id = id;
gtk_option_menu_set_history (GTK_OPTION_MENU (search_bar->option), row);
emit_query_changed (search_bar);
@@ -1185,7 +1180,6 @@ e_search_bar_set_ids (ESearchBar *search_bar, int item_id, int subitem_id)
void
e_search_bar_set_text (ESearchBar *search_bar, const char *text)
{
- g_return_if_fail (search_bar != NULL);
g_return_if_fail (E_IS_SEARCH_BAR (search_bar));
e_utf8_gtk_editable_set_text (GTK_EDITABLE (search_bar->entry), text);
diff --git a/widgets/misc/e-search-bar.h b/widgets/misc/e-search-bar.h
index 06da79aaa1..7ca10c3890 100644
--- a/widgets/misc/e-search-bar.h
+++ b/widgets/misc/e-search-bar.h
@@ -102,8 +102,8 @@ struct _ESearchBarClass
};
enum {
- E_SEARCHBAR_FIND_NOW_ID = 0,
- E_SEARCHBAR_CLEAR_ID = 1
+ E_SEARCHBAR_FIND_NOW_ID = -1,
+ E_SEARCHBAR_CLEAR_ID = -2
};