From 878aa6828b7a73822b36111cbf0af7ffda1d865a Mon Sep 17 00:00:00 2001 From: Eric Petit Date: Sat, 11 Feb 2006 06:46:40 +0000 Subject: [PATCH] When both torrent and non-torrent files are dropped, only open the torrents. Don't badge with completed downloads when the window is key. Update the table right after start so you don't stay with an empty list for one second. --- macosx/Controller.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index 394c4c268..0bb65038c 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -144,8 +144,9 @@ static void sleepCallBack( void * controller, io_service_t y, fSeeding = 0; fCompleted = 0; fStat = nil; + [self updateUI: nil]; fTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target: self - selector: @selector( updateUI: ) userInfo: NULL repeats: YES]; + selector: @selector( updateUI: ) userInfo: nil repeats: YES]; [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode]; [[NSRunLoop currentRunLoop] addTimer: fTimer @@ -154,7 +155,7 @@ static void sleepCallBack( void * controller, io_service_t y, [self checkForUpdateTimer: nil]; fUpdateTimer = [NSTimer scheduledTimerWithTimeInterval: 60.0 target: self selector: @selector( checkForUpdateTimer: ) - userInfo: NULL repeats: YES]; + userInfo: nil repeats: YES]; } - (void) windowDidBecomeKey: (NSNotification *) n @@ -583,7 +584,8 @@ static void sleepCallBack( void * controller, io_service_t y, if( !tr_getFinished( fHandle, i ) ) continue; - fCompleted++; + if( ![fWindow isKeyWindow] ) + fCompleted++; [self notifyGrowl: [NSString stringWithUTF8String: fStat[i].info.name]]; tr_setFinished( fHandle, i, 0 ); @@ -650,8 +652,9 @@ static void sleepCallBack( void * controller, io_service_t y, (id ) info row: (int) row dropOperation: (NSTableViewDropOperation) operation { - [self application: NSApp openFiles: [[info draggingPasteboard] - propertyListForType: NSFilenamesPboardType]]; + [self application: NSApp openFiles: [[[info draggingPasteboard] + propertyListForType: NSFilenamesPboardType] + pathsMatchingExtensions: [NSArray arrayWithObject: @"torrent"]]]; return YES; }