add a control to the pieces view

This commit is contained in:
Mitchell Livingston
2007-06-20 23:53:09 +00:00
parent 54ec3716cc
commit 8547e53c79
7 changed files with 38 additions and 33 deletions

View File

@@ -134,10 +134,6 @@
[bp fill];
[fBluePiece unlockFocus];
[self setToolTip: [[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"]
? NSLocalizedString(@"Piece Availability", "Inspector -> Activity -> detailed pieces view tooltip")
: NSLocalizedString(@"Piece Progress", "Inspector -> Activity -> detailed pieces view tooltip")];
//actually draw the box
[self setTorrent: nil];
}
@@ -193,8 +189,11 @@
[self updateView: YES];
}
[self setHidden: torrent == nil];
else
{
[self setImage: [[fBack copy] autorelease]];
[self setNeedsDisplay];
}
}
- (void) updateView: (BOOL) first
@@ -376,25 +375,4 @@
free(piecesPercent);
}
- (BOOL) acceptsFirstMouse: (NSEvent *) event
{
return YES;
}
- (void) mouseDown: (NSEvent *) event
{
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
BOOL showAvailability = ![defaults boolForKey: @"PiecesViewShowAvailability"];
[defaults setBool: showAvailability forKey: @"PiecesViewShowAvailability"];
[self setToolTip: showAvailability
? NSLocalizedString(@"Piece Availability", "Inspector -> Activity -> detailed pieces view tooltip")
: NSLocalizedString(@"Piece Progress", "Inspector -> Activity -> detailed pieces view tooltip")];
[self updateView: YES];
[super mouseDown: event];
}
@end