Changeset 5273 for Tuna/trunk

Show
Ignore:
Timestamp:
02/15/08 12:18:19 (1 year ago)
Author:
morris
Message:

Add copy method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Tuna/trunk/TNSessionController.m

    r5220 r5273  
    619619} 
    620620 
     621 
     622 
     623- (void)outlineViewShouldCopyInfo:(NSOutlineView *)outlineView { 
     624        NSEnumerator            *enumerator; 
     625        NSPasteboard            *pasteboard; 
     626        NSMutableArray          *rows; 
     627        NSMutableString         *indentation, *string; 
     628        NSArray                         *nodes; 
     629        TNNode                          *node; 
     630        NSInteger                       level, baseLevel; 
     631        BOOL                            showSelf; 
     632         
     633        nodes = [self _selectedNodes]; 
     634         
     635        if([nodes count] > 0) { 
     636                rows = [NSMutableArray array]; 
     637                indentation = [NSMutableString string]; 
     638                baseLevel = [_treeOutlineView levelForItem:[nodes objectAtIndex:0]]; 
     639                enumerator = [nodes objectEnumerator]; 
     640                showSelf = [[_treeOutlineView tableColumns] containsObject:_selfTableColumn]; 
     641                 
     642                while((node = [enumerator nextObject])) { 
     643                        [indentation setString:@""]; 
     644                         
     645                        level = [_treeOutlineView levelForItem:node] - baseLevel; 
     646                         
     647                        while(level > 0) { 
     648                                [indentation appendString:@"  "]; 
     649                                level--; 
     650                        } 
     651                         
     652                        string = [NSMutableString stringWithFormat:@"%@%.1f%% %@ %@", 
     653                                indentation, 
     654                                [node cumulativePercent], 
     655                                [[node function] library], 
     656                                [[node function] symbol]]; 
     657                         
     658                        if(showSelf) 
     659                                [string insertString:[NSSWF:@"%.1f%% ", [node percent]] atIndex:[indentation length]]; 
     660                         
     661                        [rows addObject:string]; 
     662                } 
     663                 
     664                pasteboard = [NSPasteboard generalPasteboard]; 
     665                [pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:NULL]; 
     666                [pasteboard setString:[rows componentsJoinedByString:@"\n"] forType:NSStringPboardType]; 
     667        } 
     668} 
     669 
    621670@end 
  • Tuna/trunk/Tuna.xcodeproj/project.pbxproj

    r5227 r5273  
    5252                A5092D120836B25E006646D1 /* Tuna.icns in Resources */ = {isa = PBXBuildFile; fileRef = A5092D110836B25E006646D1 /* Tuna.icns */; }; 
    5353                A5092D180836B6C9006646D1 /* Document.icns in Resources */ = {isa = PBXBuildFile; fileRef = A5092D170836B6C9006646D1 /* Document.icns */; }; 
     54                A5220B4E0D62D603008CEB3E /* TunaKit.framework in Copy Files (Frameworks) */ = {isa = PBXBuildFile; fileRef = A5EAE6BF0D5969F60007C0A1 /* TunaKit.framework */; }; 
    5455                A5554EA5083633FF0044855A /* NSDocumentController-TNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A5554EA3083633FF0044855A /* NSDocumentController-TNAdditions.m */; }; 
    5556                A555512D083668B30044855A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A555512B083668B30044855A /* Localizable.strings */; }; 
     
    120121                        dstSubfolderSpec = 10; 
    121122                        files = ( 
     123                                A5220B4E0D62D603008CEB3E /* TunaKit.framework in Copy Files (Frameworks) */, 
    122124                                A5643C0B0A26041600ADF4F5 /* WiredAdditions.framework in Copy Files (Frameworks) */, 
    123125                        );