From 7b89c91ebb199004e169a1a7162b3ce4cf893042 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Wed, 25 Nov 1998 03:29:23 +0000 Subject: [PATCH] 1998-11-24 Federico Mena Quintero * gdesktop.c (desktop_icon_info_event): Run the popup menu for the icons in the desktop. * gpopup.[ch]: New files that take care of the popup menus for files in the desktop and in the panels. * Makefile.in: Added gpopup.[ch] to the list of sources. --- gnome/ChangeLog | 10 +++++ gnome/Makefile.in | 95 ++++++++++++++++++++++++----------------------- gnome/gdesktop.c | 9 ++++- 3 files changed, 66 insertions(+), 48 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 668b52fa9..ad64756c9 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,13 @@ +1998-11-24 Federico Mena Quintero + + * gdesktop.c (desktop_icon_info_event): Run the popup menu for the + icons in the desktop. + + * gpopup.[ch]: New files that take care of the popup menus for + files in the desktop and in the panels. + + * Makefile.in: Added gpopup.[ch] to the list of sources. + 1998-11-23 Federico Mena Quintero * gdesktop.c (desktop_icon_info_place): Save the icon position diff --git a/gnome/Makefile.in b/gnome/Makefile.in index 60e00d5e9..5d87df2a6 100644 --- a/gnome/Makefile.in +++ b/gnome/Makefile.in @@ -15,49 +15,51 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ GNOMESRCS = \ + gblist.c \ + gcache.c \ + gcliplabel.c \ + gcmd.c \ gdesktop-icon.c \ - gdnd.c \ - gkey.c \ - gmain.c \ - gmetadata.c \ - gscreen.c \ - gwidget.c \ - gmenu.c \ - ginfo.c \ - ghelp.c \ - glayout.c \ - gtools.c \ gdesktop.c \ + gdnd.c \ + ghelp.c \ + ginfo.c \ + gkey.c \ + glayout.c \ + gmain.c \ + gmc-chargrid.c \ + gmenu.c \ + gmetadata.c \ + gpageprop.c \ + gpopup.c \ + gprop.c \ + gscreen.c \ + gtools.c \ gutil.c \ gview.c \ - gcmd.c \ - gprop.c \ - gmc-chargrid.c \ - gpageprop.c \ - gcliplabel.c \ - gcache.c \ - gblist.c + gwidget.c GNOMEHDRS = \ + gblist.h \ + gcache.h \ + gcliplabel.h \ + gcmd.h \ + gconf.h \ gdesktop-icon.h \ + gdesktop.h \ gdnd.h \ gmain.h \ - gmetadata.h \ - gscreen.h \ - gwidget.h \ - gdesktop.h \ - gconf.h \ - gcmd.h \ - gprop.h \ - gpageprop.h \ gmc-chargrid.h \ - gcliplabel.h \ - gcache.h \ - gblist.h + gmetadata.h \ + gpageprop.h \ + gpopup.h \ + gprop.h \ + gscreen.h \ + gwidget.h -ICONS = \ +ICONS = \ directory.xpm \ - i-directory.png \ + i-directory.png \ i-executable.png \ i-symlink.png \ i-device.png \ @@ -84,28 +86,29 @@ OOBJS = main.o dlg.o screen.o widget.o wtools.o info.o boxes.o \ option.o cmd.o utilunix.o xslint.o OBJS = $(LOBJS) $(OOBJS) \ + gblist.o \ + gcache.o \ + gcliplabel.o \ + gcmd.o \ gdesktop-icon.o \ + gdesktop.o \ gdnd.o \ - gkey.o \ - gmain.o \ - gmetadata.o \ - gscreen.o \ - gwidget.o \ - gmenu.o \ ghelp.o \ ginfo.o \ + gkey.o \ glayout.o \ - gtools.o \ - gdesktop.o \ - gutil.o \ - gcmd.o \ + gmain.o \ gmc-chargrid.o \ - gview.o \ - gprop.o \ + gmenu.o \ + gmetadata.o \ gpageprop.o \ - gcliplabel.o \ - gcache.o \ - gblist.o + gpopup.o \ + gprop.o \ + gscreen.o \ + gtools.o \ + gutil.o \ + gview.o \ + gwidget.o # # Distribution variables diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index 65c5c1717..0202e5e63 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -33,6 +33,7 @@ #include "gdesktop.h" #include "gdesktop-icon.h" #include "gmetadata.h" +#include "gpopup.h" #include "../vfs/vfs.h" @@ -335,6 +336,7 @@ static gint desktop_icon_info_event (struct desktop_icon_info *dii, GdkEvent *event, int on_text) { int retval; + char *filename; retval = FALSE; @@ -343,8 +345,11 @@ desktop_icon_info_event (struct desktop_icon_info *dii, GdkEvent *event, int on_ if ((event->button.button == 1) && !(on_text && dii->selected)) { select_icon (dii, (GdkEventButton *) event); retval = TRUE; - } else if (event->button.button == 3) - retval = TRUE; /* FIXME: display menu */ + } else if (event->button.button == 3) { + filename = g_concat_dir_and_file (desktop_directory, dii->filename); + gpopup_do_popup (filename, FALSE, (GdkEventButton *) event); + retval = TRUE; + } break;