aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
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
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')
-rw-r--r--modules/calendar/e-cal-shell-content.c15
-rw-r--r--modules/calendar/e-cal-shell-content.h4
-rw-r--r--modules/calendar/e-cal-shell-view-actions.c37
-rw-r--r--modules/calendar/e-cal-shell-view.c16
-rw-r--r--modules/calendar/e-memo-shell-content.c15
-rw-r--r--modules/calendar/e-memo-shell-content.h4
-rw-r--r--modules/calendar/e-memo-shell-view-actions.c34
-rw-r--r--modules/calendar/e-memo-shell-view.c14
-rw-r--r--modules/calendar/e-task-shell-content.c15
-rw-r--r--modules/calendar/e-task-shell-content.h4
-rw-r--r--modules/calendar/e-task-shell-view-actions.c36
-rw-r--r--modules/calendar/e-task-shell-view.c15
12 files changed, 156 insertions, 53 deletions
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c
index 0627f74dd6..fcebf59ca5 100644
--- a/modules/calendar/e-cal-shell-content.c
+++ b/modules/calendar/e-cal-shell-content.c
@@ -679,6 +679,21 @@ e_cal_shell_content_get_task_table (ECalShellContent *cal_shell_content)
return E_CALENDAR_TABLE (cal_shell_content->priv->task_table);
}
+EShellSearchbar *
+e_cal_shell_content_get_searchbar (ECalShellContent *cal_shell_content)
+{
+ EShellContent *shell_content;
+ GtkWidget *widget;
+
+ g_return_val_if_fail (
+ E_IS_CAL_SHELL_CONTENT (cal_shell_content), NULL);
+
+ shell_content = E_SHELL_CONTENT (cal_shell_content);
+ widget = e_shell_content_get_searchbar (shell_content);
+
+ return E_SHELL_SEARCHBAR (widget);
+}
+
GalViewInstance *
e_cal_shell_content_get_view_instance (ECalShellContent *cal_shell_content)
{
diff --git a/modules/calendar/e-cal-shell-content.h b/modules/calendar/e-cal-shell-content.h
index 3db7d33260..eae8bf3301 100644
--- a/modules/calendar/e-cal-shell-content.h
+++ b/modules/calendar/e-cal-shell-content.h
@@ -23,6 +23,7 @@
#define E_CAL_SHELL_CONTENT_H
#include <shell/e-shell-content.h>
+#include <shell/e-shell-searchbar.h>
#include <shell/e-shell-view.h>
#include <calendar/gui/e-memo-table.h>
@@ -89,6 +90,9 @@ EMemoTable * e_cal_shell_content_get_memo_table
(ECalShellContent *cal_shell_content);
ECalendarTable *e_cal_shell_content_get_task_table
(ECalShellContent *cal_shell_content);
+EShellSearchbar *
+ e_cal_shell_content_get_searchbar
+ (ECalShellContent *cal_shell_content);
GalViewInstance *
e_cal_shell_content_get_view_instance
(ECalShellContent *cal_shell_content);
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index b0408b6b5a..148cc4a426 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -1654,7 +1654,7 @@ static GtkRadioActionEntry calendar_search_entries[] = {
{ "calendar-search-advanced-hidden",
NULL,
- N_("Advanced search"),
+ N_("Advanced Search"),
NULL,
NULL,
CALENDAR_SEARCH_ADVANCED },
@@ -1715,15 +1715,19 @@ static EPopupActionEntry lockdown_printing_popup_entries[] = {
void
e_cal_shell_view_actions_init (ECalShellView *cal_shell_view)
{
+ ECalShellContent *cal_shell_content;
EShellView *shell_view;
EShellWindow *shell_window;
+ EShellSearchbar *searchbar;
GtkActionGroup *action_group;
GtkAction *action;
- GtkRadioAction *radio_action;
shell_view = E_SHELL_VIEW (cal_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
+ cal_shell_content = cal_shell_view->priv->cal_shell_content;
+ searchbar = e_cal_shell_content_get_searchbar (cal_shell_content);
+
/* Calendar Actions */
action_group = ACTION_GROUP (CALENDAR);
gtk_action_group_add_actions (
@@ -1741,11 +1745,14 @@ e_cal_shell_view_actions_init (ECalShellView *cal_shell_view)
G_N_ELEMENTS (calendar_search_entries),
-1, NULL, NULL);
- /* Advanced Search action */
- radio_action = GTK_RADIO_ACTION (ACTION (CALENDAR_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, CALENDAR_SEARCH_SUMMARY_CONTAINS);
+ /* Advanced Search Action */
+ action = ACTION (CALENDAR_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),
+ CALENDAR_SEARCH_SUMMARY_CONTAINS);
/* Lockdown Printing Actions */
action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
@@ -1794,9 +1801,11 @@ e_cal_shell_view_actions_init (ECalShellView *cal_shell_view)
void
e_cal_shell_view_update_search_filter (ECalShellView *cal_shell_view)
{
- EShellContent *shell_content;
- EShellWindow *shell_window;
+ ECalShellContent *cal_shell_content;
EShellView *shell_view;
+ EShellWindow *shell_window;
+ EShellSearchbar *searchbar;
+ EActionComboBox *combo_box;
GtkActionGroup *action_group;
GtkRadioAction *radio_action;
GList *list, *iter;
@@ -1804,7 +1813,6 @@ e_cal_shell_view_update_search_filter (ECalShellView *cal_shell_view)
gint ii;
shell_view = E_SHELL_VIEW (cal_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 (CALENDAR_FILTER);
@@ -1868,11 +1876,14 @@ e_cal_shell_view_update_search_filter (ECalShellView *cal_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);
+ cal_shell_content = cal_shell_view->priv->cal_shell_content;
+ searchbar = e_cal_shell_content_get_searchbar (cal_shell_content);
+ combo_box = e_shell_searchbar_get_filter_combo_box (searchbar);
+ e_action_combo_box_set_action (combo_box, radio_action);
ii = CALENDAR_FILTER_UNMATCHED;
- e_shell_content_add_filter_separator_after (shell_content, ii);
+ e_action_combo_box_add_separator_after (combo_box, ii);
ii = CALENDAR_FILTER_NEXT_7_DAYS_APPOINTMENTS;
- e_shell_content_add_filter_separator_after (shell_content, ii);
+ e_action_combo_box_add_separator_after (combo_box, ii);
}
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);
diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c
index d3fe10f20b..4de685cd4b 100644
--- a/modules/calendar/e-memo-shell-content.c
+++ b/modules/calendar/e-memo-shell-content.c
@@ -727,6 +727,21 @@ e_memo_shell_content_set_preview_visible (EMemoShellContent *memo_shell_content,
g_object_notify (G_OBJECT (memo_shell_content), "preview-visible");
}
+EShellSearchbar *
+e_memo_shell_content_get_searchbar (EMemoShellContent *memo_shell_content)
+{
+ EShellContent *shell_content;
+ GtkWidget *widget;
+
+ g_return_val_if_fail (
+ E_IS_MEMO_SHELL_CONTENT (memo_shell_content), NULL);
+
+ shell_content = E_SHELL_CONTENT (memo_shell_content);
+ widget = e_shell_content_get_searchbar (shell_content);
+
+ return E_SHELL_SEARCHBAR (widget);
+}
+
GalViewInstance *
e_memo_shell_content_get_view_instance (EMemoShellContent *memo_shell_content)
{
diff --git a/modules/calendar/e-memo-shell-content.h b/modules/calendar/e-memo-shell-content.h
index 20c7db4df1..a923b27f0b 100644
--- a/modules/calendar/e-memo-shell-content.h
+++ b/modules/calendar/e-memo-shell-content.h
@@ -23,6 +23,7 @@
#define E_MEMO_SHELL_CONTENT_H
#include <shell/e-shell-content.h>
+#include <shell/e-shell-searchbar.h>
#include <shell/e-shell-view.h>
#include <calendar/gui/e-memo-table.h>
@@ -88,6 +89,9 @@ gboolean e_memo_shell_content_get_preview_visible
void e_memo_shell_content_set_preview_visible
(EMemoShellContent *memo_shell_content,
gboolean preview_visible);
+EShellSearchbar *
+ e_memo_shell_content_get_searchbar
+ (EMemoShellContent *memo_shell_content);
GalViewInstance *
e_memo_shell_content_get_view_instance
(EMemoShellContent *memo_shell_content);
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);
}
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);
diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c
index c033d6e489..4692e7bf7e 100644
--- a/modules/calendar/e-task-shell-content.c
+++ b/modules/calendar/e-task-shell-content.c
@@ -750,6 +750,21 @@ e_task_shell_content_set_preview_visible (ETaskShellContent *task_shell_content,
g_object_notify (G_OBJECT (task_shell_content), "preview-visible");
}
+EShellSearchbar *
+e_task_shell_content_get_searchbar (ETaskShellContent *task_shell_content)
+{
+ EShellContent *shell_content;
+ GtkWidget *widget;
+
+ g_return_val_if_fail (
+ E_IS_TASK_SHELL_CONTENT (task_shell_content), NULL);
+
+ shell_content = E_SHELL_CONTENT (task_shell_content);
+ widget = e_shell_content_get_searchbar (shell_content);
+
+ return E_SHELL_SEARCHBAR (widget);
+}
+
GalViewInstance *
e_task_shell_content_get_view_instance (ETaskShellContent *task_shell_content)
{
diff --git a/modules/calendar/e-task-shell-content.h b/modules/calendar/e-task-shell-content.h
index e5bdecd8c0..971d46ad95 100644
--- a/modules/calendar/e-task-shell-content.h
+++ b/modules/calendar/e-task-shell-content.h
@@ -23,6 +23,7 @@
#define E_TASK_SHELL_CONTENT_H
#include <shell/e-shell-content.h>
+#include <shell/e-shell-searchbar.h>
#include <shell/e-shell-view.h>
#include <calendar/gui/e-cal-model.h>
@@ -92,6 +93,9 @@ gboolean e_task_shell_content_get_preview_visible
void e_task_shell_content_set_preview_visible
(ETaskShellContent *task_shell_content,
gboolean preview_visible);
+EShellSearchbar *
+ e_task_shell_content_get_searchbar
+ (ETaskShellContent *task_shell_content);
GalViewInstance *
e_task_shell_content_get_view_instance
(ETaskShellContent *task_shell_content);
diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c
index 6e79c23395..8e28b55863 100644
--- a/modules/calendar/e-task-shell-view-actions.c
+++ b/modules/calendar/e-task-shell-view-actions.c
@@ -1018,7 +1018,7 @@ static GtkRadioActionEntry task_search_entries[] = {
{ "task-search-advanced-hidden",
NULL,
- N_("Advanced search"),
+ N_("Advanced Search"),
NULL,
NULL,
TASK_SEARCH_ADVANCED },
@@ -1096,14 +1096,14 @@ static EPopupActionEntry lockdown_save_to_disk_popup_entries[] = {
void
e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
{
+ ETaskShellContent *task_shell_content;
EShellView *shell_view;
EShellWindow *shell_window;
- ETaskShellContent *task_shell_content;
+ EShellSearchbar *searchbar;
ECalComponentPreview *task_preview;
GtkActionGroup *action_group;
GConfBridge *bridge;
GtkAction *action;
- GtkRadioAction *radio_action;
GObject *object;
const gchar *key;
@@ -1111,6 +1111,7 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
shell_window = e_shell_view_get_shell_window (shell_view);
task_shell_content = task_shell_view->priv->task_shell_content;
+ searchbar = e_task_shell_content_get_searchbar (task_shell_content);
task_preview = e_task_shell_content_get_task_preview (task_shell_content);
/* Task Actions */
@@ -1133,11 +1134,14 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
G_N_ELEMENTS (task_search_entries),
-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);
+ /* Advanced Search Action */
+ action = ACTION (TASK_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),
+ TASK_SEARCH_SUMMARY_CONTAINS);
/* Lockdown Printing Actions */
action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
@@ -1201,9 +1205,11 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
void
e_task_shell_view_update_search_filter (ETaskShellView *task_shell_view)
{
- EShellContent *shell_content;
- EShellWindow *shell_window;
+ ETaskShellContent *task_shell_content;
EShellView *shell_view;
+ EShellWindow *shell_window;
+ EShellSearchbar *searchbar;
+ EActionComboBox *combo_box;
GtkActionGroup *action_group;
GtkRadioAction *radio_action;
GList *list, *iter;
@@ -1211,7 +1217,6 @@ e_task_shell_view_update_search_filter (ETaskShellView *task_shell_view)
gint ii;
shell_view = E_SHELL_VIEW (task_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 (TASKS_FILTER);
@@ -1275,11 +1280,14 @@ e_task_shell_view_update_search_filter (ETaskShellView *task_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);
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ searchbar = e_task_shell_content_get_searchbar (task_shell_content);
+ combo_box = e_shell_searchbar_get_filter_combo_box (searchbar);
+ e_action_combo_box_set_action (combo_box, radio_action);
ii = TASK_FILTER_UNMATCHED;
- e_shell_content_add_filter_separator_after (shell_content, ii);
+ e_action_combo_box_add_separator_after (combo_box, ii);
ii = TASK_FILTER_TASKS_WITH_ATTACHMENTS;
- e_shell_content_add_filter_separator_after (shell_content, ii);
+ e_action_combo_box_add_separator_after (combo_box, ii);
}
diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c
index 9558eb77c0..a481356690 100644
--- a/modules/calendar/e-task-shell-view.c
+++ b/modules/calendar/e-task-shell-view.c
@@ -96,6 +96,8 @@ task_shell_view_execute_search (EShellView *shell_view)
ETaskShellContent *task_shell_content;
EShellWindow *shell_window;
EShellContent *shell_content;
+ EShellSearchbar *searchbar;
+ EActionComboBox *combo_box;
GtkRadioAction *action;
ECalComponentPreview *task_preview;
ECalendarTable *task_table;
@@ -107,13 +109,17 @@ task_shell_view_execute_search (EShellView *shell_view)
gchar *temp;
gint value;
- shell_content = e_shell_view_get_shell_content (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ task_shell_content = E_TASK_SHELL_CONTENT (shell_content);
+ searchbar = e_task_shell_content_get_searchbar (task_shell_content);
+
action = GTK_RADIO_ACTION (ACTION (TASK_SEARCH_ANY_FIELD_CONTAINS));
value = gtk_radio_action_get_current_value (action);
if (value == TASK_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 ("");
@@ -122,7 +128,7 @@ task_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 = "";
@@ -155,7 +161,8 @@ task_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 TASK_FILTER_ANY_CATEGORY:
break;