Changeset 5609
- Timestamp:
- Apr 14, 2008, 12:05:16 AM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.h
r5578 r5609 195 195 - (void) torrentFinishedDownloading: (NSNotification *) notification; 196 196 - (void) torrentRestartedDownloading: (NSNotification *) notification; 197 - (void) torrentStoppedForRatio: (NSNotification *) notification; 197 198 198 199 - (void) updateTorrentHistory; … … 228 229 - (void) setQuickRatioGlobal: (id) sender; 229 230 230 - (void) torrentStoppedForRatio: (NSNotification *) notification;231 232 231 - (void) changeAutoImport; 233 232 - (void) checkAutoImportDirectory; -
trunk/macosx/Controller.m
r5588 r5609 1594 1594 } 1595 1595 1596 #warning migrate to Torrent.m 1596 1597 - (void) torrentFinishedDownloading: (NSNotification *) notification 1597 1598 { 1598 1599 Torrent * torrent = [notification object]; 1599 1600 1600 if (!fSoundPlaying && [fDefaults boolForKey: @"PlayDownloadSound"]) 1601 if ([torrent isActive]) 1602 { 1603 if (!fSoundPlaying && [fDefaults boolForKey: @"PlayDownloadSound"]) 1604 { 1605 NSSound * sound; 1606 if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"DownloadSound"]])) 1607 { 1608 [sound setDelegate: self]; 1609 fSoundPlaying = YES; 1610 [sound play]; 1611 } 1612 } 1613 1614 NSDictionary * clickContext = [NSDictionary dictionaryWithObjectsAndKeys: GROWL_DOWNLOAD_COMPLETE, @"Type", 1615 [torrent dataLocation] , @"Location", nil]; 1616 [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Download Complete", "Growl notification title") 1617 description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE 1618 iconData: nil priority: 0 isSticky: NO clickContext: clickContext]; 1619 1620 if (![fWindow isMainWindow]) 1621 [fBadger incrementCompleted]; 1622 1623 if ([fDefaults boolForKey: @"QueueSeed"] && [self numToStartFromQueue: NO] <= 0) 1624 { 1625 [torrent stopTransfer]; 1626 [torrent setWaitToStart: YES]; 1627 } 1628 } 1629 1630 [self updateTorrentsInQueue]; 1631 } 1632 1633 - (void) torrentRestartedDownloading: (NSNotification *) notification 1634 { 1635 Torrent * torrent = [notification object]; 1636 if ([torrent isActive]) 1637 { 1638 if ([fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] <= 0) 1639 { 1640 [torrent stopTransfer]; 1641 [torrent setWaitToStart: YES]; 1642 } 1643 } 1644 1645 [self updateTorrentsInQueue]; 1646 } 1647 1648 - (void) torrentStoppedForRatio: (NSNotification *) notification 1649 { 1650 Torrent * torrent = [notification object]; 1651 1652 [self updateTorrentsInQueue]; 1653 [fInfoController updateInfoStats]; 1654 [fInfoController updateOptions]; 1655 1656 if (!fSoundPlaying && [fDefaults boolForKey: @"PlaySeedingSound"]) 1601 1657 { 1602 1658 NSSound * sound; 1603 if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @" DownloadSound"]]))1659 if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"SeedingSound"]])) 1604 1660 { 1605 1661 [sound setDelegate: self]; … … 1609 1665 } 1610 1666 1611 NSDictionary * clickContext = [NSDictionary dictionaryWithObjectsAndKeys: GROWL_DOWNLOAD_COMPLETE, @"Type", 1612 [torrent dataLocation] , @"Location", nil]; 1613 [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Download Complete", "Growl notification title") 1614 description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE 1615 iconData: nil priority: 0 isSticky: NO clickContext: clickContext]; 1616 1617 if (![fWindow isMainWindow]) 1618 [fBadger incrementCompleted]; 1619 1620 if ([torrent isActive]) 1621 { 1622 if ([fDefaults boolForKey: @"QueueSeed"] && [self numToStartFromQueue: NO] <= 0) 1623 { 1624 [torrent stopTransfer]; 1625 [torrent setWaitToStart: YES]; 1626 } 1627 } 1628 1629 [self updateTorrentsInQueue]; 1630 } 1631 1632 - (void) torrentRestartedDownloading: (NSNotification *) notification 1633 { 1634 Torrent * torrent = [notification object]; 1635 if ([torrent isActive]) 1636 { 1637 if ([fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] <= 0) 1638 { 1639 [torrent stopTransfer]; 1640 [torrent setWaitToStart: YES]; 1641 } 1642 } 1643 1644 [self updateTorrentsInQueue]; 1667 NSDictionary * clickContext = [NSDictionary dictionaryWithObjectsAndKeys: GROWL_SEEDING_COMPLETE, @"Type", 1668 [torrent dataLocation], @"Location", nil]; 1669 [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Seeding Complete", "Growl notification title") 1670 description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE 1671 iconData: nil priority: 0 isSticky: NO clickContext: clickContext]; 1645 1672 } 1646 1673 … … 2342 2369 } 2343 2370 2344 - (void) torrentStoppedForRatio: (NSNotification *) notification2345 {2346 Torrent * torrent = [notification object];2347 2348 [self updateTorrentsInQueue];2349 [fInfoController updateInfoStats];2350 [fInfoController updateOptions];2351 2352 if (!fSoundPlaying && [fDefaults boolForKey: @"PlaySeedingSound"])2353 {2354 NSSound * sound;2355 if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"SeedingSound"]]))2356 {2357 [sound setDelegate: self];2358 fSoundPlaying = YES;2359 [sound play];2360 }2361 }2362 2363 NSDictionary * clickContext = [NSDictionary dictionaryWithObjectsAndKeys: GROWL_SEEDING_COMPLETE, @"Type",2364 [torrent dataLocation], @"Location", nil];2365 [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Seeding Complete", "Growl notification title")2366 description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE2367 iconData: nil priority: 0 isSticky: NO clickContext: clickContext];2368 }2369 2370 2371 - (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) finishedPlaying 2371 2372 {
Note: See TracChangeset
for help on using the changeset viewer.