diff --git a/macosx/InfoWindowController.h b/macosx/InfoWindowController.h index ded36653e..0a11481b1 100644 --- a/macosx/InfoWindowController.h +++ b/macosx/InfoWindowController.h @@ -32,7 +32,6 @@ @interface InfoWindowController : NSWindowController { NSArray * fTorrents, * fPeers, * fFiles; - NSImage * fAppIcon, * fLockImage; IBOutlet NSView * fInfoView, * fActivityView, * fPeersView, * fFilesView, * fOptionsView; int fCurrentTabTag; diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 8bba4257f..dd87e8e04 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -24,6 +24,7 @@ #import "InfoWindowController.h" #import "InfoTabButtonCell.h" +#import "NSApplicationAdditions.h" #import "NSStringAdditions.h" #define FILE_ROW_SMALL_HEIGHT 18.0 @@ -76,9 +77,6 @@ typedef enum - (void) awakeFromNib { - //get images - fAppIcon = [NSImage imageNamed: @"NSApplicationIcon"]; - //window location and size NSPanel * window = (NSPanel *)[self window]; @@ -183,6 +181,9 @@ typedef enum { if (numberSelected > 0) { + [fImageView setImage: [NSImage imageNamed: [NSApp isOnLeopardOrBetter] + ? NSImageNameMultipleDocuments : @"NSApplicationIcon"]]; + [fNameField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Torrents Selected", "Inspector -> above tabs -> selected torrents"), numberSelected]]; @@ -197,6 +198,8 @@ typedef enum } else { + [fImageView setImage: [NSImage imageNamed: @"NSApplicationIcon"]]; + [fNameField setStringValue: NSLocalizedString(@"No Torrents Selected", "Inspector -> above tabs -> selected torrents")]; [fSizeField setStringValue: @""]; @@ -230,8 +233,6 @@ typedef enum [fFileOutline setTorrent: nil]; - [fImageView setImage: fAppIcon]; - [fNameField setToolTip: nil]; [fTrackerField setStringValue: @""]; @@ -657,16 +658,7 @@ typedef enum NSDictionary * peer = [fPeers objectAtIndex: row]; if ([ident isEqualToString: @"Encryption"]) - { - if ([[peer objectForKey: @"Encryption"] boolValue]) - { - if (!fLockImage) - fLockImage = [NSImage imageNamed: @"Lock.tiff"]; - return fLockImage; - } - else - return nil; - } + return [[peer objectForKey: @"Encryption"] boolValue] ? [NSImage imageNamed: @"Lock.tiff"] : nil; else if ([ident isEqualToString: @"Client"]) return [peer objectForKey: @"Client"]; else if ([ident isEqualToString: @"Progress"]) diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 9d5ee5679..97392b5ba 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -304,22 +304,16 @@ text = [text lowercaseString]; //select torrent closest to text that isn't before text alphabetically - int row; NSEnumerator * enumerator = [tempTorrents objectEnumerator]; Torrent * torrent; while ((torrent = [enumerator nextObject])) if ([[[torrent name] lowercaseString] hasPrefix: text]) { - row = [fTorrents indexOfObject: torrent]; - break; + int row = [fTorrents indexOfObject: torrent]; + [self selectRow: row byExtendingSelection: NO]; + [self scrollRowToVisible: row]; + return; } - - //select last torrent alphabetically if no match found - if (!torrent) - row = [fTorrents indexOfObject: [tempTorrents lastObject]]; - - [self selectRow: row byExtendingSelection: NO]; - [self scrollRowToVisible: row]; } - (void) displayTorrentMenuForEvent: (NSEvent *) event