/[gnustep]/gnustep/usr-apps/gworkspace/GWLib/BColumn.m
ViewVC logotype

Diff of /gnustep/usr-apps/gworkspace/GWLib/BColumn.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by esersale, Mon Sep 29 13:20:28 2003 UTC revision 1.4 by esersale, Tue Sep 30 15:38:04 2003 UTC
# Line 73  if (sz.height < 0) sz.height = 0 Line 73  if (sz.height < 0) sz.height = 0
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  
76            NSRect rect = NSMakeRect(0, 0, 150, 100);            NSRect rect = NSMakeRect(0, 0, 150, 100);
77      styleMask = mask;      styleMask = mask;
78                    
                 gworkspace = (id<GWProtocol>)[gwclass gworkspace];  
           
79      fm = [NSFileManager defaultManager];      fm = [NSFileManager defaultManager];
80      ws = [NSWorkspace sharedWorkspace];      ws = [NSWorkspace sharedWorkspace];
81            
# Line 216  if (sz.height < 0) sz.height = 0 Line 209  if (sz.height < 0) sz.height = 0
209                    for (i = 0; i < [iconPaths count]; i++) {                    for (i = 0; i < [iconPaths count]; i++) {
210          NSString *ipath = [iconPaths objectAtIndex: i];          NSString *ipath = [iconPaths objectAtIndex: i];
211    
212                            if ([gworkspace isLockedPath: ipath]) {                            if ([GWLib isLockedPath: ipath]) {
213                                    [icon setLocked: YES];                                    [icon setLocked: YES];
214                                    break;                                    break;
215                            }                            }
# Line 293  if (sz.height < 0) sz.height = 0 Line 286  if (sz.height < 0) sz.height = 0
286    int i, count;    int i, count;
287    BOOL is_dir;    BOOL is_dir;
288    
289    if ([gworkspace existsAndIsDirectoryFileAtPath: path] == NO) {            if ([GWLib existsAndIsDirectoryFileAtPath: path] == NO) {    
290      return;      return;
291    } else {    } else {
292                  if ([gworkspace isPakageAtPath: path] && (!(styleMask & GWViewsPaksgesMask))) {                  if ([GWLib isPakageAtPath: path] && (!(styleMask & GWViewsPaksgesMask))) {
293          return;          return;
294                  }                  }
295    }    }
# Line 315  if (sz.height < 0) sz.height = 0 Line 308  if (sz.height < 0) sz.height = 0
308          [matrix setDoubleAction: @selector(doDoubleClick:)];          [matrix setDoubleAction: @selector(doDoubleClick:)];
309          [scroll setDocumentView: matrix];          [scroll setDocumentView: matrix];
310    
311    files = [gworkspace sortedDirectoryContentsAtPath: path];    files = [GWLib sortedDirectoryContentsAtPath: path];
312    files = [gworkspace checkHiddenFiles: files atPath: path];    files = [GWLib checkHiddenFiles: files atPath: path];
313        
314    count = [files count];    count = [files count];
315    if (count == 0) {    if (count == 0) {
# Line 343  if (sz.height < 0) sz.height = 0 Line 336  if (sz.height < 0) sz.height = 0
336        [cell setStringValue: [files objectAtIndex: i]];        [cell setStringValue: [files objectAtIndex: i]];
337      }      }
338            
339      is_dir = [gworkspace existsAndIsDirectoryFileAtPath: s];      is_dir = [GWLib existsAndIsDirectoryFileAtPath: s];
340      if (is_dir == YES) {          if (is_dir == YES) {    
341        [cell setLeaf: (([gworkspace isPakageAtPath: s])        [cell setLeaf: (([GWLib isPakageAtPath: s])
342                                ? (!(styleMask & GWViewsPaksgesMask)) : NO)];                                ? (!(styleMask & GWViewsPaksgesMask)) : NO)];
343      } else {      } else {
344                    [cell setLeaf: YES];                    [cell setLeaf: YES];
345      }      }
346                                    
347      [cell setEnabled: !([gworkspace isLockedPath: s])];        [cell setEnabled: !([GWLib isLockedPath: s])];        
348    }    }
349  }  }
350    
351  - (void)addMatrixCellsWithNames:(NSArray *)names  - (void)addMatrixCellsWithNames:(NSArray *)names
352  {  {
353    NSArray *files = [gworkspace checkHiddenFiles: names atPath: path];    NSArray *files = [GWLib checkHiddenFiles: names atPath: path];
354    
355    if ([files count]) {    if ([files count]) {
356            BCell *cell;            BCell *cell;
# Line 375  if (sz.height < 0) sz.height = 0 Line 368  if (sz.height < 0) sz.height = 0
368        NSString *name = [names objectAtIndex: i];        NSString *name = [names objectAtIndex: i];
369        NSString *cellpath = [path stringByAppendingPathComponent: name];        NSString *cellpath = [path stringByAppendingPathComponent: name];
370    
371        isdir = [gworkspace existsAndIsDirectoryFileAtPath: cellpath];        isdir = [GWLib existsAndIsDirectoryFileAtPath: cellpath];
372                
373                    cell = [self cellWithName: name];                        cell = [self cellWithName: name];    
374        if (cell == nil) {        if (cell == nil) {
# Line 389  if (sz.height < 0) sz.height = 0 Line 382  if (sz.height < 0) sz.height = 0
382          }          }
383                    
384          if (isdir) {              if (isdir) {    
385            [cell setLeaf: (([gworkspace isPakageAtPath: cellpath])            [cell setLeaf: (([GWLib isPakageAtPath: cellpath])
386                                  ? (!(styleMask & GWViewsPaksgesMask)) : NO)];                                  ? (!(styleMask & GWViewsPaksgesMask)) : NO)];
387          } else {          } else {
388                        [cell setLeaf: YES];                        [cell setLeaf: YES];
# Line 405  if (sz.height < 0) sz.height = 0 Line 398  if (sz.height < 0) sz.height = 0
398    
399      [matrix setCellSize: NSMakeSize([scroll contentSize].width, cellsHeight)];        [matrix setCellSize: NSMakeSize([scroll contentSize].width, cellsHeight)];  
400    
401            stype = [gworkspace sortTypeForDirectoryAtPath: path];                                    stype = [GWLib sortTypeForDirectoryAtPath: path];                    
402            sortDict = [NSMutableDictionary dictionaryWithCapacity: 1];            sortDict = [NSMutableDictionary dictionaryWithCapacity: 1];
403            [sortDict setObject: path forKey: @"path"];            [sortDict setObject: path forKey: @"path"];
404            [sortDict setObject: [NSNumber numberWithInt: stype] forKey: @"type"];            [sortDict setObject: [NSNumber numberWithInt: stype] forKey: @"type"];
# Line 423  if (sz.height < 0) sz.height = 0 Line 416  if (sz.height < 0) sz.height = 0
416    
417  - (void)addDimmedMatrixCellsWithNames:(NSArray *)names  - (void)addDimmedMatrixCellsWithNames:(NSArray *)names
418  {  {
419    NSArray *files = [gworkspace checkHiddenFiles: names atPath: path];    NSArray *files = [GWLib checkHiddenFiles: names atPath: path];
420    
421    if ([files count]) {    if ([files count]) {
422            BCell *cell;            BCell *cell;
# Line 1007  if (sz.height < 0) sz.height = 0 Line 1000  if (sz.height < 0) sz.height = 0
1000    sourcePaths = [pb propertyListForType: NSFilenamesPboardType];    sourcePaths = [pb propertyListForType: NSFilenamesPboardType];
1001    source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent];    source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent];
1002    targetPath = [path stringByAppendingPathComponent: [cell stringValue]];    targetPath = [path stringByAppendingPathComponent: [cell stringValue]];
1003    trashPath = [gworkspace trashPath];    trashPath = [[GWLib workspaceApp] trashPath];
1004    
1005          if ([source isEqualToString: trashPath]) {          if ([source isEqualToString: trashPath]) {
1006                  operation = GWorkspaceRecycleOutOperation;                  operation = GWorkspaceRecycleOutOperation;
# Line 1032  if (sz.height < 0) sz.height = 0 Line 1025  if (sz.height < 0) sz.height = 0
1025          [opDict setObject: targetPath forKey: @"destination"];          [opDict setObject: targetPath forKey: @"destination"];
1026          [opDict setObject: files forKey: @"files"];          [opDict setObject: files forKey: @"files"];
1027    
1028    [gworkspace performFileOperationWithDictionary: opDict];    [[GWLib workspaceApp] performFileOperationWithDictionary: opDict];
1029  }  }
1030    
1031  - (void)setFrame:(NSRect)frameRect  - (void)setFrame:(NSRect)frameRect

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26