aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-06-25 08:23:07 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-06-25 08:42:09 +0800
commit71e92f3f2c45cd8dd9f44d8226e23603164974a5 (patch)
tree93f4758df11e2f7c92a4e8c60f85359547bf93fe /modules/calendar
parent179db75ce041706a590e90a6ac7b801b36091ed6 (diff)
downloadgsoc2013-evolution-71e92f3f2c45cd8dd9f44d8226e23603164974a5.tar
gsoc2013-evolution-71e92f3f2c45cd8dd9f44d8226e23603164974a5.tar.gz
gsoc2013-evolution-71e92f3f2c45cd8dd9f44d8226e23603164974a5.tar.bz2
gsoc2013-evolution-71e92f3f2c45cd8dd9f44d8226e23603164974a5.tar.lz
gsoc2013-evolution-71e92f3f2c45cd8dd9f44d8226e23603164974a5.tar.xz
gsoc2013-evolution-71e92f3f2c45cd8dd9f44d8226e23603164974a5.tar.zst
gsoc2013-evolution-71e92f3f2c45cd8dd9f44d8226e23603164974a5.zip
EShellContent: Add a focus_search_results() method.
This gives EShellSearchbar something concrete to call to direct focus away from itself instead of tabbing forward and hoping for the best.
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-shell-content.c21
-rw-r--r--modules/calendar/e-memo-shell-content.c11
-rw-r--r--modules/calendar/e-task-shell-content.c11
3 files changed, 43 insertions, 0 deletions
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c
index a51a072f66..146d9b964a 100644
--- a/modules/calendar/e-cal-shell-content.c
+++ b/modules/calendar/e-cal-shell-content.c
@@ -357,6 +357,7 @@ cal_shell_content_constructed (GObject *object)
foreign_content = e_shell_view_get_shell_content (foreign_view);
g_object_get (foreign_content, "model", &task_model, NULL);
}
+
/* Build content widgets. */
container = GTK_WIDGET (object);
@@ -547,10 +548,27 @@ cal_shell_content_map (GtkWidget *widget)
}
static void
+cal_shell_content_focus_search_results (EShellContent *shell_content)
+{
+ ECalShellContent *cal_shell_content;
+ GnomeCalendar *calendar;
+ GnomeCalendarViewType view_type;
+ ECalendarView *calendar_view;
+
+ cal_shell_content = E_CAL_SHELL_CONTENT (shell_content);
+ calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+ view_type = gnome_calendar_get_view (calendar);
+ calendar_view = gnome_calendar_get_calendar_view (calendar, view_type);
+
+ gtk_widget_grab_focus (GTK_WIDGET (calendar_view));
+}
+
+static void
cal_shell_content_class_init (ECalShellContentClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
+ EShellContentClass *shell_content_class;
parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (ECalShellContentPrivate));
@@ -564,6 +582,9 @@ cal_shell_content_class_init (ECalShellContentClass *class)
widget_class = GTK_WIDGET_CLASS (class);
widget_class->map = cal_shell_content_map;
+ shell_content_class = E_SHELL_CONTENT_CLASS (class);
+ shell_content_class->focus_search_results = cal_shell_content_focus_search_results;
+
g_object_class_install_property (
object_class,
PROP_CALENDAR,
diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c
index f9188dedc5..663920044c 100644
--- a/modules/calendar/e-memo-shell-content.c
+++ b/modules/calendar/e-memo-shell-content.c
@@ -601,6 +601,16 @@ memo_shell_content_check_state (EShellContent *shell_content)
}
static void
+memo_shell_content_focus_search_results (EShellContent *shell_content)
+{
+ EMemoShellContentPrivate *priv;
+
+ priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (shell_content);
+
+ gtk_widget_grab_focus (priv->memo_table);
+}
+
+static void
memo_shell_content_class_init (EMemoShellContentClass *class)
{
GObjectClass *object_class;
@@ -618,6 +628,7 @@ memo_shell_content_class_init (EMemoShellContentClass *class)
shell_content_class = E_SHELL_CONTENT_CLASS (class);
shell_content_class->check_state = memo_shell_content_check_state;
+ shell_content_class->focus_search_results = memo_shell_content_focus_search_results;
g_object_class_install_property (
object_class,
diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c
index b2744a883e..bb2017fa8a 100644
--- a/modules/calendar/e-task-shell-content.c
+++ b/modules/calendar/e-task-shell-content.c
@@ -621,6 +621,16 @@ task_shell_content_check_state (EShellContent *shell_content)
}
static void
+task_shell_content_focus_search_results (EShellContent *shell_content)
+{
+ ETaskShellContentPrivate *priv;
+
+ priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (shell_content);
+
+ gtk_widget_grab_focus (priv->task_table);
+}
+
+static void
task_shell_content_class_init (ETaskShellContentClass *class)
{
GObjectClass *object_class;
@@ -638,6 +648,7 @@ task_shell_content_class_init (ETaskShellContentClass *class)
shell_content_class = E_SHELL_CONTENT_CLASS (class);
shell_content_class->check_state = task_shell_content_check_state;
+ shell_content_class->focus_search_results = task_shell_content_focus_search_results;
g_object_class_install_property (
object_class,