aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-cal-shell-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-12-19 07:23:48 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-12-19 11:38:00 +0800
commit4cbbdedf522a6ac10df93a128bbf25f67173d66e (patch)
treefab7bf95e0927e4fa98c58a659e310afff7153ee /modules/calendar/e-cal-shell-view.c
parenta1efb837566cdac798cd8777dd34e06e9782cf61 (diff)
downloadgsoc2013-evolution-4cbbdedf522a6ac10df93a128bbf25f67173d66e.tar.gz
gsoc2013-evolution-4cbbdedf522a6ac10df93a128bbf25f67173d66e.tar.zst
gsoc2013-evolution-4cbbdedf522a6ac10df93a128bbf25f67173d66e.zip
Refactor the EShell search API.
Move the search interface to a new widget: EShellSearchbar The current search rule is now stored in EShellView, and the search context in EShellViewClass similar to GalViewCollection (since it's class-specific, not instance-specific). Also add a couple new signals to EShellView: "clear-search" and "custom-search" ("custom" refers to an advanced search or a saved search -- something more complex than a quick search). Still working out a few kinks. The search entry is clearly trying to be too many things. We need a different way of indicating that you're looking at search results. Perhaps a search results banner similar to Nautilus.
Diffstat (limited to 'modules/calendar/e-cal-shell-view.c')
-rw-r--r--modules/calendar/e-cal-shell-view.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 47d734921c..262cd39246 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -59,6 +59,8 @@ cal_shell_view_execute_search (EShellView *shell_view)
EShellWindow *shell_window;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
+ EShellSearchbar *searchbar;
+ EActionComboBox *combo_box;
GnomeCalendar *calendar;
ECalendar *date_navigator;
GtkRadioAction *action;
@@ -74,11 +76,16 @@ cal_shell_view_execute_search (EShellView *shell_view)
shell_content = e_shell_view_get_shell_content (shell_view);
shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+ cal_shell_content = E_CAL_SHELL_CONTENT (shell_content);
+ cal_shell_sidebar = E_CAL_SHELL_SIDEBAR (shell_sidebar);
+
+ searchbar = e_cal_shell_content_get_searchbar (cal_shell_content);
+
action = GTK_RADIO_ACTION (ACTION (CALENDAR_SEARCH_ANY_FIELD_CONTAINS));
value = gtk_radio_action_get_current_value (action);
if (value == CALENDAR_SEARCH_ADVANCED) {
- query = e_shell_content_get_search_rule_as_string (shell_content);
+ query = e_shell_view_get_search_query (shell_view);
if (!query)
query = g_strdup ("");
@@ -87,7 +94,7 @@ cal_shell_view_execute_search (EShellView *shell_view)
const gchar *text;
GString *string;
- text = e_shell_content_get_search_text (shell_content);
+ text = e_shell_searchbar_get_search_text (searchbar);
if (text == NULL || *text == '\0') {
text = "";
@@ -123,7 +130,8 @@ cal_shell_view_execute_search (EShellView *shell_view)
start_range = end_range = 0;
/* Apply selected filter. */
- value = e_shell_content_get_filter_value (shell_content);
+ combo_box = e_shell_searchbar_get_filter_combo_box (searchbar);
+ value = e_action_combo_box_get_current_value (combo_box);
switch (value) {
case CALENDAR_FILTER_ANY_CATEGORY:
break;
@@ -186,7 +194,6 @@ cal_shell_view_execute_search (EShellView *shell_view)
}
}
- cal_shell_sidebar = E_CAL_SHELL_SIDEBAR (shell_sidebar);
date_navigator = e_cal_shell_sidebar_get_date_navigator (cal_shell_sidebar);
if (range_search) {
@@ -200,7 +207,6 @@ cal_shell_view_execute_search (EShellView *shell_view)
}
/* Submit the query. */
- cal_shell_content = E_CAL_SHELL_CONTENT (shell_content);
calendar = e_cal_shell_content_get_calendar (cal_shell_content);
gnome_calendar_set_search_query (
calendar, query, range_search, start_range, end_range);