38 |
|
|
39 |
- (void)dealloc |
- (void)dealloc |
40 |
{ |
{ |
|
TEST_RELEASE (remoteHostName); |
|
41 |
[super dealloc]; |
[super dealloc]; |
42 |
} |
} |
43 |
|
|
48 |
numberOfRows:(int)numRows |
numberOfRows:(int)numRows |
49 |
numberOfColumns:(int)numColumns |
numberOfColumns:(int)numColumns |
50 |
acceptDnd:(BOOL)dnd |
acceptDnd:(BOOL)dnd |
|
remoteHost:(NSString *)rhost |
|
51 |
{ |
{ |
52 |
self = [super initWithFrame: frameRect mode: aMode prototype: aCell |
self = [super initWithFrame: frameRect mode: aMode prototype: aCell |
53 |
numberOfRows: numRows numberOfColumns: numColumns]; |
numberOfRows: numRows numberOfColumns: numColumns]; |
60 |
#endif |
#endif |
61 |
|
|
62 |
gworkspace = (id<GWProtocol>)[gwclass gworkspace]; |
gworkspace = (id<GWProtocol>)[gwclass gworkspace]; |
|
|
|
|
if (rhost) { |
|
|
isRemote = YES; |
|
|
ASSIGN (remoteHostName, rhost); |
|
|
} else { |
|
|
isRemote = NO; |
|
|
remoteHostName = nil; |
|
|
} |
|
63 |
|
|
64 |
column = col; |
column = col; |
65 |
browser = [column browser]; |
browser = [column browser]; |
67 |
acceptDnd = dnd; |
acceptDnd = dnd; |
68 |
|
|
69 |
if (acceptDnd) { |
if (acceptDnd) { |
70 |
if (isRemote == NO) { |
[self registerForDraggedTypes: [NSArray arrayWithObject: NSFilenamesPboardType]]; |
|
[self registerForDraggedTypes: [NSArray arrayWithObject: NSFilenamesPboardType]]; |
|
|
} else { |
|
|
[self registerForDraggedTypes: [NSArray arrayWithObject: GWRemoteFilenamesPboardType]]; |
|
|
} |
|
71 |
} |
} |
72 |
} |
} |
73 |
|
|
303 |
dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"]; |
dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"]; |
304 |
} else { |
} else { |
305 |
NSString *path = [paths objectAtIndex: 0]; |
NSString *path = [paths objectAtIndex: 0]; |
306 |
NSString *type = [gworkspace server: remoteHostName typeOfFileAt: path]; |
NSString *type = [gworkspace typeOfFileAt: path]; |
307 |
|
|
308 |
dragIcon = [gworkspace iconForFile: path ofType: type]; |
dragIcon = [gworkspace iconForFile: path ofType: type]; |
309 |
} |
} |
329 |
NSArray *selectedCells = [self selectedCells]; |
NSArray *selectedCells = [self selectedCells]; |
330 |
NSMutableArray *selection = [NSMutableArray arrayWithCapacity: 1]; |
NSMutableArray *selection = [NSMutableArray arrayWithCapacity: 1]; |
331 |
NSArray *dndtypes; |
NSArray *dndtypes; |
|
NSData *pbData; |
|
332 |
int i; |
int i; |
333 |
|
|
334 |
for (i = 0; i < [selectedCells count]; i++) { |
for (i = 0; i < [selectedCells count]; i++) { |
336 |
[selection addObjectsFromArray: paths]; |
[selection addObjectsFromArray: paths]; |
337 |
} |
} |
338 |
|
|
339 |
if (isRemote == NO) { |
dndtypes = [NSArray arrayWithObject: NSFilenamesPboardType]; |
340 |
dndtypes = [NSArray arrayWithObject: NSFilenamesPboardType]; |
[pb declareTypes: dndtypes owner: nil]; |
341 |
[pb declareTypes: dndtypes owner: nil]; |
|
342 |
|
if ([pb setPropertyList: selection forType: NSFilenamesPboardType] == NO) { |
343 |
if ([pb setPropertyList: selection forType: NSFilenamesPboardType] == NO) { |
return; |
|
return; |
|
|
} |
|
|
} else { |
|
|
NSMutableDictionary *pbDict = [NSMutableDictionary dictionary]; |
|
|
dndtypes = [NSArray arrayWithObject: GWRemoteFilenamesPboardType]; |
|
|
[pb declareTypes: dndtypes owner: nil]; |
|
|
[pbDict setObject: remoteHostName forKey: @"host"]; |
|
|
[pbDict setObject: selection forKey: @"paths"]; |
|
|
pbData = [NSArchiver archivedDataWithRootObject: pbDict]; |
|
|
[pb setData: pbData forType: GWRemoteFilenamesPboardType]; |
|
344 |
} |
} |
345 |
} |
} |
346 |
|
|