73 |
self = [super init]; |
self = [super init]; |
74 |
|
|
75 |
if (self) { |
if (self) { |
|
#ifdef GNUSTEP |
|
|
Class gwclass = [[NSBundle mainBundle] principalClass]; |
|
|
#else |
|
|
Class gwclass = [[NSBundle mainBundle] classNamed: @"GWorkspace"]; |
|
|
#endif |
|
|
|
|
|
gworkspace = (id<GWProtocol>)[gwclass gworkspace]; |
|
|
|
|
76 |
fm = [NSFileManager defaultManager]; |
fm = [NSFileManager defaultManager]; |
77 |
ws = [NSWorkspace sharedWorkspace]; |
ws = [NSWorkspace sharedWorkspace]; |
78 |
|
|
90 |
[namelabel setAlignment: NSCenterTextAlignment]; |
[namelabel setAlignment: NSCenterTextAlignment]; |
91 |
[namelabel setBackgroundColor: [NSColor windowBackgroundColor]]; |
[namelabel setBackgroundColor: [NSColor windowBackgroundColor]]; |
92 |
|
|
93 |
contestualMenu = [gworkspace usesContestualMenu]; |
contestualMenu = [[GWLib workspaceApp] usesContestualMenu]; |
94 |
|
|
95 |
hostname = nil; |
hostname = nil; |
96 |
isbranch = NO; |
isbranch = NO; |
146 |
} |
} |
147 |
[ws getInfoForFile: fullpath application: &defapp type: &t]; |
[ws getInfoForFile: fullpath application: &defapp type: &t]; |
148 |
ASSIGN (type, t); |
ASSIGN (type, t); |
149 |
isPakage = [gworkspace isPakageAtPath: fullpath]; |
isPakage = [GWLib isPakageAtPath: fullpath]; |
150 |
|
|
151 |
} else { |
} else { |
152 |
singlepath = NO; |
singlepath = NO; |
157 |
} |
} |
158 |
|
|
159 |
if (singlepath == YES) { |
if (singlepath == YES) { |
160 |
ASSIGN (icon, [gworkspace iconForFile: fullpath ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: fullpath ofType: type]); |
161 |
} else { |
} else { |
162 |
ASSIGN (icon, [NSImage imageNamed: @"MultipleSelection.tiff"]); |
ASSIGN (icon, [NSImage imageNamed: @"MultipleSelection.tiff"]); |
163 |
} |
} |
188 |
for (i = 0; i < [paths count]; i++) { |
for (i = 0; i < [paths count]; i++) { |
189 |
NSString *path = [paths objectAtIndex: i]; |
NSString *path = [paths objectAtIndex: i]; |
190 |
|
|
191 |
if ([gworkspace isLockedPath: path]) { |
if ([GWLib isLockedPath: path]) { |
192 |
[self setLocked: YES]; |
[self setLocked: YES]; |
193 |
break; |
break; |
194 |
} |
} |
255 |
- (void)renewIcon |
- (void)renewIcon |
256 |
{ |
{ |
257 |
if (singlepath == YES) { |
if (singlepath == YES) { |
258 |
ASSIGN (icon, [gworkspace iconForFile: fullpath ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: fullpath ofType: type]); |
259 |
} else { |
} else { |
260 |
ASSIGN (icon, [NSImage imageNamed: @"MultipleSelection.tiff"]); |
ASSIGN (icon, [NSImage imageNamed: @"MultipleSelection.tiff"]); |
261 |
} |
} |
272 |
|
|
273 |
- (void)openWith:(id)sender |
- (void)openWith:(id)sender |
274 |
{ |
{ |
275 |
[gworkspace openSelectedPathsWith]; |
[[GWLib workspaceApp] openSelectedPathsWith]; |
276 |
} |
} |
277 |
|
|
278 |
- (BOOL)isSelect |
- (BOOL)isSelect |
545 |
event: event |
event: event |
546 |
pasteboard: pb |
pasteboard: pb |
547 |
source: self |
source: self |
548 |
slideBack: [gworkspace animateSlideBack]]; |
slideBack: [[GWLib workspaceApp] animateSlideBack]]; |
549 |
} |
} |
550 |
|
|
551 |
- (void)declareAndSetShapeOnPasteboard:(NSPasteboard *)pb |
- (void)declareAndSetShapeOnPasteboard:(NSPasteboard *)pb |
695 |
{ |
{ |
696 |
if (isDragTarget == YES) { |
if (isDragTarget == YES) { |
697 |
isDragTarget = NO; |
isDragTarget = NO; |
698 |
ASSIGN (icon, [gworkspace iconForFile: fullpath ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: fullpath ofType: type]); |
699 |
[self setNeedsDisplay: YES]; |
[self setNeedsDisplay: YES]; |
700 |
} |
} |
701 |
} |
} |
725 |
|
|
726 |
CHECK_LOCK; |
CHECK_LOCK; |
727 |
|
|
728 |
ASSIGN (icon, [gworkspace iconForFile: fullpath ofType: type]); |
ASSIGN (icon, [GWLib iconForFile: fullpath ofType: type]); |
729 |
[self setNeedsDisplay: YES]; |
[self setNeedsDisplay: YES]; |
730 |
isDragTarget = NO; |
isDragTarget = NO; |
731 |
|
|
734 |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
sourcePaths = [pb propertyListForType: NSFilenamesPboardType]; |
735 |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent]; |
736 |
|
|
737 |
trashPath = [gworkspace trashPath]; |
trashPath = [[GWLib workspaceApp] trashPath]; |
738 |
|
|
739 |
if ([source isEqualToString: trashPath]) { |
if ([source isEqualToString: trashPath]) { |
740 |
operation = GWorkspaceRecycleOutOperation; |
operation = GWorkspaceRecycleOutOperation; |
759 |
[opDict setObject: fullpath forKey: @"destination"]; |
[opDict setObject: fullpath forKey: @"destination"]; |
760 |
[opDict setObject: files forKey: @"files"]; |
[opDict setObject: files forKey: @"files"]; |
761 |
|
|
762 |
[gworkspace performFileOperationWithDictionary: opDict]; |
[[GWLib workspaceApp] performFileOperationWithDictionary: opDict]; |
763 |
} |
} |
764 |
|
|
765 |
@end |
@end |