show the multiple document icon on Leopard when multiple files selected

This commit is contained in:
Mitchell Livingston 2007-10-27 18:40:43 +00:00
parent 35303821d1
commit 04b3a94ca0
3 changed files with 11 additions and 26 deletions

View File

@ -32,7 +32,6 @@
@interface InfoWindowController : NSWindowController
{
NSArray * fTorrents, * fPeers, * fFiles;
NSImage * fAppIcon, * fLockImage;
IBOutlet NSView * fInfoView, * fActivityView, * fPeersView, * fFilesView, * fOptionsView;
int fCurrentTabTag;

View File

@ -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"])

View File

@ -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