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 + Growl notifications
+ AppleScript support + AppleScript support
Bryan Varner <bryan@varnernet.com>
+ BeOS interface
Thanks to: Thanks to:

View file

@ -620,13 +620,16 @@ static void sleepCallBack( void * controller, io_service_t y,
- (void) tableView: (NSTableView *) t willDisplayCell: (id) cell - (void) tableView: (NSTableView *) t willDisplayCell: (id) cell
forTableColumn: (NSTableColumn *) tableColumn row: (int) rowIndex forTableColumn: (NSTableColumn *) tableColumn row: (int) rowIndex
{ {
BOOL w;
w = [fWindow isKeyWindow] && rowIndex == [fTableView selectedRow];
if( [[tableColumn identifier] isEqualToString: @"Name"] ) if( [[tableColumn identifier] isEqualToString: @"Name"] )
{ {
[(NameCell *) cell setStat: &fStat[rowIndex]]; [(NameCell *) cell setStat: &fStat[rowIndex] whiteText: w];
} }
else if( [[tableColumn identifier] isEqualToString: @"Progress"] ) 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 @interface NameCell : NSCell
{ {
BOOL fWhiteText;
NSString * fNameString; NSString * fNameString;
NSString * fSizeString; NSString * fSizeString;
NSString * fTimeString; NSString * fTimeString;
NSString * fPeersString; NSString * fPeersString;
} }
- (void) setStat: (tr_stat_t *) stat; - (void) setStat: (tr_stat_t *) stat whiteText: (BOOL) w;
@end @end
#endif #endif

View file

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

View file

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

View file

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