diff --git a/NEWS b/NEWS index 2750a85ab..9fa340405 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ NEWS file for Transmission 1.10 (2008/xx/yy) - Mac: + Window when adding torrents to select files and other settings + + Leopard: Reduce clutter by hiding per-torrent action button over the transfer's icon 1.01 (2008/01/11) - All Platforms: diff --git a/macosx/Controller.m b/macosx/Controller.m index c690af492..b4a17423e 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -2658,7 +2658,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi - (void) togglePiecesBar: (id) sender { [fDefaults setBool: ![fDefaults boolForKey: @"PiecesBar"] forKey: @"PiecesBar"]; - [fTableView toggleAdvancedBar]; + [fTableView togglePiecesBar]; } - (void) toggleAvailabilityBar: (id) sender diff --git a/macosx/TorrentCell.h b/macosx/TorrentCell.h index 5791fbf6c..a995334b6 100644 --- a/macosx/TorrentCell.h +++ b/macosx/TorrentCell.h @@ -41,7 +41,6 @@ NSColor * fGrayColor, * fBlueColor, * fBlue1Color, * fBlue2Color, * fBlue3Color, * fBlue4Color, * fOrangeColor; NSBitmapImageRep * fBitmap; - float fPiecesBarPercent; } - (NSRect) iconRectForBounds: (NSRect) bounds; @@ -62,6 +61,4 @@ - (void) setActionHover: (BOOL) hover; - (void) setActionIconHover: (BOOL) hover; -- (void) setPercentPiecesBar: (float) percent; - @end diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index 8a6ebd34b..dafe09b84 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -433,11 +433,6 @@ fHoverActionIcon = [NSApp isOnLeopardOrBetter] ? hover : NO; } -- (void) setPercentPiecesBar: (float) percent -{ - fPiecesBarPercent = MIN(percent, 1.0); -} - - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView { [super drawWithFrame: cellFrame inView: controlView]; @@ -596,17 +591,14 @@ - (void) drawBar: (NSRect) barRect { - if (fPiecesBarPercent > 0.0) + float piecesBarPercent = [(TorrentTableView *)[self controlView] piecesBarPercent]; + if (piecesBarPercent > 0.0) { NSRect regularBarRect = barRect, piecesBarRect = barRect; - piecesBarRect.size.height *= PIECES_TOTAL_PERCENT * fPiecesBarPercent; + piecesBarRect.size.height *= PIECES_TOTAL_PERCENT * piecesBarPercent; regularBarRect.size.height -= piecesBarRect.size.height; piecesBarRect.origin.y += regularBarRect.size.height; - /*regularBarRect.size.height -= (2.5 * fPiecesBarPercent) > 0 ? regularBarRect.size.height * (2.5 * fPiecesBarPercent) : 0.0; - piecesBarRect.origin.y += regularBarRect.size.height; - piecesBarRect.size.height -= regularBarRect.size.height;*/ - [self drawRegularBar: regularBarRect]; [self drawPiecesBar: piecesBarRect]; } diff --git a/macosx/TorrentTableView.h b/macosx/TorrentTableView.h index 35549d7d3..b0bf68fdb 100644 --- a/macosx/TorrentTableView.h +++ b/macosx/TorrentTableView.h @@ -69,6 +69,7 @@ - (void) checkFile: (id) sender; -- (void) toggleAdvancedBar; +- (void) togglePiecesBar; +- (float) piecesBarPercent; @end diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 3b39fc479..a95dac6ea 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -97,8 +97,6 @@ [cell setRevealHover: row == fMouseRevealRow]; [cell setActionHover: row == fMouseActionRow]; [cell setActionIconHover: row == fMouseActionIconRow]; - - [cell setPercentPiecesBar: fPiecesBarPercent]; } - (NSString *) tableView: (NSTableView *) tableView typeSelectStringForTableColumn: (NSTableColumn *) tableColumn row: (int) row @@ -331,10 +329,8 @@ //sort torrents by name before finding closest match NSSortDescriptor * nameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"name" ascending: YES selector: @selector(caseInsensitiveCompare:)] autorelease]; - NSArray * descriptors = [[NSArray alloc] initWithObjects: nameDescriptor, nil]; - NSArray * tempTorrents = [fTorrents sortedArrayUsingDescriptors: descriptors]; - [descriptors release]; + NSArray * tempTorrents = [fTorrents sortedArrayUsingDescriptors: [NSArray arrayWithObject: nameDescriptor]]; text = [text lowercaseString]; @@ -554,7 +550,7 @@ [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil]; } -- (void) toggleAdvancedBar +- (void) togglePiecesBar { [self resizePiecesBarIncrement]; @@ -567,6 +563,11 @@ } } +- (float) piecesBarPercent +{ + return fPiecesBarPercent; +} + @end @implementation TorrentTableView (Private)