Ignore:
Timestamp:
Jun 26, 2006, 5:52:51 AM (16 years ago)
Author:
livings124
Message:

Added an option to only show the remove/quit warning if transfers are downloading (not seeding). Also change the word "torrent" to "transfer" in the prefs window.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r465 r484  
    259259    if (!fUpdateInProgress && [fDefaults boolForKey: @"CheckQuit"])
    260260    {
    261         int active = 0;
     261        int active = 0, downloading = 0;
    262262        Torrent * torrent;
    263263        NSEnumerator * enumerator = [fTorrents objectEnumerator];
    264264        while ((torrent = [enumerator nextObject]))
    265265            if ([torrent isActive])
     266            {
    266267                active++;
    267 
    268         if (active > 0)
     268                if (![torrent isSeeding])
     269                    downloading++;
     270            }
     271
     272        BOOL shouldAsk = [fDefaults boolForKey: @"CheckRemoveDownloading"] ? downloading > 0 : active > 0;
     273        if (shouldAsk)
    269274        {
    270275            NSString * message = active == 1
     
    517522{
    518523    NSArray * torrents = [[self torrentsAtIndexes: indexSet] retain];
    519     int active = 0;
    520 
    521     Torrent * torrent;
    522     NSEnumerator * enumerator = [torrents objectEnumerator];
    523     while ((torrent = [enumerator nextObject]))
    524         if ([torrent isActive])
    525             active++;
    526 
    527     if (active > 0 && [fDefaults boolForKey: @"CheckRemove"])
     524    int active = 0, downloading = 0;
     525
     526    if ([fDefaults boolForKey: @"CheckRemove"])
     527    {
     528        Torrent * torrent;
     529        NSEnumerator * enumerator = [torrents objectEnumerator];
     530        while ((torrent = [enumerator nextObject]))
     531            if ([torrent isActive])
     532            {
     533                active++;
     534                if (![torrent isSeeding])
     535                    downloading++;
     536            }
     537    }
     538
     539    BOOL shouldAsk = [fDefaults boolForKey: @"CheckRemoveDownloading"] ? downloading > 0 : active > 0;
     540    if (shouldAsk)
    528541    {
    529542        NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys:
Note: See TracChangeset for help on using the changeset viewer.