aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-memo-shell-view-actions.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-actions.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-actions.c')
-rw-r--r--modules/calendar/e-memo-shell-view-actions.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c
index 394d6091a4..baf90f5a73 100644
--- a/modules/calendar/e-memo-shell-view-actions.c
+++ b/modules/calendar/e-memo-shell-view-actions.c
@@ -819,7 +819,7 @@ static GtkRadioActionEntry memo_search_entries[] = {
{ "memo-search-advanced-hidden",
NULL,
- N_("Advanced search"),
+ N_("Advanced Search"),
NULL,
NULL,
MEMO_SEARCH_ADVANCED },
@@ -897,14 +897,14 @@ static EPopupActionEntry lockdown_save_to_disk_popup_entries[] = {
void
e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
{
+ EMemoShellContent *memo_shell_content;
EShellView *shell_view;
EShellWindow *shell_window;
- EMemoShellContent *memo_shell_content;
+ EShellSearchbar *searchbar;
ECalComponentPreview *memo_preview;
GtkActionGroup *action_group;
GConfBridge *bridge;
GtkAction *action;
- GtkRadioAction *radio_action;
GObject *object;
const gchar *key;
@@ -912,6 +912,7 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
shell_window = e_shell_view_get_shell_window (shell_view);
memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ searchbar = e_memo_shell_content_get_searchbar (memo_shell_content);
memo_preview = e_memo_shell_content_get_memo_preview (memo_shell_content);
/* Memo Actions */
@@ -934,11 +935,14 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
G_N_ELEMENTS (memo_search_entries),
-1, NULL, NULL);
- /* Advanced Search action */
- radio_action = GTK_RADIO_ACTION (ACTION (MEMO_SEARCH_ADVANCED_HIDDEN));
- e_shell_content_set_search_radio_action (e_shell_view_get_shell_content (shell_view), radio_action);
- gtk_action_set_visible (GTK_ACTION (radio_action), FALSE);
- gtk_radio_action_set_current_value (radio_action, MEMO_SEARCH_SUMMARY_CONTAINS);
+ /* Advanced Search Action */
+ action = ACTION (MEMO_SEARCH_ADVANCED_HIDDEN);
+ gtk_action_set_visible (action, FALSE);
+ e_shell_searchbar_set_search_option (
+ searchbar, GTK_RADIO_ACTION (action));
+ gtk_radio_action_set_current_value (
+ GTK_RADIO_ACTION (action),
+ MEMO_SEARCH_SUMMARY_CONTAINS);
/* Lockdown Printing Actions */
action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
@@ -1002,9 +1006,11 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
void
e_memo_shell_view_update_search_filter (EMemoShellView *memo_shell_view)
{
- EShellContent *shell_content;
- EShellWindow *shell_window;
+ EMemoShellContent *memo_shell_content;
EShellView *shell_view;
+ EShellWindow *shell_window;
+ EShellSearchbar *searchbar;
+ EActionComboBox *combo_box;
GtkActionGroup *action_group;
GtkRadioAction *radio_action;
GList *list, *iter;
@@ -1012,7 +1018,6 @@ e_memo_shell_view_update_search_filter (EMemoShellView *memo_shell_view)
gint ii;
shell_view = E_SHELL_VIEW (memo_shell_view);
- shell_content = e_shell_view_get_shell_content (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
action_group = ACTION_GROUP (MEMOS_FILTER);
@@ -1076,8 +1081,11 @@ e_memo_shell_view_update_search_filter (EMemoShellView *memo_shell_view)
g_list_free (list);
/* Use any action in the group; doesn't matter which. */
- e_shell_content_set_filter_action (shell_content, radio_action);
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ searchbar = e_memo_shell_content_get_searchbar (memo_shell_content);
+ combo_box = e_shell_searchbar_get_filter_combo_box (searchbar);
+ e_action_combo_box_set_action (combo_box, radio_action);
ii = MEMO_FILTER_UNMATCHED;
- e_shell_content_add_filter_separator_after (shell_content, ii);
+ e_action_combo_box_add_separator_after (combo_box, ii);
}