aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-04 23:04:51 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-06 04:40:48 +0800
commit31b5261fdbe2c98e7f4f71e908e5d9b58609de94 (patch)
treee9157fa12b3978c68492b04c10137c74eee21b17 /mail
parent7d6027be1a9989549c80fdbe6dcf8317c54a6a6a (diff)
downloadgsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar
gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.gz
gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.bz2
gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.lz
gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.xz
gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.zst
gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.zip
EShellView: Add a "view-instance" property.
EShellView now holds a reference to the active GalViewInstance. Where applicable, the EShellView subclass is responsible for keeping this up to date when the sidebar selection changes. Holding a reference allows EShellView to implement common actions like "Save Current View" directly instead pushing it on to subclasses. New functions: e_shell_view_get_view_instance e_shell_view_set_view_instance
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-paned-view.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index 41c98f0e23..e0c63992c8 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -246,12 +246,17 @@ mail_paned_view_restore_state_cb (EShellWindow *shell_window,
}
static void
-mail_paned_display_view_cb (EMailView *view,
- GalView *gal_view)
+mail_paned_display_view_cb (GalViewInstance *view_instance,
+ GalView *gal_view,
+ EMailView *view)
{
EMailReader *reader;
+ EShellView *shell_view;
GtkWidget *message_list;
+ shell_view = e_mail_view_get_shell_view (view);
+ e_shell_view_set_view_instance (shell_view, view_instance);
+
reader = E_MAIL_READER (view);
message_list = e_mail_reader_get_message_list (reader);
@@ -868,7 +873,7 @@ mail_paned_view_update_view_instance (EMailView *view)
shell_view, view_id);
}
- priv->view_instance = view_instance;
+ priv->view_instance = g_object_ref (view_instance);
orientable = GTK_ORIENTABLE (view);
orientation = gtk_orientable_get_orientation (orientable);
@@ -961,12 +966,16 @@ mail_paned_view_update_view_instance (EMailView *view)
g_free (state_filename);
}
- g_signal_connect_swapped (
+ g_signal_connect (
view_instance, "display-view",
G_CALLBACK (mail_paned_display_view_cb), view);
mail_paned_display_view_cb (
- view, gal_view_instance_get_current_view (view_instance));
+ view_instance,
+ gal_view_instance_get_current_view (view_instance),
+ view);
+
+ g_object_unref (view_instance);
g_clear_object (&folder);
}