From aa813bd7cadffa0110ddeeecd2b8df9d367db6e1 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 19 Nov 2009 15:40:50 +0100 Subject: Bug #579599 - Let the Advanced Search work again --- modules/calendar/e-task-shell-view-actions.c | 40 +++++++++++----------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'modules/calendar/e-task-shell-view-actions.c') diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index e5063c1d85..0e77efb1d8 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -652,29 +652,6 @@ action_task_save_as_cb (GtkAction *action, g_object_unref (file); } -static void -action_task_search_cb (GtkRadioAction *action, - GtkRadioAction *current, - ETaskShellView *task_shell_view) -{ - EShellView *shell_view; - EShellContent *shell_content; - const gchar *search_hint; - - /* XXX Figure out a way to handle this in EShellContent - * instead of every shell view having to handle it. - * The problem is EShellContent does not know what - * the search option actions are for this view. It - * would have to dig up the popup menu and retrieve - * the action for each menu item. Seems messy. */ - - shell_view = E_SHELL_VIEW (task_shell_view); - shell_content = e_shell_view_get_shell_content (shell_view); - - search_hint = gtk_action_get_label (GTK_ACTION (current)); - e_shell_content_set_search_hint (shell_content, search_hint); -} - static void action_task_view_cb (GtkRadioAction *action, GtkRadioAction *current, @@ -1001,6 +978,13 @@ static GtkRadioActionEntry task_filter_entries[] = { static GtkRadioActionEntry task_search_entries[] = { + { "task-search-advanced-hidden", + NULL, + N_("Advanced search"), + NULL, + NULL, + TASK_SEARCH_ADVANCED }, + { "task-search-any-field-contains", NULL, N_("Any field contains"), @@ -1081,6 +1065,7 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) GtkActionGroup *action_group; GConfBridge *bridge; GtkAction *action; + GtkRadioAction *radio_action; GObject *object; const gchar *key; @@ -1108,8 +1093,13 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) gtk_action_group_add_radio_actions ( action_group, task_search_entries, G_N_ELEMENTS (task_search_entries), - TASK_SEARCH_SUMMARY_CONTAINS, - G_CALLBACK (action_task_search_cb), task_shell_view); + -1, NULL, NULL); + + /* Advanced Search action */ + radio_action = GTK_RADIO_ACTION (ACTION (TASK_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, TASK_SEARCH_SUMMARY_CONTAINS); /* Lockdown Printing Actions */ action_group = ACTION_GROUP (LOCKDOWN_PRINTING); -- cgit