1998-12-07 Miguel de Icaza <miguel@nuclecu.unam.mx>

* 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.
This commit is contained in:
Miguel de Icaza 1998-12-11 01:57:01 +00:00
parent d09470310a
commit 771413102b
6 changed files with 82 additions and 4 deletions

View File

@ -1,3 +1,11 @@
1998-12-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
* 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 <federico@nuclecu.unam.mx>
* gdesktop.c: Moved the old DnD cruft to olddnd.c to keep it there

View File

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

View File

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

View File

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

BIN
gnome/i-dirclosed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

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