aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2007-04-20 13:37:15 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-04-20 13:37:15 +0800
commit012597c56eb6788247cb836f94518a3b8de0b0f7 (patch)
treef4de48e5c3296feb4ec70d5ae37171977d5fada5 /shell/e-shell-window.c
parent6b03aee3149121938a9a741798cfa345950ab49f (diff)
downloadgsoc2013-evolution-012597c56eb6788247cb836f94518a3b8de0b0f7.tar
gsoc2013-evolution-012597c56eb6788247cb836f94518a3b8de0b0f7.tar.gz
gsoc2013-evolution-012597c56eb6788247cb836f94518a3b8de0b0f7.tar.bz2
gsoc2013-evolution-012597c56eb6788247cb836f94518a3b8de0b0f7.tar.lz
gsoc2013-evolution-012597c56eb6788247cb836f94518a3b8de0b0f7.tar.xz
gsoc2013-evolution-012597c56eb6788247cb836f94518a3b8de0b0f7.tar.zst
gsoc2013-evolution-012597c56eb6788247cb836f94518a3b8de0b0f7.zip
Fix for bug #259606
svn path=/trunk/; revision=33438
Diffstat (limited to 'shell/e-shell-window.c')
-rw-r--r--shell/e-shell-window.c52
1 files changed, 38 insertions, 14 deletions
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 541ddbcc26..a5475b078f 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -428,28 +428,50 @@ update_send_receive_sensitivity (EShellWindow *window)
/* Callbacks. */
+static ComponentView *
+get_component_view (EShellWindow *window, int id)
+{
+ GSList *p;
+
+ for (p = window->priv->component_views; p; p = p->next) {
+ if (((ComponentView *) p->data)->button_id == id)
+ return p->data;
+ }
+
+ g_warning ("Unknown component button id %d", id);
+ return NULL;
+}
+
static void
sidebar_button_selected_callback (ESidebar *sidebar,
int button_id,
EShellWindow *window)
{
- EShellWindowPrivate *priv = window->priv;
- ComponentView *component_view = NULL;
- GSList *p;
+ ComponentView *component_view;
- for (p = priv->component_views; p != NULL; p = p->next) {
- if (((ComponentView *) p->data)->button_id == button_id) {
- component_view = p->data;
- break;
- }
- }
+ if ((component_view = get_component_view (window, button_id)))
+ switch_view (window, component_view);
+}
- if (component_view == NULL) {
- g_warning ("Unknown component button id %d", button_id);
- return;
+static gboolean
+sidebar_button_pressed_callback (ESidebar *sidebar,
+ GdkEventButton *event,
+ int button_id,
+ EShellWindow *window)
+{
+ if (event->type == GDK_BUTTON_PRESS &&
+ event->button == 2) {
+ /* open it in a new window */
+ ComponentView *component_view;
+
+ if ((component_view = get_component_view (window, button_id))) {
+ e_shell_create_window (window->priv->shell,
+ component_view->component_id,
+ window);
+ }
+ return TRUE;
}
-
- switch_view (window, component_view);
+ return FALSE;
}
static void
@@ -668,6 +690,8 @@ setup_widgets (EShellWindow *window)
priv->sidebar = e_sidebar_new ();
g_signal_connect (priv->sidebar, "button_selected",
G_CALLBACK (sidebar_button_selected_callback), window);
+ g_signal_connect (priv->sidebar, "button_pressed",
+ G_CALLBACK (sidebar_button_pressed_callback), window);
gtk_paned_pack1 (GTK_PANED (priv->paned), priv->sidebar, FALSE, FALSE);
gtk_widget_show (priv->sidebar);