Changeset 5609


Ignore:
Timestamp:
Apr 14, 2008, 12:05:16 AM (14 years ago)
Author:
livings124
Message:

when unchecking all files in the add dialog window, don't do finished events

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r5578 r5609  
    195195- (void) torrentFinishedDownloading: (NSNotification *) notification;
    196196- (void) torrentRestartedDownloading: (NSNotification *) notification;
     197- (void) torrentStoppedForRatio: (NSNotification *) notification;
    197198
    198199- (void) updateTorrentHistory;
     
    228229- (void) setQuickRatioGlobal: (id) sender;
    229230
    230 - (void) torrentStoppedForRatio: (NSNotification *) notification;
    231 
    232231- (void) changeAutoImport;
    233232- (void) checkAutoImportDirectory;
  • trunk/macosx/Controller.m

    r5588 r5609  
    15941594}
    15951595
     1596#warning migrate to Torrent.m
    15961597- (void) torrentFinishedDownloading: (NSNotification *) notification
    15971598{
    15981599    Torrent * torrent = [notification object];
    15991600   
    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"])
    16011657    {
    16021658        NSSound * sound;
    1603         if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"DownloadSound"]]))
     1659        if ((sound = [NSSound soundNamed: [fDefaults stringForKey: @"SeedingSound"]]))
    16041660        {
    16051661            [sound setDelegate: self];
     
    16091665    }
    16101666   
    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];
    16451672}
    16461673
     
    23422369}
    23432370
    2344 - (void) torrentStoppedForRatio: (NSNotification *) notification
    2345 {
    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_COMPLETE
    2367                         iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
    2368 }
    2369 
    23702371- (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) finishedPlaying
    23712372{
Note: See TracChangeset for help on using the changeset viewer.