New function to handle unmerging menus at control deactivation time. (d):
2002-02-07 Christopher James Lahey <clahey@ximian.com> * menus/gal-view-menus.c, menus/gal-view-menus.h (gal_view_menus_unmerge): New function to handle unmerging menus at control deactivation time. (d): Turned off debugging output here. (build_menus): Gave the separators names and marked them with f="" to make them work better with bonobo 1. svn path=/trunk/; revision=15599
This commit is contained in:

committed by
Chris Lahey

parent
ee74c23472
commit
757d9ab56d
@ -1,3 +1,12 @@
|
|||||||
|
2002-02-07 Christopher James Lahey <clahey@ximian.com>
|
||||||
|
|
||||||
|
* menus/gal-view-menus.c, menus/gal-view-menus.h
|
||||||
|
(gal_view_menus_unmerge): New function to handle unmerging menus
|
||||||
|
at control deactivation time.
|
||||||
|
(d): Turned off debugging output here.
|
||||||
|
(build_menus): Gave the separators names and marked them with f=""
|
||||||
|
to make them work better with bonobo 1.
|
||||||
|
|
||||||
2002-02-07 Christopher James Lahey <clahey@ximian.com>
|
2002-02-07 Christopher James Lahey <clahey@ximian.com>
|
||||||
|
|
||||||
* menus/gal-view-menus.c, menus/gal-view-menus.h
|
* menus/gal-view-menus.c, menus/gal-view-menus.h
|
||||||
|
@ -47,7 +47,8 @@ static void collection_changed (GalViewCollection *collection,
|
|||||||
static void instance_changed (GalViewInstance *instance,
|
static void instance_changed (GalViewInstance *instance,
|
||||||
GalViewMenus *gvm);
|
GalViewMenus *gvm);
|
||||||
|
|
||||||
#define d(x) x
|
#define d(x)
|
||||||
|
#define CURRENT_VIEW_PATH "/menu/View/ViewBegin/CurrentView"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
closure_free (void *data, void *user_data)
|
closure_free (void *data, void *user_data)
|
||||||
@ -137,10 +138,7 @@ gvm_destroy (GtkObject *object)
|
|||||||
|
|
||||||
remove_instance (gvm);
|
remove_instance (gvm);
|
||||||
|
|
||||||
if (gvm->priv->component) {
|
gal_view_menus_unmerge (gvm, NULL);
|
||||||
bonobo_object_unref (BONOBO_OBJECT (gvm->priv->component));
|
|
||||||
gvm->priv->component = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free(gvm->priv);
|
g_free(gvm->priv);
|
||||||
gvm->priv = NULL;
|
gvm->priv = NULL;
|
||||||
@ -313,6 +311,9 @@ build_menus(GalViewMenus *menus)
|
|||||||
if (id == NULL) {
|
if (id == NULL) {
|
||||||
|
|
||||||
menuitem = bonobo_ui_node_new_child(submenu, "separator");
|
menuitem = bonobo_ui_node_new_child(submenu, "separator");
|
||||||
|
bonobo_ui_node_set_attr(menuitem, "name", "GalView:first_sep");
|
||||||
|
bonobo_ui_node_set_attr(menuitem, "f", "");
|
||||||
|
|
||||||
|
|
||||||
menuitem = bonobo_ui_node_new_child(submenu, "menuitem");
|
menuitem = bonobo_ui_node_new_child(submenu, "menuitem");
|
||||||
bonobo_ui_node_set_attr(menuitem, "name", "custom_view");
|
bonobo_ui_node_set_attr(menuitem, "name", "custom_view");
|
||||||
@ -337,6 +338,8 @@ build_menus(GalViewMenus *menus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
menuitem = bonobo_ui_node_new_child(submenu, "separator");
|
menuitem = bonobo_ui_node_new_child(submenu, "separator");
|
||||||
|
bonobo_ui_node_set_attr(menuitem, "name", "GalView:second_sep");
|
||||||
|
bonobo_ui_node_set_attr(menuitem, "f", "");
|
||||||
|
|
||||||
menuitem = bonobo_ui_node_new_child(submenu, "menuitem");
|
menuitem = bonobo_ui_node_new_child(submenu, "menuitem");
|
||||||
bonobo_ui_node_set_attr(menuitem, "name", "DefineViews");
|
bonobo_ui_node_set_attr(menuitem, "name", "DefineViews");
|
||||||
@ -390,18 +393,13 @@ set_radio (GalViewMenus *gvm,
|
|||||||
g_free (id);
|
g_free (id);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CURRENT_VIEW_PATH "/menu/View/ViewBegin/CurrentView"
|
|
||||||
static void
|
static void
|
||||||
build_stuff (GalViewMenus *gvm,
|
build_stuff (GalViewMenus *gvm,
|
||||||
CORBA_Environment *ev)
|
CORBA_Environment *ev)
|
||||||
{
|
{
|
||||||
char *xml;
|
char *xml;
|
||||||
|
|
||||||
d(g_print ("%s:\n", __FUNCTION__));
|
gal_view_menus_unmerge (gvm, ev);
|
||||||
if (bonobo_ui_component_path_exists (gvm->priv->component, CURRENT_VIEW_PATH, ev)) {
|
|
||||||
d(g_print ("%s: Removing path\n", __FUNCTION__));
|
|
||||||
bonobo_ui_component_rm (gvm->priv->component, CURRENT_VIEW_PATH, ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
remove_listeners(gvm);
|
remove_listeners(gvm);
|
||||||
remove_xml(gvm);
|
remove_xml(gvm);
|
||||||
@ -417,7 +415,7 @@ build_stuff (GalViewMenus *gvm,
|
|||||||
void
|
void
|
||||||
gal_view_menus_apply (GalViewMenus *gvm,
|
gal_view_menus_apply (GalViewMenus *gvm,
|
||||||
BonoboUIComponent *component,
|
BonoboUIComponent *component,
|
||||||
CORBA_Environment *ev)
|
CORBA_Environment *opt_ev)
|
||||||
{
|
{
|
||||||
if (component != gvm->priv->component) {
|
if (component != gvm->priv->component) {
|
||||||
if (component)
|
if (component)
|
||||||
@ -429,8 +427,19 @@ gal_view_menus_apply (GalViewMenus *gvm,
|
|||||||
|
|
||||||
gvm->priv->component = component;
|
gvm->priv->component = component;
|
||||||
|
|
||||||
build_stuff (gvm, ev);
|
build_stuff (gvm, opt_ev);
|
||||||
set_radio (gvm, ev);
|
set_radio (gvm, opt_ev);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gal_view_menus_unmerge (GalViewMenus *gvm,
|
||||||
|
CORBA_Environment *opt_ev)
|
||||||
|
{
|
||||||
|
d(g_print ("%s:\n", __FUNCTION__));
|
||||||
|
if (bonobo_ui_component_path_exists (gvm->priv->component, CURRENT_VIEW_PATH, opt_ev)) {
|
||||||
|
d(g_print ("%s: Removing path\n", __FUNCTION__));
|
||||||
|
bonobo_ui_component_rm (gvm->priv->component, CURRENT_VIEW_PATH, opt_ev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -31,7 +31,9 @@ GalViewMenus *gal_view_menus_construct (GalViewMenus *menus,
|
|||||||
|
|
||||||
void gal_view_menus_apply (GalViewMenus *menus,
|
void gal_view_menus_apply (GalViewMenus *menus,
|
||||||
BonoboUIComponent *component,
|
BonoboUIComponent *component,
|
||||||
CORBA_Environment *ev);
|
CORBA_Environment *opt_ev);
|
||||||
|
void gal_view_menus_unmerge (GalViewMenus *gvm,
|
||||||
|
CORBA_Environment *opt_ev);
|
||||||
void gal_view_menus_set_instance (GalViewMenus *gvm,
|
void gal_view_menus_set_instance (GalViewMenus *gvm,
|
||||||
GalViewInstance *instance);
|
GalViewInstance *instance);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user