mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Workspace improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16694 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
412246997b
commit
a36ee5fb70
4 changed files with 32 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
|||
* Source/NSWorkspace.m: Add support for generic application icon.
|
||||
Reduce private method name pollution a little.
|
||||
* Images/common_UnknownApplication.tiff: copied from WM ...
|
||||
* Images/common_UnknownTool.tiff: similar image for unix cmd-line tools.
|
||||
|
||||
2003-05-05 Michael Hanni <michael@deviant-behavior.com>
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ common_WMClose.tiff \
|
|||
common_WMCloseBroken.tiff \
|
||||
common_Unknown.tiff \
|
||||
common_UnknownApplication.tiff \
|
||||
common_UnknownTool.tiff \
|
||||
common_Folder.tiff \
|
||||
common_Root_PC.tiff \
|
||||
common_Root_SGI.tiff \
|
||||
|
|
BIN
Images/common_UnknownTool.tiff
Normal file
BIN
Images/common_UnknownTool.tiff
Normal file
Binary file not shown.
|
@ -60,7 +60,8 @@ static NSImage *folderImage = nil;
|
|||
static NSImage *homeImage = nil;
|
||||
static NSImage *multipleFiles = nil;
|
||||
static NSImage *rootImage = nil;
|
||||
static NSImage *unknownApp = nil;
|
||||
static NSImage *unknownApplication = nil;
|
||||
static NSImage *unknownTool = nil;
|
||||
|
||||
|
||||
static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
|
||||
|
@ -931,6 +932,31 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
NSDebugLog(@"pathExtension is '%@'", pathExtension);
|
||||
|
||||
image = [self _iconForExtension: pathExtension];
|
||||
if (image == nil || image == [self unknownFiletypeImage])
|
||||
{
|
||||
NSFileManager *mgr;
|
||||
|
||||
mgr = [NSFileManager defaultManager];
|
||||
if ([mgr isExecutableFileAtPath: fullPath] == YES)
|
||||
{
|
||||
NSDictionary *attributes;
|
||||
NSString *fileType;
|
||||
|
||||
attributes = [mgr fileAttributesAtPath: fullPath
|
||||
traverseLink: YES];
|
||||
fileType = [attributes objectForKey: NSFileType];
|
||||
if ([fileType isEqual: NSFileTypeRegular] == YES)
|
||||
{
|
||||
if (unknownTool == nil)
|
||||
{
|
||||
unknownTool = RETAIN([self _getImageWithName:
|
||||
@"UnknownTool.tiff" alternate:
|
||||
@"common_UnknownTool.tiff"]);
|
||||
}
|
||||
image = unknownTool;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (image == nil)
|
||||
|
@ -1656,13 +1682,13 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
|| [ext isEqualToString: @"debug"] == YES
|
||||
|| [ext isEqualToString: @"profile"] == YES)
|
||||
{
|
||||
if (unknownApp == nil)
|
||||
if (unknownApplication == nil)
|
||||
{
|
||||
unknownApp = RETAIN([self _getImageWithName:
|
||||
unknownApplication = RETAIN([self _getImageWithName:
|
||||
@"UnknownApplication.tiff" alternate:
|
||||
@"common_UnknownApplication.tiff"]);
|
||||
}
|
||||
icon = unknownApp;
|
||||
icon = unknownApplication;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue