aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
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 /addressbook
parent7d6027be1a9989549c80fdbe6dcf8317c54a6a6a (diff)
downloadgsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.gz
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 'addressbook')
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 763ff87268..3d13a54e14 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -392,9 +392,11 @@ addressbook_view_create_minicard_view (EAddressbookView *view,
}
static void
-addressbook_view_display_view_cb (EAddressbookView *view,
- GalView *gal_view)
+addressbook_view_display_view_cb (GalViewInstance *view_instance,
+ GalView *gal_view,
+ EAddressbookView *view)
{
+ EShellView *shell_view;
GtkWidget *child;
child = gtk_bin_get_child (GTK_BIN (view));
@@ -409,6 +411,9 @@ addressbook_view_display_view_cb (EAddressbookView *view,
addressbook_view_create_minicard_view (
view, GAL_VIEW_MINICARD (gal_view));
+ shell_view = e_addressbook_view_get_shell_view (view);
+ e_shell_view_set_view_instance (shell_view, view_instance);
+
command_state_change (view);
}
@@ -592,7 +597,7 @@ addressbook_view_constructed (GObject *object)
view->priv->model = e_addressbook_model_new (client_cache);
view_instance = e_shell_view_new_view_instance (shell_view, uid);
- g_signal_connect_swapped (
+ g_signal_connect (
view_instance, "display-view",
G_CALLBACK (addressbook_view_display_view_cb), view);
view->priv->view_instance = view_instance;