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

Diff of /gnustep/usr-apps/gworkspace/Viewers/SmallIconsViewer/SmallIcon.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 60  Line 60 
60  {  {
61    self = [super init];    self = [super init];
62    if (self) {    if (self) {
     #ifdef GNUSTEP  
                   Class gwclass = [[NSBundle mainBundle] principalClass];  
     #else  
                   Class gwclass = [[NSBundle mainBundle] classNamed: @"GWorkspace"];  
     #endif  
63      NSString *defApp = nil, *t = nil;      NSString *defApp = nil, *t = nil;
64    
                 gworkspace = (id<GWProtocol>)[gwclass gworkspace];  
                   
65                  ASSIGN (path, apath);                  ASSIGN (path, apath);
66                  [self setDelegate: adelegate];                  [self setDelegate: adelegate];
67    
# Line 84  Line 77 
77                                        application: &defApp                                        application: &defApp
78                                               type: &t];                                                     type: &t];      
79                  ASSIGN (type, t);                  ASSIGN (type, t);
80                  isPakage = [gworkspace isPakageAtPath: path];                  isPakage = [GWLib isPakageAtPath: path];
81                                    
82                  ASSIGN (icon, [gworkspace smallIconForFile: path]);                  ASSIGN (icon, [GWLib smallIconForFile: path]);
83      ASSIGN (highlight, [NSImage imageNamed: @"SmallCellHighlight.tiff"]);      ASSIGN (highlight, [NSImage imageNamed: @"SmallCellHighlight.tiff"]);
84    
85      namelabel = [[SmallIconLabel alloc] initForIcon: self];      namelabel = [[SmallIconLabel alloc] initForIcon: self];
# Line 126  Line 119 
119    NSString *defApp = nil, *t = nil;    NSString *defApp = nil, *t = nil;
120    
121          ASSIGN (path, apath);          ASSIGN (path, apath);
122          ASSIGN (icon, [gworkspace smallIconForFile: path]);                  ASSIGN (icon, [GWLib smallIconForFile: path]);        
123                                    
124          [[NSWorkspace sharedWorkspace] getInfoForFile: path          [[NSWorkspace sharedWorkspace] getInfoForFile: path
125                                                                                                                          application: &defApp                                                                                                                          application: &defApp
126                                                                                                                                                         type: &t];                                                                                                                                                               type: &t];      
127          ASSIGN (type, t);          ASSIGN (type, t);
128          isPakage = [gworkspace isPakageAtPath: path];          isPakage = [GWLib isPakageAtPath: path];
129          ASSIGN (name, [path lastPathComponent]);          ASSIGN (name, [path lastPathComponent]);
130          [namelabel setStringValue: name];          [namelabel setStringValue: name];
131    [self setLabelFrame];    [self setLabelFrame];
# Line 549  Line 542 
542    if ([selection count] > 1) {    if ([selection count] > 1) {
543      dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"];      dragIcon = [NSImage imageNamed: @"MultipleSelection.tiff"];
544    } else {    } else {
545      dragIcon = [gworkspace iconForFile: path ofType: type];      dragIcon = [GWLib iconForFile: path ofType: type];
546    }      }  
547    
548    [self dragImage: dragIcon    [self dragImage: dragIcon
# Line 558  Line 551 
551              event: event              event: event
552         pasteboard: pb         pasteboard: pb
553             source: self             source: self
554          slideBack: [gworkspace animateSlideBack]];          slideBack: [[GWLib workspaceApp] animateSlideBack]];
555  }  }
556    
557  - (void)draggedImage:(NSImage *)anImage  - (void)draggedImage:(NSImage *)anImage
# Line 720  Line 713 
713    if(isDragTarget == YES) {    if(isDragTarget == YES) {
714      isDragTarget = NO;      isDragTarget = NO;
715      if (onSelf == NO) {            if (onSelf == NO) {      
716        ASSIGN (icon, [gworkspace smallIconForFile: path]);        ASSIGN (icon, [GWLib smallIconForFile: path]);
717        [self setNeedsDisplay: YES];        [self setNeedsDisplay: YES];
718      }      }
719      onSelf = NO;      onSelf = NO;
# Line 759  Line 752 
752      return;      return;
753    }    }
754        
755    ASSIGN (icon, [gworkspace smallIconForFile: path]);    ASSIGN (icon, [GWLib smallIconForFile: path]);
756    [self setNeedsDisplay: YES];    [self setNeedsDisplay: YES];
757    
758          sourceDragMask = [sender draggingSourceOperationMask];            sourceDragMask = [sender draggingSourceOperationMask];  
# Line 767  Line 760 
760    sourcePaths = [pb propertyListForType: NSFilenamesPboardType];      sourcePaths = [pb propertyListForType: NSFilenamesPboardType];  
761    source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent];    source = [[sourcePaths objectAtIndex: 0] stringByDeletingLastPathComponent];
762    
763          trashPath = [gworkspace trashPath];          trashPath = [[GWLib workspaceApp] trashPath];
764    
765          if ([source isEqualToString: trashPath]) {          if ([source isEqualToString: trashPath]) {
766                  operation = GWorkspaceRecycleOutOperation;                  operation = GWorkspaceRecycleOutOperation;
# Line 792  Line 785 
785          [opDict setObject: path forKey: @"destination"];          [opDict setObject: path forKey: @"destination"];
786          [opDict setObject: files forKey: @"files"];          [opDict setObject: files forKey: @"files"];
787                    
788          [gworkspace performFileOperationWithDictionary: opDict];                  [[GWLib workspaceApp] performFileOperationWithDictionary: opDict];      
789  }  }
790    
791  @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