/[gnustep]/gnustep/usr-apps/gworkspace/Viewers/IconsViewer/PathIcon.m
ViewVC logotype

Diff of /gnustep/usr-apps/gworkspace/Viewers/IconsViewer/PathIcon.m

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

revision 1.2 by esersale, Wed Aug 27 10:13:53 2003 UTC revision 1.3 by esersale, Tue Sep 30 15:38:06 2003 UTC
# Line 73  inRect: NSMakeRect(((int)(s1).width - (i Line 73  inRect: NSMakeRect(((int)(s1).width - (i
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                                    
# Line 98  inRect: NSMakeRect(((int)(s1).width - (i Line 90  inRect: NSMakeRect(((int)(s1).width - (i
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;
# Line 154  inRect: NSMakeRect(((int)(s1).width - (i Line 146  inRect: NSMakeRect(((int)(s1).width - (i
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;
# Line 165  inRect: NSMakeRect(((int)(s1).width - (i Line 157  inRect: NSMakeRect(((int)(s1).width - (i
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    }    }
# Line 196  inRect: NSMakeRect(((int)(s1).width - (i Line 188  inRect: NSMakeRect(((int)(s1).width - (i
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      }      }
# Line 263  inRect: NSMakeRect(((int)(s1).width - (i Line 255  inRect: NSMakeRect(((int)(s1).width - (i
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    }    }
# Line 280  inRect: NSMakeRect(((int)(s1).width - (i Line 272  inRect: NSMakeRect(((int)(s1).width - (i
272    
273  - (void)openWith:(id)sender  - (void)openWith:(id)sender
274  {  {
275    [gworkspace openSelectedPathsWith];    [[GWLib workspaceApp] openSelectedPathsWith];
276  }  }
277    
278  - (BOOL)isSelect  - (BOOL)isSelect
# Line 553  inRect: NSMakeRect(((int)(s1).width - (i Line 545  inRect: NSMakeRect(((int)(s1).width - (i
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
# Line 703  inRect: NSMakeRect(((int)(s1).width - (i Line 695  inRect: NSMakeRect(((int)(s1).width - (i
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  }  }
# Line 733  inRect: NSMakeRect(((int)(s1).width - (i Line 725  inRect: NSMakeRect(((int)(s1).width - (i
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    
# Line 742  inRect: NSMakeRect(((int)(s1).width - (i Line 734  inRect: NSMakeRect(((int)(s1).width - (i
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;
# Line 767  inRect: NSMakeRect(((int)(s1).width - (i Line 759  inRect: NSMakeRect(((int)(s1).width - (i
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

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

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