mirror of
https://github.com/transmission/transmission
synced 2025-03-04 02:28:03 +00:00
more unused code removal, update NEWS
This commit is contained in:
parent
ced900ea12
commit
c67b781fcb
6 changed files with 30 additions and 44 deletions
4
NEWS
4
NEWS
|
@ -1,5 +1,9 @@
|
|||
NEWS file for Transmission <http://www.transmissionbt.com/>
|
||||
|
||||
1.20 (2008/xx/yy)
|
||||
- Mac
|
||||
+ Display of decimal numbers matches system international settings
|
||||
|
||||
1.10 (2008/xx/yy)
|
||||
- All Platforms
|
||||
+ Stop torrents when downloading and the disk becomes full
|
||||
|
|
|
@ -40,29 +40,29 @@
|
|||
+ (NSString *) stringForFileSize: (uint64_t) size
|
||||
{
|
||||
if (size < 1024)
|
||||
return [NSString stringWithFormat: NSLocalizedString(@"%lld bytes", "File size"), size];
|
||||
return [NSString stringWithFormat: @"%lld %@", size, NSLocalizedString(@"bytes", "File size - bytes")];
|
||||
|
||||
float convertedSize;
|
||||
NSString * unit;
|
||||
if (size < 1048576)
|
||||
{
|
||||
convertedSize = size / 1024.0;
|
||||
unit = NSLocalizedString(@"KB", "File size");
|
||||
unit = NSLocalizedString(@"KB", "File size - kilobytes");
|
||||
}
|
||||
else if (size < 1073741824)
|
||||
{
|
||||
convertedSize = size / 1048576.0;
|
||||
unit = NSLocalizedString(@"MB", "File size");
|
||||
unit = NSLocalizedString(@"MB", "File size - megabytes");
|
||||
}
|
||||
else if (size < 1099511627776.0)
|
||||
{
|
||||
convertedSize = size / 1073741824.0;
|
||||
unit = NSLocalizedString(@"GB", "File size");
|
||||
unit = NSLocalizedString(@"GB", "File size - gigabytes");
|
||||
}
|
||||
else
|
||||
{
|
||||
convertedSize = size / 1099511627776.0;
|
||||
unit = NSLocalizedString(@"TB", "File size");
|
||||
unit = NSLocalizedString(@"TB", "File size - terabytes");
|
||||
}
|
||||
|
||||
//attempt to have minimum of 3 digits with at least 1 decimal
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
@interface PeerProgressIndicatorCell : NSLevelIndicatorCell
|
||||
{
|
||||
BOOL fIsHidden;
|
||||
NSDictionary * fAttributes;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,47 +40,33 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL) hidden
|
||||
{
|
||||
return fIsHidden;
|
||||
}
|
||||
|
||||
- (void) setHidden: (BOOL) isHidden
|
||||
{
|
||||
fIsHidden = isHidden;
|
||||
}
|
||||
|
||||
- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
|
||||
{
|
||||
if (!fIsHidden)
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey: @"DisplayPeerProgressBarNumber"])
|
||||
{
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey: @"DisplayPeerProgressBarNumber"])
|
||||
if (!fAttributes)
|
||||
fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSFont systemFontOfSize: 11.0], NSFontAttributeName, nil];
|
||||
[[NSString localizedStringWithFormat: @"%.1f%%", [self floatValue] * 100.0] drawInRect: cellFrame withAttributes: fAttributes];
|
||||
}
|
||||
else
|
||||
{
|
||||
//attributes not needed anymore
|
||||
if (fAttributes)
|
||||
{
|
||||
if (!fAttributes)
|
||||
fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSFont systemFontOfSize: 11.0], NSFontAttributeName, nil];
|
||||
[[NSString localizedStringWithFormat: @"%.1f%%", [self floatValue] * 100.0] drawInRect: cellFrame
|
||||
withAttributes: fAttributes];
|
||||
[fAttributes release];
|
||||
fAttributes = nil;
|
||||
}
|
||||
else
|
||||
|
||||
[super drawWithFrame: cellFrame inView: controlView];
|
||||
if ([self floatValue] >= 1.0)
|
||||
{
|
||||
//attributes not needed anymore
|
||||
if (fAttributes)
|
||||
{
|
||||
[fAttributes release];
|
||||
fAttributes = nil;
|
||||
}
|
||||
NSImage * checkImage = [NSImage imageNamed: @"CompleteCheck.png"];
|
||||
[checkImage setFlipped: YES];
|
||||
|
||||
[super drawWithFrame: cellFrame inView: controlView];
|
||||
if ([self floatValue] >= 1.0)
|
||||
{
|
||||
NSImage * checkImage = [NSImage imageNamed: @"CompleteCheck.png"];
|
||||
[checkImage setFlipped: YES];
|
||||
|
||||
NSSize imageSize = [checkImage size];
|
||||
NSRect rect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - imageSize.width) * 0.5,
|
||||
cellFrame.origin.y + (cellFrame.size.height - imageSize.height) * 0.5, imageSize.width, imageSize.height);
|
||||
[checkImage drawInRect: rect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
|
||||
}
|
||||
NSSize imageSize = [checkImage size];
|
||||
NSRect rect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - imageSize.width) * 0.5,
|
||||
cellFrame.origin.y + (cellFrame.size.height - imageSize.height) * 0.5, imageSize.width, imageSize.height);
|
||||
[checkImage drawInRect: rect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,5 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface PeerTableView : NSTableView
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -25,7 +25,5 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface ToolbarSegmentedCell : NSSegmentedCell
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Reference in a new issue