aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-task-shell-view-actions.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-08-28 01:38:17 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-08-28 05:35:21 +0800
commit7dc82b2dcbab7f85504c3061ef45cc4249821e42 (patch)
treec54a1b8936775cfb12d4401f8c18ce85f504aa1d /modules/calendar/e-task-shell-view-actions.c
parent0e1066b431b3d172c18b7be8744875942515e117 (diff)
downloadgsoc2013-evolution-7dc82b2dcbab7f85504c3061ef45cc4249821e42.tar
gsoc2013-evolution-7dc82b2dcbab7f85504c3061ef45cc4249821e42.tar.gz
gsoc2013-evolution-7dc82b2dcbab7f85504c3061ef45cc4249821e42.tar.bz2
gsoc2013-evolution-7dc82b2dcbab7f85504c3061ef45cc4249821e42.tar.lz
gsoc2013-evolution-7dc82b2dcbab7f85504c3061ef45cc4249821e42.tar.xz
gsoc2013-evolution-7dc82b2dcbab7f85504c3061ef45cc4249821e42.tar.zst
gsoc2013-evolution-7dc82b2dcbab7f85504c3061ef45cc4249821e42.zip
Add vertical view to Memos and Tasks.
Diffstat (limited to 'modules/calendar/e-task-shell-view-actions.c')
-rw-r--r--modules/calendar/e-task-shell-view-actions.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c
index d1354026cb..d4fb94c2e5 100644
--- a/modules/calendar/e-task-shell-view-actions.c
+++ b/modules/calendar/e-task-shell-view-actions.c
@@ -675,6 +675,32 @@ action_task_search_cb (GtkRadioAction *action,
e_shell_content_set_search_hint (shell_content, search_hint);
}
+static void
+action_task_view_cb (GtkRadioAction *action,
+ GtkRadioAction *current,
+ ETaskShellView *task_shell_view)
+{
+ ETaskShellContent *task_shell_content;
+ GtkOrientable *orientable;
+ GtkOrientation orientation;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ orientable = GTK_ORIENTABLE (task_shell_content);
+
+ switch (gtk_radio_action_get_current_value (action)) {
+ case 0:
+ orientation = GTK_ORIENTATION_VERTICAL;
+ break;
+ case 1:
+ orientation = GTK_ORIENTATION_HORIZONTAL;
+ break;
+ default:
+ g_return_if_reached ();
+ }
+
+ gtk_orientable_set_orientation (orientable, orientation);
+}
+
static GtkActionEntry task_entries[] = {
{ "task-assign",
@@ -817,6 +843,13 @@ static GtkActionEntry task_entries[] = {
N_("_Actions"),
NULL,
NULL,
+ NULL },
+
+ { "task-preview-menu",
+ NULL,
+ N_("_Preview"),
+ NULL,
+ NULL,
NULL }
};
@@ -898,6 +931,33 @@ static GtkToggleActionEntry task_toggle_entries[] = {
TRUE }
};
+static GtkRadioActionEntry task_view_entries[] = {
+
+ /* This action represents the inital active memo view.
+ * It should not be visible in the UI, nor should it be
+ * possible to switch to it from another shell view. */
+ { "task-view-initial",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ -1 },
+
+ { "task-view-classic",
+ NULL,
+ N_("_Classic View"),
+ NULL,
+ N_("Show task preview below the task list"),
+ 0 },
+
+ { "task-view-vertical",
+ NULL,
+ N_("_Vertical View"),
+ NULL,
+ N_("Show task preview alongside the task list"),
+ 1 }
+};
+
static GtkRadioActionEntry task_filter_entries[] = {
{ "task-filter-active-tasks",
@@ -1031,6 +1091,10 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
action_group, task_toggle_entries,
G_N_ELEMENTS (task_toggle_entries), task_shell_view);
gtk_action_group_add_radio_actions (
+ action_group, task_view_entries,
+ G_N_ELEMENTS (task_view_entries), -1,
+ G_CALLBACK (action_task_view_cb), task_shell_view);
+ gtk_action_group_add_radio_actions (
action_group, task_search_entries,
G_N_ELEMENTS (task_search_entries),
TASK_SEARCH_SUMMARY_CONTAINS,
@@ -1053,6 +1117,10 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
key = "/apps/evolution/calendar/display/show_task_preview";
gconf_bridge_bind_property (bridge, key, object, "active");
+ object = G_OBJECT (ACTION (TASK_VIEW_VERTICAL));
+ key = "/apps/evolution/calendar/display/task_layout";
+ gconf_bridge_bind_property (bridge, key, object, "current-value");
+
/* Fine tuning. */
action = ACTION (TASK_DELETE);