59 |
{ |
{ |
60 |
self = [super init]; |
self = [super init]; |
61 |
if (self) { |
if (self) { |
|
#ifdef GNUSTEP |
|
|
Class gwclass = [[NSBundle mainBundle] principalClass]; |
|
|
#else |
|
|
Class gwclass = [[NSBundle mainBundle] classNamed: @"GWorkspace"]; |
|
|
#endif |
|
62 |
NSString *defApp = nil, *t = nil; |
NSString *defApp = nil, *t = nil; |
63 |
NSFont *font; |
NSFont *font; |
64 |
|
|
|
gworkspace = (id<GWProtocol>)[gwclass gworkspace]; |
|
65 |
fm = [NSFileManager defaultManager]; |
fm = [NSFileManager defaultManager]; |
66 |
|
|
67 |
ASSIGN (path, apath); |
ASSIGN (path, apath); |
79 |
application: &defApp |
application: &defApp |
80 |
type: &t]; |
type: &t]; |
81 |
ASSIGN (type, t); |
ASSIGN (type, t); |
82 |
isPakage = [gworkspace isPakageAtPath: path]; |
isPakage = [GWLib isPakageAtPath: path]; |
83 |
ASSIGN (icon, [gworkspace iconForFile: path ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: path ofType: type]); |
84 |
ASSIGN (highlight, [NSImage imageNamed: @"CellHighlight.tiff"]); |
ASSIGN (highlight, [NSImage imageNamed: @"CellHighlight.tiff"]); |
85 |
|
|
86 |
namelabel = [NSTextField new]; |
namelabel = [NSTextField new]; |
109 |
|
|
110 |
ASSIGN (path, apath); |
ASSIGN (path, apath); |
111 |
ASSIGN (name, [path lastPathComponent]); |
ASSIGN (name, [path lastPathComponent]); |
112 |
ASSIGN (icon, [gworkspace iconForFile: path ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: path ofType: type]); |
113 |
|
|
114 |
[[NSWorkspace sharedWorkspace] getInfoForFile: path |
[[NSWorkspace sharedWorkspace] getInfoForFile: path |
115 |
application: &defApp |
application: &defApp |
150 |
|
|
151 |
- (void)renewIcon |
- (void)renewIcon |
152 |
{ |
{ |
153 |
ASSIGN (icon, [gworkspace iconForFile: path ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: path ofType: type]); |
154 |
[self setNeedsDisplay: YES]; |
[self setNeedsDisplay: YES]; |
155 |
} |
} |
156 |
|
|
346 |
if ([selection count] > 1) { |
if ([selection count] > 1) { |
347 |
dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"]; |
dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"]; |
348 |
} else { |
} else { |
349 |
dragIcon = [gworkspace iconForFile: path ofType: type]; |
dragIcon = [GWLib iconForFile: path ofType: type]; |
350 |
} |
} |
351 |
|
|
352 |
[self dragImage: dragIcon |
[self dragImage: dragIcon |
355 |
event: event |
event: event |
356 |
pasteboard: pb |
pasteboard: pb |
357 |
source: self |
source: self |
358 |
slideBack: [gworkspace animateSlideBack]]; |
slideBack: [[GWLib workspaceApp] animateSlideBack]]; |
359 |
} |
} |
360 |
|
|
361 |
- (void)draggedImage:(NSImage *)anImage |
- (void)draggedImage:(NSImage *)anImage |
514 |
if(isDragTarget == YES) { |
if(isDragTarget == YES) { |
515 |
isDragTarget = NO; |
isDragTarget = NO; |
516 |
if (onSelf == NO) { |
if (onSelf == NO) { |
517 |
ASSIGN (icon, [gworkspace iconForFile: path ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: path ofType: type]); |
518 |
[self setNeedsDisplay: YES]; |
[self setNeedsDisplay: YES]; |
519 |
} |
} |
520 |
onSelf = NO; |
onSelf = NO; |
553 |
return; |
return; |
554 |
} |
} |
555 |
|
|
556 |
ASSIGN (icon, [gworkspace iconForFile: path ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: path ofType: type]); |
557 |
[self setNeedsDisplay: YES]; |
[self setNeedsDisplay: YES]; |
558 |
|
|
559 |
sourceDragMask = [sender draggingSourceOperationMask]; |
sourceDragMask = [sender draggingSourceOperationMask]; |
561 |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
562 |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
563 |
|
|
564 |
trashPath = [gworkspace trashPath]; |
trashPath = [[GWLib workspaceApp] trashPath]; |
565 |
|
|
566 |
if ([source isEqualToString: trashPath]) { |
if ([source isEqualToString: trashPath]) { |
567 |
operation = GWorkspaceRecycleOutOperation; |
operation = GWorkspaceRecycleOutOperation; |
586 |
[opDict setObject: path forKey: @"destination"]; |
[opDict setObject: path forKey: @"destination"]; |
587 |
[opDict setObject: files forKey: @"files"]; |
[opDict setObject: files forKey: @"files"]; |
588 |
|
|
589 |
[gworkspace performFileOperationWithDictionary: opDict]; |
[[GWLib workspaceApp] performFileOperationWithDictionary: opDict]; |
590 |
} |
} |
591 |
|
|
592 |
@end |
@end |