60 |
{ |
{ |
61 |
self = [super init]; |
self = [super init]; |
62 |
if (self) { |
if (self) { |
|
#ifdef GNUSTEP |
|
|
Class gwclass = [[NSBundle mainBundle] principalClass]; |
|
|
#else |
|
|
Class gwclass = [[NSBundle mainBundle] classNamed: @"GWorkspace"]; |
|
|
#endif |
|
63 |
NSString *defApp = nil, *t = nil; |
NSString *defApp = nil, *t = nil; |
64 |
|
|
|
gworkspace = (id<GWProtocol>)[gwclass gworkspace]; |
|
|
|
|
65 |
ASSIGN (path, apath); |
ASSIGN (path, apath); |
66 |
[self setDelegate: adelegate]; |
[self setDelegate: adelegate]; |
67 |
|
|
77 |
application: &defApp |
application: &defApp |
78 |
type: &t]; |
type: &t]; |
79 |
ASSIGN (type, t); |
ASSIGN (type, t); |
80 |
isPakage = [gworkspace isPakageAtPath: path]; |
isPakage = [GWLib isPakageAtPath: path]; |
81 |
|
|
82 |
ASSIGN (icon, [gworkspace smallIconForFile: path]); |
ASSIGN (icon, [GWLib smallIconForFile: path]); |
83 |
ASSIGN (highlight, [NSImage imageNamed: @"SmallCellHighlight.tiff"]); |
ASSIGN (highlight, [NSImage imageNamed: @"SmallCellHighlight.tiff"]); |
84 |
|
|
85 |
namelabel = [[SmallIconLabel alloc] initForIcon: self]; |
namelabel = [[SmallIconLabel alloc] initForIcon: self]; |
119 |
NSString *defApp = nil, *t = nil; |
NSString *defApp = nil, *t = nil; |
120 |
|
|
121 |
ASSIGN (path, apath); |
ASSIGN (path, apath); |
122 |
ASSIGN (icon, [gworkspace smallIconForFile: path]); |
ASSIGN (icon, [GWLib smallIconForFile: path]); |
123 |
|
|
124 |
[[NSWorkspace sharedWorkspace] getInfoForFile: path |
[[NSWorkspace sharedWorkspace] getInfoForFile: path |
125 |
application: &defApp |
application: &defApp |
126 |
type: &t]; |
type: &t]; |
127 |
ASSIGN (type, t); |
ASSIGN (type, t); |
128 |
isPakage = [gworkspace isPakageAtPath: path]; |
isPakage = [GWLib isPakageAtPath: path]; |
129 |
ASSIGN (name, [path lastPathComponent]); |
ASSIGN (name, [path lastPathComponent]); |
130 |
[namelabel setStringValue: name]; |
[namelabel setStringValue: name]; |
131 |
[self setLabelFrame]; |
[self setLabelFrame]; |
542 |
if ([selection count] > 1) { |
if ([selection count] > 1) { |
543 |
dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"]; |
dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"]; |
544 |
} else { |
} else { |
545 |
dragIcon = [gworkspace iconForFile: path ofType: type]; |
dragIcon = [GWLib iconForFile: path ofType: type]; |
546 |
} |
} |
547 |
|
|
548 |
[self dragImage: dragIcon |
[self dragImage: dragIcon |
551 |
event: event |
event: event |
552 |
pasteboard: pb |
pasteboard: pb |
553 |
source: self |
source: self |
554 |
slideBack: [gworkspace animateSlideBack]]; |
slideBack: [[GWLib workspaceApp] animateSlideBack]]; |
555 |
} |
} |
556 |
|
|
557 |
- (void)draggedImage:(NSImage *)anImage |
- (void)draggedImage:(NSImage *)anImage |
713 |
if(isDragTarget == YES) { |
if(isDragTarget == YES) { |
714 |
isDragTarget = NO; |
isDragTarget = NO; |
715 |
if (onSelf == NO) { |
if (onSelf == NO) { |
716 |
ASSIGN (icon, [gworkspace smallIconForFile: path]); |
ASSIGN (icon, [GWLib smallIconForFile: path]); |
717 |
[self setNeedsDisplay: YES]; |
[self setNeedsDisplay: YES]; |
718 |
} |
} |
719 |
onSelf = NO; |
onSelf = NO; |
752 |
return; |
return; |
753 |
} |
} |
754 |
|
|
755 |
ASSIGN (icon, [gworkspace smallIconForFile: path]); |
ASSIGN (icon, [GWLib smallIconForFile: path]); |
756 |
[self setNeedsDisplay: YES]; |
[self setNeedsDisplay: YES]; |
757 |
|
|
758 |
sourceDragMask = [sender draggingSourceOperationMask]; |
sourceDragMask = [sender draggingSourceOperationMask]; |
760 |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
761 |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
762 |
|
|
763 |
trashPath = [gworkspace trashPath]; |
trashPath = [[GWLib workspaceApp] trashPath]; |
764 |
|
|
765 |
if ([source isEqualToString: trashPath]) { |
if ([source isEqualToString: trashPath]) { |
766 |
operation = GWorkspaceRecycleOutOperation; |
operation = GWorkspaceRecycleOutOperation; |
785 |
[opDict setObject: path forKey: @"destination"]; |
[opDict setObject: path forKey: @"destination"]; |
786 |
[opDict setObject: files forKey: @"files"]; |
[opDict setObject: files forKey: @"files"]; |
787 |
|
|
788 |
[gworkspace performFileOperationWithDictionary: opDict]; |
[[GWLib workspaceApp] performFileOperationWithDictionary: opDict]; |
789 |
} |
} |
790 |
|
|
791 |
@end |
@end |