From b06cdfab92313ca7b1ce9a88ccb0ffba33cb17ab Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 19 Nov 2008 01:39:19 +0000 Subject: Progress update: - Tighter integration of GalViewInstance and EShellView. - EBinding. Stolen from ExoBinding. Lets you bind GObject properties together to automatically keep their values in sync. This is a godsend. Added to e-util, but might even deserve a place in libedataserver. - EShellSettings. This is the concept I blogged about. Already started ripping apart em-mailer-prefs.c. Others to follow. Any place where we're monitoring GConf keys is a target. - Incremental progress on the calender and mailer. Got EMFolderView somewhat working, but I think I'll be killing off EMFolderBrowser. svn path=/branches/kill-bonobo/; revision=36795 --- shell/e-shell-view.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'shell/e-shell-view.c') diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 3ab67b6ab0..9c5ff2b8bb 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -110,6 +110,17 @@ shell_view_init_view_collection (EShellViewClass *shell_view_class) * add the appropriate factories to the view collection. */ } +static void +shell_view_update_view_id (EShellView *shell_view, + GalViewInstance *view_instance) +{ + gchar *view_id; + + view_id = gal_view_instance_get_current_view_id (view_instance); + e_shell_view_set_view_id (shell_view, view_id); + g_free (view_id); +} + static void shell_view_emit_toggled (EShellView *shell_view) { @@ -967,3 +978,35 @@ e_shell_view_show_popup_menu (EShellView *shell_view, GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time ()); } + +/** + * e_shell_view_new_view_instance: + * @shell_view: an #EShellView + * @instance_id: a name for the #GalViewInstance + * + * Creates a new #GalViewInstance and configures it to keep + * @shell_view's #EShellView:view-id property up-to-date. + * + * Returns: a new #GalViewInstance + **/ +GalViewInstance * +e_shell_view_new_view_instance (EShellView *shell_view, + const gchar *instance_id) +{ + EShellViewClass *shell_view_class; + GalViewCollection *view_collection; + GalViewInstance *view_instance; + + g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL); + + shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); + + view_collection = shell_view_class->view_collection; + view_instance = gal_view_instance_new (view_collection, instance_id); + + g_signal_connect_swapped ( + view_instance, "changed", + G_CALLBACK (shell_view_update_view_id), shell_view); + + return view_instance; +} -- cgit v1.2.3