From 582ec45a59973e3beed7370c3476edaeb16c9eac Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 14 Apr 2009 19:03:37 +0000 Subject: Make the selected attachment view and file chooser folder persistent. svn path=/branches/kill-bonobo/; revision=37523 --- widgets/misc/e-attachment-paned.c | 14 ++++++++++++++ widgets/misc/e-attachment-store.c | 14 ++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'widgets') diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c index 9502f41296..a09fef0a66 100644 --- a/widgets/misc/e-attachment-paned.c +++ b/widgets/misc/e-attachment-paned.c @@ -22,7 +22,10 @@ #include "e-attachment-paned.h" #include + #include "e-util/e-binding.h" +#include "e-util/gconf-bridge.h" + #include "e-attachment-view.h" #include "e-attachment-store.h" #include "e-attachment-icon-view.h" @@ -272,9 +275,15 @@ static void attachment_paned_constructed (GObject *object) { EAttachmentPanedPrivate *priv; + GConfBridge *bridge; + const gchar *key; priv = E_ATTACHMENT_PANED_GET_PRIVATE (object); + bridge = gconf_bridge_get (); + + /* Set up property-to-property bindings. */ + e_mutual_binding_new ( G_OBJECT (object), "active-view", G_OBJECT (priv->combo_box), "active"); @@ -302,6 +311,11 @@ attachment_paned_constructed (GObject *object) e_mutual_binding_new ( G_OBJECT (object), "expanded", G_OBJECT (priv->notebook), "visible"); + + /* Set up property-to-GConf bindings. */ + + key = "/apps/evolution/shell/attachment_view"; + gconf_bridge_bind_property (bridge, key, object, "active-view"); } static EAttachmentViewPrivate * diff --git a/widgets/misc/e-attachment-store.c b/widgets/misc/e-attachment-store.c index 4a74bab915..0b6e5a2baa 100644 --- a/widgets/misc/e-attachment-store.c +++ b/widgets/misc/e-attachment-store.c @@ -27,6 +27,7 @@ #include "e-util/e-util.h" #include "e-util/e-mktemp.h" +#include "e-util/gconf-bridge.h" #define E_ATTACHMENT_STORE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -133,6 +134,18 @@ attachment_store_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } +static void +attachment_store_constructed (GObject *object) +{ + GConfBridge *bridge; + const gchar *key; + + bridge = gconf_bridge_get (); + + key = "/apps/evolution/shell/current_folder"; + gconf_bridge_bind_property (bridge, key, object, "current-folder"); +} + static void attachment_store_class_init (EAttachmentStoreClass *class) { @@ -146,6 +159,7 @@ attachment_store_class_init (EAttachmentStoreClass *class) object_class->get_property = attachment_store_get_property; object_class->dispose = attachment_store_dispose; object_class->finalize = attachment_store_finalize; + object_class->constructed = attachment_store_constructed; g_object_class_install_property ( object_class, -- cgit v1.2.3