From 716a7195c0ba559bea3afe14117f8789a0a33872 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Fri, 16 Jan 2004 18:52:22 +0000 Subject: only set the menus and command state if we actually are already displayed, 2004-01-16 JP Rosevear * gui/component/addressbook.c (set_prop): only set the menus and command state if we actually are already displayed, otherwise wait for activation svn path=/trunk/; revision=24283 --- addressbook/gui/component/addressbook.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'addressbook/gui/component/addressbook.c') diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index a553a2641a..b317e46c12 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -950,9 +950,11 @@ set_prop (BonoboPropertyBag *bag, gtk_notebook_page_num (GTK_NOTEBOOK (view->notebook), uid_view)); - /* change menus/toolbars to reflect the new view */ - eab_view_setup_menus (EAB_VIEW (uid_view), bonobo_control_get_ui_component (view->control)); - update_command_state (EAB_VIEW (uid_view), view); + /* change menus/toolbars to reflect the new view, assuming we are already displayed */ + if (bonobo_ui_component_get_container (bonobo_control_get_ui_component (view->control)) != CORBA_OBJECT_NIL) { + eab_view_setup_menus (EAB_VIEW (uid_view), bonobo_control_get_ui_component (view->control)); + update_command_state (EAB_VIEW (uid_view), view); + } } else { g_warning ("Could not find source by UID '%s'!", uid); -- cgit v1.2.3