1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-30 19:03:04 +00:00

Update 2005-12-14

This commit is contained in:
Eric Petit 2006-01-12 18:53:05 +00:00
parent 616ae26efa
commit 04293edb67
6 changed files with 31 additions and 12 deletions

View file

@ -15,6 +15,9 @@ Michael Demars <keul@m0k.org>
+ Growl notifications
+ AppleScript support
Bryan Varner <bryan@varnernet.com>
+ BeOS interface
Thanks to:

View file

@ -620,13 +620,16 @@ static void sleepCallBack( void * controller, io_service_t y,
- (void) tableView: (NSTableView *) t willDisplayCell: (id) cell
forTableColumn: (NSTableColumn *) tableColumn row: (int) rowIndex
{
BOOL w;
w = [fWindow isKeyWindow] && rowIndex == [fTableView selectedRow];
if( [[tableColumn identifier] isEqualToString: @"Name"] )
{
[(NameCell *) cell setStat: &fStat[rowIndex]];
[(NameCell *) cell setStat: &fStat[rowIndex] whiteText: w];
}
else if( [[tableColumn identifier] isEqualToString: @"Progress"] )
{
[(ProgressCell *) cell setStat: &fStat[rowIndex]];
[(ProgressCell *) cell setStat: &fStat[rowIndex] whiteText: w];
}
}

View file

@ -29,12 +29,14 @@
@interface NameCell : NSCell
{
BOOL fWhiteText;
NSString * fNameString;
NSString * fSizeString;
NSString * fTimeString;
NSString * fPeersString;
}
- (void) setStat: (tr_stat_t *) stat;
- (void) setStat: (tr_stat_t *) stat whiteText: (BOOL) w;
@end
#endif

View file

@ -25,8 +25,10 @@
@implementation NameCell
- (void) setStat: (tr_stat_t *) stat
- (void) setStat: (tr_stat_t *) stat whiteText: (BOOL) w
{
fWhiteText = w;
fNameString = [NSString stringWithUTF8String: stat->info.name];
fSizeString = [NSString stringWithFormat: @" (%@)",
stringForFileSize( stat->info.totalSize )];
@ -95,8 +97,11 @@
pen = cellFrame.origin;
attributes = [NSMutableDictionary dictionaryWithCapacity: 1];
[attributes setObject: [NSFont messageFontOfSize:12.0]
attributes = [NSMutableDictionary dictionaryWithCapacity: 2];
[attributes setObject: fWhiteText ? [NSColor whiteColor] :
[NSColor blackColor] forKey: NSForegroundColorAttributeName];
[attributes setObject: [NSFont messageFontOfSize: 12.0]
forKey: NSFontAttributeName];
pen.x += 5; pen.y += 5;
@ -105,7 +110,7 @@
35 - widthForString( fSizeString, 12 ), 12 ), fSizeString];
[string drawAtPoint: pen withAttributes: attributes];
[attributes setObject: [NSFont messageFontOfSize:10.0]
[attributes setObject: [NSFont messageFontOfSize: 10.0]
forKey: NSFontAttributeName];
pen.x += 5; pen.y += 20;

View file

@ -29,6 +29,7 @@
@interface ProgressCell : NSCell
{
tr_stat_t * fStat;
BOOL fWhiteText;
NSString * fDlString;
NSString * fUlString;
@ -37,7 +38,7 @@
NSBitmapImageRep * fProgressBmp;
}
- (id) init;
- (void) setStat: (tr_stat_t *) stat;
- (void) setStat: (tr_stat_t *) stat whiteText: (BOOL) w;
- (void) buildSimpleBar;
- (void) buildAdvancedBar;
- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) view;

View file

@ -112,12 +112,13 @@ static uint32_t kGreen[] =
***********************************************************************
* Readies ourselves to draw updated info.
**********************************************************************/
- (void) setStat: (tr_stat_t *) stat
- (void) setStat: (tr_stat_t *) stat whiteText: (BOOL) w
{
int i;
uint8_t * in, * out;
fStat = stat;
fStat = stat;
fWhiteText = w;
/* Update the strings to be displayed */
fDlString = [NSString stringWithFormat:
@ -283,8 +284,12 @@ static uint32_t kGreen[] =
[img release];
/* Draw the strings with font 10 */
attributes = [NSDictionary dictionaryWithObject:
[NSFont messageFontOfSize: 10.0] forKey: NSFontAttributeName];
attributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSFont messageFontOfSize: 10.0],
NSFontAttributeName,
fWhiteText ? [NSColor whiteColor] : [NSColor blackColor],
NSForegroundColorAttributeName,
NULL];
pen.x += 5; pen.y += 20;
[fDlString drawAtPoint: pen withAttributes: attributes];
pen.x += 0; pen.y += 15;