1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

Save minimal status text preference (speed or time)

This commit is contained in:
Mitchell Livingston 2006-07-25 01:23:40 +00:00
parent d4f3ac6ae2
commit 1550251be9
3 changed files with 11 additions and 6 deletions

View file

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key></key>
<string></string>
<key>AutoImport</key>
<false/>
<key>AutoImportDirectory</key>
@ -58,6 +60,8 @@
<true/>
<key>ShowInspector</key>
<false/>
<key>SmallStatusRegular</key>
<true/>
<key>SmallView</key>
<false/>
<key>Sort</key>

View file

@ -31,7 +31,7 @@
@interface TorrentCell : NSCell
{
Torrent * fTorrent;
BOOL fNormalStatus;
BOOL fStatusRegular;
NSUserDefaults * fDefaults;
}

View file

@ -63,9 +63,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
{
if ((self = [super init]))
{
fNormalStatus = YES;
fDefaults = [NSUserDefaults standardUserDefaults];
fStatusRegular = [fDefaults boolForKey: @"SmallStatusRegular"];
NSSize startSize = NSMakeSize(100.0, BAR_HEIGHT);
if (!fProgressWhite)
@ -284,7 +284,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
- (void) toggleMinimalStatus
{
fNormalStatus = !fNormalStatus;
fStatusRegular = !fStatusRegular;
[fDefaults setBool: fStatusRegular forKey: @"SmallStatusRegular"];
}
- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) view
@ -362,8 +363,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
//name and status string
float mainWidth = cellFrame.size.width - iconSize.width - 3.0 * PADDING - EXTRA_NAME_SHIFT;
NSString * realStatusString = !fNormalStatus && [fTorrent isActive] && [fTorrent progress] < 1.0
? [fTorrent remainingTimeString] : [fTorrent shortStatusString];
NSString * realStatusString = !fStatusRegular && [fTorrent isActive] && [fTorrent progress] < 1.0
? [fTorrent remainingTimeString] : [fTorrent shortStatusString];
NSAttributedString * statusString = [[[NSAttributedString alloc] initWithString: realStatusString
attributes: statusAttributes] autorelease];