diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 5b17cbeab..9dfd23f64 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,11 @@ +1998-12-07 Miguel de Icaza + + * gicon.c (gnome_file_entry_color): If we do not have permissions + for this directory, indicate this with a special icon. + + * gscreen.c (panel_icon_list_select_icon): Middle button opens a + new panel on a directory. + 1998-12-08 Federico Mena Quintero * gdesktop.c: Moved the old DnD cruft to olddnd.c to keep it there diff --git a/gnome/Makefile.in b/gnome/Makefile.in index 2f9c01297..a78c211a5 100644 --- a/gnome/Makefile.in +++ b/gnome/Makefile.in @@ -26,6 +26,7 @@ PIXMAPS = \ dir-open.xpm GNOMESRCS = \ + gaction.c \ gblist.c \ gcache.c \ gcliplabel.c \ @@ -79,6 +80,7 @@ GNOMEHDRS = \ ICONS = \ directory.xpm \ + i-dirclosed.png \ i-directory.png \ i-executable.png \ i-symlink.png \ diff --git a/gnome/gicon.c b/gnome/gicon.c index df953d682..1b56d77f9 100644 --- a/gnome/gicon.c +++ b/gnome/gicon.c @@ -22,6 +22,7 @@ static int gicon_inited = FALSE; /* These are some default images used in the Icon View */ static GdkImlibImage *icon_view_directory; +static GdkImlibImage *icon_view_dirclosed; static GdkImlibImage *icon_view_executable; static GdkImlibImage *icon_view_symlink; static GdkImlibImage *icon_view_regular; @@ -31,6 +32,10 @@ static GdkImlibImage *icon_view_char_dev; static GdkImlibImage *icon_view_block_dev; static GdkImlibImage *icon_view_stalled; +/* Our UID and GID */ +static uid_t our_uid; +static gid_t our_gid; + /** * gicon_init: * @@ -45,8 +50,12 @@ gicon_init (void) icon_hash = g_hash_table_new (g_str_hash, g_str_equal); gicon_inited = TRUE; + our_uid = getuid (); + our_gid = getgid (); + /* Recursive call to load the stock images */ icon_view_directory = gicon_stock_load ("i-directory.png"); + icon_view_dirclosed = gicon_stock_load ("i-dirclosed.png"); icon_view_executable = gicon_stock_load ("i-executable.png"); icon_view_symlink = gicon_stock_load ("i-symlink.png"); icon_view_regular = gicon_stock_load ("i-regular.png"); @@ -57,6 +66,7 @@ gicon_init (void) icon_view_stalled = gicon_stock_load ("i-stalled.png"); if (icon_view_directory == NULL || + icon_view_dirclosed == NULL || icon_view_executable == NULL || icon_view_symlink == NULL || icon_view_regular == NULL || @@ -129,9 +139,35 @@ static GdkImlibImage * gnome_file_entry_color (file_entry *fe) { mode_t mode = fe->buf.st_mode; - - if (S_ISDIR (mode)) + + /* + * If a directory, choose the best icon that reprensents it + */ + if (S_ISDIR (mode)){ + if (fe->buf.st_uid != our_uid){ + if (fe->buf.st_gid != our_gid){ + + /* + * We do not share the UID or the GID, + * test for read/execute permissions + */ + if ((mode & (S_IROTH | S_IXOTH)) != (S_IROTH | S_IXOTH)) + return icon_view_dirclosed; + } else { + + /* + * Same group, check if we have permissions + */ + if ((mode & (S_IRGRP | S_IXGRP)) != (S_IRGRP | S_IXGRP)) + return icon_view_dirclosed; + } + } else { + if ((mode & (S_IRUSR | S_IXUSR)) != (S_IRUSR | S_IXUSR)) + return icon_view_dirclosed; + } + return icon_view_directory; + } if (S_ISLNK (mode)){ if (fe->f.link_to_dir) diff --git a/gnome/gview.c b/gnome/gview.c index 88736bcd9..c32bfce10 100644 --- a/gnome/gview.c +++ b/gnome/gview.c @@ -290,8 +290,8 @@ GnomeUIInfo gview_file_menu [] = { N_("Jump to a specified line number"), &gnome_goto_line, GNOME_STOCK_PIXMAP_JUMP_TO), GNOMEUIINFO_ITEM (N_("Monitor file"), N_("Monitor file growing"), &gnome_monitor, NULL), - GNOMEUIINFO_ITEM_STOCK (N_("Quit"), - N_("Terminate the viewer"), + GNOMEUIINFO_ITEM_STOCK (N_("Close"), + N_("Close the viewer"), &gview_quit, GNOME_STOCK_PIXMAP_QUIT), { GNOME_APP_UI_ENDOFINFO, 0, 0 } }; diff --git a/gnome/i-dirclosed.png b/gnome/i-dirclosed.png new file mode 100644 index 000000000..6a014c67e Binary files /dev/null and b/gnome/i-dirclosed.png differ diff --git a/gnome/mc.metadata.in b/gnome/mc.metadata.in index f89b5dadb..d978a738c 100644 --- a/gnome/mc.metadata.in +++ b/gnome/mc.metadata.in @@ -1,3 +1,35 @@ +# +# Default metadata file provided by the GNOME File Manaeger. +# +# The following metadata keys are used by the File Manager: +# +# icon-filename: +# Points to a full pathname that contains the icon that +# is bound to this file. +# +# icon-inline-png: +# If present, the value of this entry is an inlined PNG image +# that should be used to display this file. +# +# drop-open: +# Command to run when a file or files are dropped on this +# file. If value is not available, the file manager will try +# to use the contents of the 'open' key. +# +# open: +# Command to execute when the file is "opened". The same interpolation +# done for "drop-open" is done with "open". +# +# Interpolation for open and drop-open: +# Any ocurrence of the strings '%c'/%C '%f' are interpolated. +# with the drop site name (ie, the name of the file or executable where +# data was dropped) and the file or files that were dropped there +# respectively. The character "\" can be used to escape text. +# +# Execution is done without shell intervention, so no shell metacharacters +# are used. +# + regex: \.c$ type=x-application-gnome/c-source icon-filename=@icondir@/c.xpm