update NEWS, clean up pieces bar toggle code
This commit is contained in:
parent
5965d8d1ae
commit
50a90c3460
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@ NEWS file for Transmission <http://transmission.m0k.org/>
|
|||
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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
|
||||
- (void) checkFile: (id) sender;
|
||||
|
||||
- (void) toggleAdvancedBar;
|
||||
- (void) togglePiecesBar;
|
||||
- (float) piecesBarPercent;
|
||||
|
||||
@end
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue