aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-06-09 12:28:07 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-06-09 18:36:56 +0800
commitdf17adc5aa4ff6af69686d0957e1ab6dfa58732d (patch)
treef681bbb06fc307633e2f751780a582dd625093c5 /calendar
parent2f4139e59919afdab0bcf2ca9ca91d168515b43f (diff)
downloadgsoc2013-evolution-df17adc5aa4ff6af69686d0957e1ab6dfa58732d.tar
gsoc2013-evolution-df17adc5aa4ff6af69686d0957e1ab6dfa58732d.tar.gz
gsoc2013-evolution-df17adc5aa4ff6af69686d0957e1ab6dfa58732d.tar.bz2
gsoc2013-evolution-df17adc5aa4ff6af69686d0957e1ab6dfa58732d.tar.lz
gsoc2013-evolution-df17adc5aa4ff6af69686d0957e1ab6dfa58732d.tar.xz
gsoc2013-evolution-df17adc5aa4ff6af69686d0957e1ab6dfa58732d.tar.zst
gsoc2013-evolution-df17adc5aa4ff6af69686d0957e1ab6dfa58732d.zip
Search bar improvements.
Split the search entry into a new widget to manage hints (EHintedEntry). Let the search entry expand to use available horizontal space.
Diffstat (limited to 'calendar')
-rw-r--r--calendar/module/e-cal-shell-view-actions.c25
-rw-r--r--calendar/module/e-memo-shell-view-actions.c25
-rw-r--r--calendar/module/e-task-shell-view-actions.c25
3 files changed, 72 insertions, 3 deletions
diff --git a/calendar/module/e-cal-shell-view-actions.c b/calendar/module/e-cal-shell-view-actions.c
index a5d0dd826b..5f5380d919 100644
--- a/calendar/module/e-cal-shell-view-actions.c
+++ b/calendar/module/e-cal-shell-view-actions.c
@@ -297,6 +297,29 @@ action_calendar_rename_cb (GtkAction *action,
}
static void
+action_calendar_search_cb (GtkRadioAction *action,
+ GtkRadioAction *current,
+ ECalShellView *cal_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 (cal_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_calendar_select_one_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
@@ -1051,7 +1074,7 @@ e_cal_shell_view_actions_init (ECalShellView *cal_shell_view)
action_group, calendar_search_entries,
G_N_ELEMENTS (calendar_search_entries),
CALENDAR_SEARCH_SUMMARY_CONTAINS,
- NULL, NULL);
+ G_CALLBACK (action_calendar_search_cb), cal_shell_view);
/* Lockdown Printing Actions */
action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
diff --git a/calendar/module/e-memo-shell-view-actions.c b/calendar/module/e-memo-shell-view-actions.c
index ab0b9f0fe3..855a7b18b4 100644
--- a/calendar/module/e-memo-shell-view-actions.c
+++ b/calendar/module/e-memo-shell-view-actions.c
@@ -505,6 +505,29 @@ action_memo_save_as_cb (GtkAction *action,
}
static void
+action_memo_search_cb (GtkRadioAction *action,
+ GtkRadioAction *current,
+ EMemoShellView *memo_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 (memo_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_search_execute_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
@@ -803,7 +826,7 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
action_group, memo_search_entries,
G_N_ELEMENTS (memo_search_entries),
MEMO_SEARCH_SUMMARY_CONTAINS,
- NULL, NULL);
+ G_CALLBACK (action_memo_search_cb), memo_shell_view);
/* Lockdown Printing Actions */
action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
diff --git a/calendar/module/e-task-shell-view-actions.c b/calendar/module/e-task-shell-view-actions.c
index 4645ac0e56..8431b64624 100644
--- a/calendar/module/e-task-shell-view-actions.c
+++ b/calendar/module/e-task-shell-view-actions.c
@@ -646,6 +646,29 @@ action_task_save_as_cb (GtkAction *action,
g_free (string);
}
+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 GtkActionEntry task_entries[] = {
{ "task-assign",
@@ -1005,7 +1028,7 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
action_group, task_search_entries,
G_N_ELEMENTS (task_search_entries),
TASK_SEARCH_SUMMARY_CONTAINS,
- NULL, NULL);
+ G_CALLBACK (action_task_search_cb), task_shell_view);
/* Lockdown Printing Actions */
action_group = ACTION_GROUP (LOCKDOWN_PRINTING);