/[gnustep]/gnustep/usr-apps/gworkspace/Viewers/SmallIconsViewer/SmallIconsPanel.m
ViewVC logotype

Diff of /gnustep/usr-apps/gworkspace/Viewers/SmallIconsViewer/SmallIconsPanel.m

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

revision 1.3 by esersale, Mon Sep 29 13:20:29 2003 UTC revision 1.4 by esersale, Tue Sep 30 15:38:06 2003 UTC
# Line 84  if (rct.size.height < 0) rct.size.height Line 84  if (rct.size.height < 0) rct.size.height
84  {  {
85    self = [super initWithFrame: NSZeroRect];    self = [super initWithFrame: NSZeroRect];
86    if (self) {    if (self) {
     #ifdef GNUSTEP  
                   Class gwclass = [[NSBundle mainBundle] principalClass];  
     #else  
                   Class gwclass = [[NSBundle mainBundle] classNamed: @"GWorkspace"];  
     #endif  
   
                 gworkspace = (id<GWProtocol>)[gwclass gworkspace];  
           
87      ASSIGN (currentPath, path);      ASSIGN (currentPath, path);
88                  [self setDelegate: adelegate];                  [self setDelegate: adelegate];
89                                    
# Line 109  if (rct.size.height < 0) rct.size.height Line 101  if (rct.size.height < 0) rct.size.height
101                  lastKeyPressed = 0.;                  lastKeyPressed = 0.;
102          charBuffer = nil;          charBuffer = nil;
103    
104      contestualMenu = [gworkspace usesContestualMenu];      contestualMenu = [[GWLib workspaceApp] usesContestualMenu];
105                                    
106          [self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]];          [self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]];
107    
# Line 213  if (rct.size.height < 0) rct.size.height Line 205  if (rct.size.height < 0) rct.size.height
205          } else {          } else {
206      hiddenFiles = nil;      hiddenFiles = nil;
207    }    }
208          hideSysFiles = [gworkspace hideSysFiles];          hideSysFiles = [GWLib hideSysFiles];
209                    
210          if (hiddenFiles != nil  ||  hideSysFiles) {              if (hiddenFiles != nil  ||  hideSysFiles) {    
211                  NSMutableArray *mutableFiles = AUTORELEASE ([files mutableCopy]);                  NSMutableArray *mutableFiles = AUTORELEASE ([files mutableCopy]);
# Line 261  if (rct.size.height < 0) rct.size.height Line 253  if (rct.size.height < 0) rct.size.height
253        
254    [icons removeAllObjects];    [icons removeAllObjects];
255    
256    files = [gworkspace sortedDirectoryContentsAtPath: currentPath];    files = [GWLib sortedDirectoryContentsAtPath: currentPath];
257    files = [gworkspace checkHiddenFiles: files atPath: currentPath];      files = [GWLib checkHiddenFiles: files atPath: currentPath];  
258                    
259    count = [files count];    count = [files count];
260    if (count == 0) {    if (count == 0) {
# Line 281  if (rct.size.height < 0) rct.size.height Line 273  if (rct.size.height < 0) rct.size.height
273      NSString *ipath = [paths objectAtIndex: i];      NSString *ipath = [paths objectAtIndex: i];
274      SmallIcon *icon = [[SmallIcon alloc] initForPath: ipath delegate: self];      SmallIcon *icon = [[SmallIcon alloc] initForPath: ipath delegate: self];
275        
276      [icon setLocked: [gworkspace isLockedPath: ipath]];      [icon setLocked: [GWLib isLockedPath: ipath]];
277      [icons addObject: icon];        [icons addObject: icon];  
278      RELEASE (icon);      RELEASE (icon);
279    }      }  
# Line 300  if (rct.size.height < 0) rct.size.height Line 292  if (rct.size.height < 0) rct.size.height
292  - (void)sortIcons  - (void)sortIcons
293  {  {
294    NSMutableDictionary *sortDict = [NSMutableDictionary dictionaryWithCapacity: 1];    NSMutableDictionary *sortDict = [NSMutableDictionary dictionaryWithCapacity: 1];
295          int stype = [gworkspace sortTypeForDirectoryAtPath: currentPath];          int stype = [GWLib sortTypeForDirectoryAtPath: currentPath];
296    
297          [sortDict setObject: currentPath forKey: @"path"];          [sortDict setObject: currentPath forKey: @"path"];
298          [sortDict setObject: [NSString stringWithFormat: @"%i", stype] forKey: @"type"];          [sortDict setObject: [NSString stringWithFormat: @"%i", stype] forKey: @"type"];
# Line 763  if (s.height > maxr.size.height) s.heigh Line 755  if (s.height > maxr.size.height) s.heigh
755    
756  - (void)openSelectionWith:(id)sender  - (void)openSelectionWith:(id)sender
757  {  {
758    [gworkspace openSelectedPathsWith];    [[GWLib workspaceApp] openSelectedPathsWith];
759  }  }
760    
761  - (void)addIconWithPath:(NSString *)iconpath dimmed:(BOOL)isdimmed;  - (void)addIconWithPath:(NSString *)iconpath dimmed:(BOOL)isdimmed;
# Line 790  if (s.height > maxr.size.height) s.heigh Line 782  if (s.height > maxr.size.height) s.heigh
782                  NSString *s = [iconpaths objectAtIndex: i];                  NSString *s = [iconpaths objectAtIndex: i];
783      SmallIcon *icon = [[SmallIcon alloc] initForPath: s delegate: self];      SmallIcon *icon = [[SmallIcon alloc] initForPath: s delegate: self];
784            
785      [icon setLocked: [gworkspace isLockedPath: s]];          [icon setLocked: [GWLib isLockedPath: s]];  
786            
787      [icons addObject: icon];        [icons addObject: icon];  
788            [self addSubview: icon];            [self addSubview: icon];
# Line 1518  pp.x = NSMaxX([self bounds]) - 1 Line 1510  pp.x = NSMaxX([self bounds]) - 1
1510    sourcePaths = [pb propertyListForType: NSFilenamesPboardType];      sourcePaths = [pb propertyListForType: NSFilenamesPboardType];  
1511    source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent];    source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent];
1512    
1513          trashPath = [gworkspace trashPath];          trashPath = [[GWLib workspaceApp] trashPath];
1514          if ([source isEqualToString: trashPath]) {          if ([source isEqualToString: trashPath]) {
1515                  operation = GWorkspaceRecycleOutOperation;                  operation = GWorkspaceRecycleOutOperation;
1516          } else {          } else {
# Line 1542  pp.x = NSMaxX([self bounds]) - 1 Line 1534  pp.x = NSMaxX([self bounds]) - 1
1534          [opDict setObject: currentPath forKey: @"destination"];          [opDict setObject: currentPath forKey: @"destination"];
1535          [opDict setObject: files forKey: @"files"];          [opDict setObject: files forKey: @"files"];
1536                    
1537          [gworkspace performFileOperationWithDictionary: opDict];                  [[GWLib workspaceApp] performFileOperationWithDictionary: opDict];      
1538  }  }
1539    
1540  @end  @end

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