aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@gnome.org>2010-07-13 15:31:11 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-26 09:29:59 +0800
commit75de89ef04f0bd69fe5d33919e281bdb8c30bd9e (patch)
treefe6acd687988f6972c362ee8991dce83b14c8a78
parent9849889089a50d0e7a6efc37037956af83abc358 (diff)
downloadgsoc2013-evolution-75de89ef04f0bd69fe5d33919e281bdb8c30bd9e.tar
gsoc2013-evolution-75de89ef04f0bd69fe5d33919e281bdb8c30bd9e.tar.gz
gsoc2013-evolution-75de89ef04f0bd69fe5d33919e281bdb8c30bd9e.tar.bz2
gsoc2013-evolution-75de89ef04f0bd69fe5d33919e281bdb8c30bd9e.tar.lz
gsoc2013-evolution-75de89ef04f0bd69fe5d33919e281bdb8c30bd9e.tar.xz
gsoc2013-evolution-75de89ef04f0bd69fe5d33919e281bdb8c30bd9e.tar.zst
gsoc2013-evolution-75de89ef04f0bd69fe5d33919e281bdb8c30bd9e.zip
Make the update-actions work across tabs.
-rw-r--r--mail/e-mail-notebook-view.c31
-rw-r--r--mail/e-mail-reader.c36
-rw-r--r--modules/mail/e-mail-shell-content.c18
3 files changed, 85 insertions, 0 deletions
diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c
index 16353cdb1d..5fa6c6844f 100644
--- a/mail/e-mail-notebook-view.c
+++ b/mail/e-mail-notebook-view.c
@@ -63,6 +63,16 @@ e_mail_notebook_view_finalize (GObject *object)
}
static void
+mnv_page_changed (GtkNotebook *book, GtkNotebookPage *page,
+ guint page_num, EMailNotebookView *view)
+{
+ EMailView *mview = gtk_notebook_get_nth_page (book, page_num);
+
+ view->priv->current_view = mview;
+ g_signal_emit_by_name (view, "changed");
+}
+
+static void
mail_notebook_view_constructed (GObject *object)
{
GtkWidget *widget, *container;
@@ -77,6 +87,8 @@ mail_notebook_view_constructed (GObject *object)
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX(container), widget, TRUE, TRUE, 0);
+ g_signal_connect (widget, "switch-page", G_CALLBACK(mnv_page_changed), object);
+
priv->current_view = e_mail_paned_view_new (E_MAIL_VIEW(object)->content);
gtk_widget_show (priv->current_view);
gtk_notebook_append_page (priv->book, priv->current_view, gtk_label_new ("Please select a folder"));
@@ -222,6 +234,18 @@ emnv_get_page_num (EMailNotebookView *view,
}
static void
+reconnect_changed_event (EMailReader *child, EMailReader *parent)
+{
+ g_signal_emit_by_name (parent, "changed");
+}
+
+static void
+reconnect_folder_loaded_event (EMailReader *child, EMailReader *parent)
+{
+ g_signal_emit_by_name (parent, "folder-loaded");
+}
+
+static void
mail_notebook_view_set_folder (EMailReader *reader,
CamelFolder *folder,
const gchar *folder_uri)
@@ -244,11 +268,18 @@ mail_notebook_view_set_folder (EMailReader *reader,
int page;
new_view = e_mail_paned_view_new (E_MAIL_VIEW(reader)->content);
+ priv->current_view = (EMailView *)new_view;
gtk_widget_show (new_view);
page = gtk_notebook_append_page (priv->book, new_view, gtk_label_new (camel_folder_get_full_name(folder)));
e_mail_reader_set_folder (E_MAIL_READER(new_view), folder, folder_uri);
gtk_notebook_set_current_page (priv->book, page);
g_hash_table_insert (priv->views, g_strdup(folder_uri), new_view);
+ g_signal_connect ( E_MAIL_READER(new_view), "changed",
+ G_CALLBACK (reconnect_changed_event),
+ reader);
+ g_signal_connect ( E_MAIL_READER (new_view), "folder-loaded",
+ G_CALLBACK (reconnect_folder_loaded_event),
+ reader);
}
}
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 71e049bade..a9ff239dd4 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -3001,9 +3001,45 @@ e_mail_reader_init (EMailReader *reader)
void
e_mail_reader_init_private (EMailReader *reader)
{
+ EMFormatHTML *formatter;
+ EWebView *web_view;
+ GtkWidget *message_list;
+
+ g_return_if_fail (E_IS_MAIL_READER (reader));
+
+ formatter = e_mail_reader_get_formatter (reader);
+ message_list = e_mail_reader_get_message_list (reader);
+
+ web_view = em_format_html_get_web_view (formatter);
quark_private = g_quark_from_static_string ("EMailReader-private");
+ /* Connect signals. */
+
+ g_signal_connect_swapped (
+ web_view, "key-press-event",
+ G_CALLBACK (mail_reader_key_press_event_cb), reader);
+
+ g_signal_connect_swapped (
+ message_list, "message-selected",
+ G_CALLBACK (mail_reader_message_selected_cb), reader);
+
+ g_signal_connect_swapped (
+ message_list, "message-list-built",
+ G_CALLBACK (mail_reader_emit_folder_loaded), reader);
+
+ g_signal_connect_swapped (
+ message_list, "double-click",
+ G_CALLBACK (mail_reader_double_click_cb), reader);
+
+ g_signal_connect_swapped (
+ message_list, "key-press",
+ G_CALLBACK (mail_reader_key_press_cb), reader);
+
+ g_signal_connect_swapped (
+ message_list, "selection-change",
+ G_CALLBACK (e_mail_reader_changed), reader);
+
g_object_set_qdata_full (
G_OBJECT (reader), quark_private,
g_slice_new0 (EMailReaderPrivate),
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index 3cdcee2d01..acc2e4906d 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -70,6 +70,18 @@ mail_shell_content_dispose (GObject *object)
}
static void
+reconnect_changed_event (EMailReader *child, EMailReader *parent)
+{
+ g_signal_emit_by_name (parent, "changed");
+}
+
+static void
+reconnect_folder_loaded_event (EMailReader *child, EMailReader *parent)
+{
+ g_signal_emit_by_name (parent, "folder-loaded");
+}
+
+static void
mail_shell_content_constructed (GObject *object)
{
EMailShellContentPrivate *priv;
@@ -98,6 +110,12 @@ mail_shell_content_constructed (GObject *object)
E_MAIL_SHELL_CONTENT(object)->view = (EMailView *)widget;
gtk_container_add (GTK_CONTAINER (container), widget);
gtk_widget_show (widget);
+ g_signal_connect ( E_MAIL_READER(widget), "changed",
+ G_CALLBACK (reconnect_changed_event),
+ object);
+ g_signal_connect ( E_MAIL_READER (widget), "folder-loaded",
+ G_CALLBACK (reconnect_folder_loaded_event),
+ object);
}