aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-memo-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-memo-shell-view.c
parenta1efb837566cdac798cd8777dd34e06e9782cf61 (diff)
downloadgsoc2013-evolution-4cbbdedf522a6ac10df93a128bbf25f67173d66e.tar
gsoc2013-evolution-4cbbdedf522a6ac10df93a128bbf25f67173d66e.tar.gz
gsoc2013-evolution-4cbbdedf522a6ac10df93a128bbf25f67173d66e.tar.bz2
gsoc2013-evolution-4cbbdedf522a6ac10df93a128bbf25f67173d66e.tar.lz
gsoc2013-evolution-4cbbdedf522a6ac10df93a128bbf25f67173d66e.tar.xz
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-memo-shell-view.c')
-rw-r--r--modules/calendar/e-memo-shell-view.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/calendar/e-memo-shell-view.c b/modules/calendar/e-memo-shell-view.c
index 206e50c961..29a82524c4 100644
--- a/modules/calendar/e-memo-shell-view.c
+++ b/modules/calendar/e-memo-shell-view.c
@@ -57,6 +57,8 @@ memo_shell_view_execute_search (EShellView *shell_view)
EMemoShellContent *memo_shell_content;
EShellWindow *shell_window;
EShellContent *shell_content;
+ EShellSearchbar *searchbar;
+ EActionComboBox *combo_box;
GtkRadioAction *action;
ECalComponentPreview *memo_preview;
EMemoTable *memo_table;
@@ -67,11 +69,15 @@ memo_shell_view_execute_search (EShellView *shell_view)
shell_content = e_shell_view_get_shell_content (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
+
+ memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content);
+ searchbar = e_memo_shell_content_get_searchbar (memo_shell_content);
+
action = GTK_RADIO_ACTION (ACTION (MEMO_SEARCH_ANY_FIELD_CONTAINS));
value = gtk_radio_action_get_current_value (action);
if (value == MEMO_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 ("");
@@ -80,7 +86,7 @@ memo_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 = "";
@@ -113,7 +119,8 @@ memo_shell_view_execute_search (EShellView *shell_view)
}
/* 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 MEMO_FILTER_ANY_CATEGORY:
break;
@@ -143,7 +150,6 @@ memo_shell_view_execute_search (EShellView *shell_view)
}
/* Submit the query. */
- memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content);
memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
model = e_memo_table_get_model (memo_table);
e_cal_model_set_search_query (model, query);