84 |
{ |
{ |
85 |
self = [super initWithFrame: NSZeroRect]; |
self = [super initWithFrame: NSZeroRect]; |
86 |
if (self) { |
if (self) { |
|
#ifdef GNUSTEP |
|
|
Class gwclass = [[NSBundle mainBundle] principalClass]; |
|
|
#else |
|
|
Class gwclass = [[NSBundle mainBundle] classNamed: @"GWorkspace"]; |
|
|
#endif |
|
|
|
|
|
gworkspace = (id<GWProtocol>)[gwclass gworkspace]; |
|
|
|
|
87 |
ASSIGN (currentPath, path); |
ASSIGN (currentPath, path); |
88 |
[self setDelegate: adelegate]; |
[self setDelegate: adelegate]; |
89 |
|
|
101 |
lastKeyPressed = 0.; |
lastKeyPressed = 0.; |
102 |
charBuffer = nil; |
charBuffer = nil; |
103 |
|
|
104 |
contestualMenu = [gworkspace usesContestualMenu]; |
contestualMenu = [[GWLib workspaceApp] usesContestualMenu]; |
105 |
|
|
106 |
[self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]]; |
[self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]]; |
107 |
|
|
205 |
} else { |
} else { |
206 |
hiddenFiles = nil; |
hiddenFiles = nil; |
207 |
} |
} |
208 |
hideSysFiles = [gworkspace hideSysFiles]; |
hideSysFiles = [GWLib hideSysFiles]; |
209 |
|
|
210 |
if (hiddenFiles != nil || hideSysFiles) { |
if (hiddenFiles != nil || hideSysFiles) { |
211 |
NSMutableArray *mutableFiles = AUTORELEASE ([files mutableCopy]); |
NSMutableArray *mutableFiles = AUTORELEASE ([files mutableCopy]); |
253 |
|
|
254 |
[icons removeAllObjects]; |
[icons removeAllObjects]; |
255 |
|
|
256 |
files = [gworkspace sortedDirectoryContentsAtPath: currentPath]; |
files = [GWLib sortedDirectoryContentsAtPath: currentPath]; |
257 |
files = [gworkspace checkHiddenFiles: files atPath: currentPath]; |
files = [GWLib checkHiddenFiles: files atPath: currentPath]; |
258 |
|
|
259 |
count = [files count]; |
count = [files count]; |
260 |
if (count == 0) { |
if (count == 0) { |
273 |
NSString *ipath = [paths objectAtIndex: i]; |
NSString *ipath = [paths objectAtIndex: i]; |
274 |
SmallIcon *icon = [[SmallIcon alloc] initForPath: ipath delegate: self]; |
SmallIcon *icon = [[SmallIcon alloc] initForPath: ipath delegate: self]; |
275 |
|
|
276 |
[icon setLocked: [gworkspace isLockedPath: ipath]]; |
[icon setLocked: [GWLib isLockedPath: ipath]]; |
277 |
[icons addObject: icon]; |
[icons addObject: icon]; |
278 |
RELEASE (icon); |
RELEASE (icon); |
279 |
} |
} |
292 |
- (void)sortIcons |
- (void)sortIcons |
293 |
{ |
{ |
294 |
NSMutableDictionary *sortDict = [NSMutableDictionary dictionaryWithCapacity: 1]; |
NSMutableDictionary *sortDict = [NSMutableDictionary dictionaryWithCapacity: 1]; |
295 |
int stype = [gworkspace sortTypeForDirectoryAtPath: currentPath]; |
int stype = [GWLib sortTypeForDirectoryAtPath: currentPath]; |
296 |
|
|
297 |
[sortDict setObject: currentPath forKey: @"path"]; |
[sortDict setObject: currentPath forKey: @"path"]; |
298 |
[sortDict setObject: [NSString stringWithFormat: @"%i", stype] forKey: @"type"]; |
[sortDict setObject: [NSString stringWithFormat: @"%i", stype] forKey: @"type"]; |
755 |
|
|
756 |
- (void)openSelectionWith:(id)sender |
- (void)openSelectionWith:(id)sender |
757 |
{ |
{ |
758 |
[gworkspace openSelectedPathsWith]; |
[[GWLib workspaceApp] openSelectedPathsWith]; |
759 |
} |
} |
760 |
|
|
761 |
- (void)addIconWithPath:(NSString *)iconpath dimmed:(BOOL)isdimmed; |
- (void)addIconWithPath:(NSString *)iconpath dimmed:(BOOL)isdimmed; |
782 |
NSString *s = [iconpaths objectAtIndex: i]; |
NSString *s = [iconpaths objectAtIndex: i]; |
783 |
SmallIcon *icon = [[SmallIcon alloc] initForPath: s delegate: self]; |
SmallIcon *icon = [[SmallIcon alloc] initForPath: s delegate: self]; |
784 |
|
|
785 |
[icon setLocked: [gworkspace isLockedPath: s]]; |
[icon setLocked: [GWLib isLockedPath: s]]; |
786 |
|
|
787 |
[icons addObject: icon]; |
[icons addObject: icon]; |
788 |
[self addSubview: icon]; |
[self addSubview: icon]; |
1510 |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
1511 |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
1512 |
|
|
1513 |
trashPath = [gworkspace trashPath]; |
trashPath = [[GWLib workspaceApp] trashPath]; |
1514 |
if ([source isEqualToString: trashPath]) { |
if ([source isEqualToString: trashPath]) { |
1515 |
operation = GWorkspaceRecycleOutOperation; |
operation = GWorkspaceRecycleOutOperation; |
1516 |
} else { |
} else { |
1534 |
[opDict setObject: currentPath forKey: @"destination"]; |
[opDict setObject: currentPath forKey: @"destination"]; |
1535 |
[opDict setObject: files forKey: @"files"]; |
[opDict setObject: files forKey: @"files"]; |
1536 |
|
|
1537 |
[gworkspace performFileOperationWithDictionary: opDict]; |
[[GWLib workspaceApp] performFileOperationWithDictionary: opDict]; |
1538 |
} |
} |
1539 |
|
|
1540 |
@end |
@end |