Changeset 707
- Timestamp:
- Jul 30, 2006, 6:37:29 PM (16 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.h
r706 r707 132 132 133 133 - (void) updateUI: (NSTimer *) timer; 134 - (void) torrentFinishedDownloading: (NSNotification *) notification; 134 135 - (void) updateTorrentHistory; 135 136 -
trunk/macosx/Controller.m
r706 r707 285 285 //observe notifications 286 286 NSNotificationCenter * nc = [NSNotificationCenter defaultCenter]; 287 288 [nc addObserver: self selector: @selector(torrentFinishedDownloading:) 289 name: @"TorrentFinishedDownloading" object: nil]; 287 290 288 291 [nc addObserver: self selector: @selector(updateControlTint:) … … 840 843 - (void) updateUI: (NSTimer *) t 841 844 { 842 NSEnumerator * enumerator = [fTorrents objectEnumerator]; 843 Torrent * torrent; 844 while ((torrent = [enumerator nextObject])) 845 { 846 [torrent update]; 847 848 if ([torrent justFinished]) 849 { 850 [self applyFilter: nil]; 851 [self checkToStartWaiting: torrent]; 852 853 [GrowlApplicationBridge notifyWithTitle: @"Download Complete" 854 description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE iconData: nil 855 priority: 0 isSticky: NO clickContext: nil]; 856 857 if (![fWindow isKeyWindow]) 858 fCompleted++; 859 } 860 } 845 [fTorrents makeObjectsPerformSelector: @selector(update)]; 861 846 862 847 if ([fSortType isEqualToString: @"Progress"] || [fSortType isEqualToString: @"State"]) … … 879 864 //badge dock 880 865 [fBadger updateBadgeWithCompleted: fCompleted uploadRate: uploadRate downloadRate: downloadRate]; 866 } 867 868 - (void) torrentFinishedDownloading: (NSNotification *) notification 869 { 870 Torrent * torrent = [notification object]; 871 872 [self applyFilter: nil]; 873 [self checkToStartWaiting: torrent]; 874 875 [GrowlApplicationBridge notifyWithTitle: @"Download Complete" description: [torrent name] 876 notificationName: GROWL_DOWNLOAD_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: nil]; 877 878 if (![fWindow isKeyWindow]) 879 fCompleted++; 881 880 } 882 881 … … 1312 1311 [fInfoController updateInfoStatsAndSettings]; 1313 1312 1314 [GrowlApplicationBridge notifyWithTitle: @"Seeding Complete" 1315 description: [[notification object] name] notificationName: GROWL_SEEDING_COMPLETE 1316 iconData: nil priority: 0 isSticky: NO clickContext: nil]; 1313 [GrowlApplicationBridge notifyWithTitle: @"Seeding Complete" description: [[notification object] name] 1314 notificationName: GROWL_SEEDING_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: nil]; 1317 1315 } 1318 1316 … … 1421 1419 //import only actually happened if the torrent array is larger 1422 1420 if (oldCount < [fTorrents count]) 1423 [GrowlApplicationBridge notifyWithTitle: @"Torrent File Auto Added" 1424 description: file notificationName: GROWL_AUTO_ADD iconData: nil 1425 priority: 0 isSticky: NO clickContext: nil]; 1421 [GrowlApplicationBridge notifyWithTitle: @"Torrent File Auto Added" description: file 1422 notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO clickContext: nil]; 1426 1423 } 1427 1424 } -
trunk/macosx/Torrent.m
r700 r707 144 144 fStat = tr_torrentStat(fHandle); 145 145 146 //notification when downloading finished 147 if ([self justFinished]) 148 [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self]; 149 146 150 //check to stop for ratio 147 151 if ([self isSeeding] && ((fStopRatioSetting == RATIO_CHECK && [self ratio] >= fRatioLimit)
Note: See TracChangeset
for help on using the changeset viewer.