mirror of
https://github.com/transmission/transmission
synced 2025-02-03 13:03:50 +00:00
a little code cleanup
This commit is contained in:
parent
4fb7db8348
commit
af357140db
1 changed files with 12 additions and 18 deletions
|
@ -63,19 +63,13 @@
|
||||||
|
|
||||||
@implementation InfoWindowController
|
@implementation InfoWindowController
|
||||||
|
|
||||||
- (id) initWithWindowNibName: (NSString *) name
|
|
||||||
{
|
|
||||||
if ((self = [super initWithWindowNibName: name]))
|
|
||||||
{
|
|
||||||
fAppIcon = [NSImage imageNamed: @"NSApplicationIcon"];
|
|
||||||
fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"];
|
|
||||||
fDotRed = [NSImage imageNamed: @"RedDot.tiff"];
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) awakeFromNib
|
- (void) awakeFromNib
|
||||||
{
|
{
|
||||||
|
//get images
|
||||||
|
fAppIcon = [NSImage imageNamed: @"NSApplicationIcon"];
|
||||||
|
fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"];
|
||||||
|
fDotRed = [NSImage imageNamed: @"RedDot.tiff"];
|
||||||
|
|
||||||
//window location and size
|
//window location and size
|
||||||
NSPanel * window = (NSPanel *)[self window];
|
NSPanel * window = (NSPanel *)[self window];
|
||||||
|
|
||||||
|
@ -873,14 +867,17 @@
|
||||||
if (tableView == fPeerTable)
|
if (tableView == fPeerTable)
|
||||||
{
|
{
|
||||||
NSDictionary * peer = [fPeers objectAtIndex: row];
|
NSDictionary * peer = [fPeers objectAtIndex: row];
|
||||||
BOOL connected = [[peer objectForKey: @"Connected"] boolValue];
|
NSMutableArray * components = [NSMutableArray arrayWithCapacity: 4];
|
||||||
|
|
||||||
NSMutableArray * components = [NSMutableArray arrayWithCapacity: connected ? 4 : 2];
|
if ([[peer objectForKey: @"Connected"] boolValue])
|
||||||
|
{
|
||||||
if (connected)
|
|
||||||
[components addObject: [NSString stringWithFormat:
|
[components addObject: [NSString stringWithFormat:
|
||||||
NSLocalizedString(@"Progress: %.1f%%", "Inspector -> Peers tab -> table row tooltip"),
|
NSLocalizedString(@"Progress: %.1f%%", "Inspector -> Peers tab -> table row tooltip"),
|
||||||
[[peer objectForKey: @"Progress"] floatValue] * 100.0]];
|
[[peer objectForKey: @"Progress"] floatValue] * 100.0]];
|
||||||
|
|
||||||
|
/*if ([[peer objectForKey: @"Encryption"] boolValue])
|
||||||
|
[components addObject: NSLocalizedString(@"Encrypted Connection", "Inspector -> Peers tab -> table row tooltip")];*/
|
||||||
|
}
|
||||||
|
|
||||||
int port;
|
int port;
|
||||||
if ((port = [[peer objectForKey: @"Port"] intValue]) > 0)
|
if ((port = [[peer objectForKey: @"Port"] intValue]) > 0)
|
||||||
|
@ -899,9 +896,6 @@
|
||||||
else
|
else
|
||||||
[components addObject: NSLocalizedString(@"From: tracker", "Inspector -> Peers tab -> table row tooltip")];
|
[components addObject: NSLocalizedString(@"From: tracker", "Inspector -> Peers tab -> table row tooltip")];
|
||||||
|
|
||||||
/*if (connected && [[peer objectForKey: @"Encryption"] boolValue])
|
|
||||||
[components addObject: @"Encrypted Connection"];*/
|
|
||||||
|
|
||||||
return [components componentsJoinedByString: @"\n"];
|
return [components componentsJoinedByString: @"\n"];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
|
|
Loading…
Reference in a new issue