Changeset 3601


Ignore:
Timestamp:
Oct 27, 2007, 6:40:43 PM (14 years ago)
Author:
livings124
Message:

show the multiple document icon on Leopard when multiple files selected

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.h

    r3475 r3601  
    3333{
    3434    NSArray * fTorrents, * fPeers, * fFiles;
    35     NSImage * fAppIcon, * fLockImage;
    3635   
    3736    IBOutlet NSView * fInfoView, * fActivityView, * fPeersView, * fFilesView, * fOptionsView;
  • trunk/macosx/InfoWindowController.m

    r3597 r3601  
    2525#import "InfoWindowController.h"
    2626#import "InfoTabButtonCell.h"
     27#import "NSApplicationAdditions.h"
    2728#import "NSStringAdditions.h"
    2829
     
    7778- (void) awakeFromNib
    7879{
    79     //get images
    80     fAppIcon = [NSImage imageNamed: @"NSApplicationIcon"];
    81    
    8280    //window location and size
    8381    NSPanel * window = (NSPanel *)[self window];
     
    184182        if (numberSelected > 0)
    185183        {
     184            [fImageView setImage: [NSImage imageNamed: [NSApp isOnLeopardOrBetter]
     185                                    ? NSImageNameMultipleDocuments : @"NSApplicationIcon"]];
     186           
    186187            [fNameField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Torrents Selected",
    187188                                            "Inspector -> above tabs -> selected torrents"), numberSelected]];
     
    198199        else
    199200        {
     201            [fImageView setImage: [NSImage imageNamed: @"NSApplicationIcon"]];
     202           
    200203            [fNameField setStringValue: NSLocalizedString(@"No Torrents Selected", "Inspector -> above tabs -> selected torrents")];
    201204            [fSizeField setStringValue: @""];
     
    231234        [fFileOutline setTorrent: nil];
    232235       
    233         [fImageView setImage: fAppIcon];
    234        
    235236        [fNameField setToolTip: nil];
    236237
     
    658659       
    659660        if ([ident isEqualToString: @"Encryption"])
    660         {
    661             if ([[peer objectForKey: @"Encryption"] boolValue])
    662             {
    663                 if (!fLockImage)
    664                     fLockImage = [NSImage imageNamed: @"Lock.tiff"];
    665                 return fLockImage;
    666             }
    667             else
    668                 return nil;
    669         }
     661            return [[peer objectForKey: @"Encryption"] boolValue] ? [NSImage imageNamed: @"Lock.tiff"] : nil;
    670662        else if ([ident isEqualToString: @"Client"])
    671663            return [peer objectForKey: @"Client"];
  • trunk/macosx/TorrentTableView.m

    r3597 r3601  
    305305   
    306306    //select torrent closest to text that isn't before text alphabetically
    307     int row;
    308307    NSEnumerator * enumerator = [tempTorrents objectEnumerator];
    309308    Torrent * torrent;
     
    311310        if ([[[torrent name] lowercaseString] hasPrefix: text])
    312311        {
    313             row = [fTorrents indexOfObject: torrent];
    314             break;
     312            int row = [fTorrents indexOfObject: torrent];
     313            [self selectRow: row byExtendingSelection: NO];
     314            [self scrollRowToVisible: row];
     315            return;
    315316        }
    316    
    317     //select last torrent alphabetically if no match found
    318     if (!torrent)
    319         row = [fTorrents indexOfObject: [tempTorrents lastObject]];
    320    
    321     [self selectRow: row byExtendingSelection: NO];
    322     [self scrollRowToVisible: row];
    323317}
    324318
Note: See TracChangeset for help on using the changeset viewer.