diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 85b2ef03d..6d8300a08 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,5 +1,11 @@ 1999-02-26 Miguel de Icaza + * glayout.c (my_app_create_menus): New function, used to create + our menus and set the realy properly, to make cpanel (ie, + current_panel) always consistent with what the user users. + + So, no need to kill the tearoff menus in gmc now. + * gmount.c (is_block_device_mountable): compare the device name here. diff --git a/gnome/Makefile.in b/gnome/Makefile.in index 1b5f8432c..242ea2419 100644 --- a/gnome/Makefile.in +++ b/gnome/Makefile.in @@ -175,14 +175,9 @@ CORBA_GENERATED = \ FileManager-skels.c \ FileManager-common.c -CORBA_SOURCES = \ - gcorba.c - $(CORBA_GENERATED): $(rootdir)/idl/FileManager.idl orbit-idl `gnome-config --cflags idl` $(rootdir)/idl/FileManager.idl -$(CORBA_SOURCES): $(CORBA_GENERATED) - FileManager-impl.c: FileManager.h EXTRA_DIST = gnome.TODO layout gmc.gnorba mc.keys.in.in gimp.image.desktop @@ -200,6 +195,8 @@ DISTGNOME = \ main-corba.o: main.c $(CC) -c -DHAVE_CORBA $(CPPFLAGS) $(DEFS) $(CFLAGS) $< -o main-corba.o +gcorba.o: gcorba.c $(CORBA_GENERATED) + all: @mx@ Makefile mc.keys Makefile: Makefile.in ../config.status diff --git a/gnome/glayout.c b/gnome/glayout.c index 991dbbf77..eb7bf5428 100644 --- a/gnome/glayout.c +++ b/gnome/glayout.c @@ -554,6 +554,55 @@ create_new_menu (GnomeApp *app, WPanel *panel) g_free (file2); } +/* + * This routine is a menu relay. + * + * This is called before the actual command specified in the GnomeUIInfo + * structure. This allows me to select the panel (ie, set the global cpanel + * variable to which this menu is bound). + * + * This is important, as we can have a menu tearoffed. And the current hack + * of setting cpanel on the focus-in event wont work. + * + */ +static void +panel_menu_relay (GtkObject *object, WPanel *panel) +{ + void (*real_func)(GtkObject *object, WPanel *panel); + + real_func = gtk_object_get_user_data (object); + set_current_panel (panel); + (*real_func)(object, panel); +} + +static void +my_menu_signal_connect (GnomeUIInfo *uiinfo, gchar *signal_name, + GnomeUIBuilderData *uibdata) +{ + gtk_object_set_user_data (GTK_OBJECT (uiinfo->widget), uiinfo->moreinfo); + gtk_signal_connect (GTK_OBJECT (uiinfo->widget), + signal_name, panel_menu_relay, uibdata->data ? + uibdata->data : uiinfo->user_data); +} + +static void +my_app_create_menus (GnomeApp *app, GnomeUIInfo *uiinfo, void *data) +{ + GnomeUIBuilderData uibdata; + + g_return_if_fail (app != NULL); + g_return_if_fail (GNOME_IS_APP (app)); + g_return_if_fail (uiinfo != NULL); + + uibdata.connect_func = my_menu_signal_connect; + uibdata.data = data; + uibdata.is_interp = FALSE; + uibdata.relay_func = NULL; + uibdata.destroy_func = NULL; + + gnome_app_create_menus_custom (app, uiinfo, &uibdata); +} + WPanel * create_container (Dlg_head *h, char *name, char *geometry) { @@ -561,6 +610,7 @@ create_container (Dlg_head *h, char *name, char *geometry) WPanel *panel; GtkWidget *app, *vbox; int xpos, ypos, width, height; + GnomeUIInfo *uiinfo; gnome_parse_geometry (geometry, &xpos, &ypos, &width, &height); @@ -584,9 +634,12 @@ create_container (Dlg_head *h, char *name, char *geometry) gnome_app_set_contents (GNOME_APP (app), vbox); if (desktop_wm_is_gnome_compliant == 1) - gnome_app_create_menus_with_data (GNOME_APP (app), gnome_panel_menu_without_desktop, panel); + uiinfo = gnome_panel_menu_without_desktop; else - gnome_app_create_menus_with_data (GNOME_APP (app), gnome_panel_menu_with_desktop, panel); + uiinfo = gnome_panel_menu_with_desktop; + + + my_app_create_menus (GNOME_APP (app), uiinfo, panel); create_new_menu (GNOME_APP (app), panel); diff --git a/gnome/gmount.c b/gnome/gmount.c index 3d6d0e9f1..bb2164c21 100644 --- a/gnome/gmount.c +++ b/gnome/gmount.c @@ -7,6 +7,7 @@ */ #include +#include #ifdef STDC_HEADERS #include @@ -64,7 +65,6 @@ void free (void *ptr); #endif #ifdef MOUNTED_VMOUNT /* AIX. */ -#include #include #include #endif