1
1

1999-02-26 Miguel de Icaza <miguel@nuclecu.unam.mx>

* 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.
Этот коммит содержится в:
Miguel de Icaza 1999-02-27 00:04:40 +00:00
родитель 50d9d2c006
Коммит cf5ce5b680
4 изменённых файлов: 64 добавлений и 8 удалений

Просмотреть файл

@ -1,5 +1,11 @@
1999-02-26 Miguel de Icaza <miguel@nuclecu.unam.mx>
* 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.

Просмотреть файл

@ -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

Просмотреть файл

@ -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);

Просмотреть файл

@ -7,6 +7,7 @@
*/
#include <config.h>
#include <stdio.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
@ -64,7 +65,6 @@ void free (void *ptr);
#endif
#ifdef MOUNTED_VMOUNT /* AIX. */
#include <stdio.h>
#include <fshelp.h>
#include <sys/vfs.h>
#endif