Ignore:
Timestamp:
Mar 5, 2009, 1:23:19 AM (13 years ago)
Author:
livings124
Message:

allow the new limit checks to show a mixed state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r8023 r8024  
    542542                || globalUseSpeedLimit != NSMixedState))
    543543    {
    544         if (uploadUseSpeedLimit != INVALID && uploadUseSpeedLimit != ([torrent usesSpeedLimit: YES] ? NSOnState : NSOffState))
     544        if (uploadUseSpeedLimit != NSMixedState && uploadUseSpeedLimit != ([torrent usesSpeedLimit: YES] ? NSOnState : NSOffState))
    545545            uploadUseSpeedLimit = NSMixedState;
    546546       
     
    548548            uploadSpeedLimit = INVALID;
    549549       
    550         if (downloadUseSpeedLimit != INVALID && downloadUseSpeedLimit != ([torrent usesSpeedLimit: NO] ? NSOnState : NSOffState))
     550        if (downloadUseSpeedLimit != NSMixedState && downloadUseSpeedLimit != ([torrent usesSpeedLimit: NO] ? NSOnState : NSOffState))
    551551            downloadUseSpeedLimit = NSMixedState;
    552552       
     
    554554            downloadSpeedLimit = INVALID;
    555555       
    556         if (globalUseSpeedLimit != INVALID && globalUseSpeedLimit != ([torrent usesGlobalSpeedLimit] ? NSOnState : NSOffState))
     556        if (globalUseSpeedLimit != NSMixedState && globalUseSpeedLimit != ([torrent usesGlobalSpeedLimit] ? NSOnState : NSOffState))
    557557            globalUseSpeedLimit = NSMixedState;
    558558    }
     
    11811181{
    11821182    const BOOL upload = sender == fUploadLimitCheck;
     1183   
     1184    if ([sender state] == NSMixedState)
     1185        [sender setState: NSOnState];
    11831186    const BOOL limit = [sender state] == NSOnState;
    11841187   
     
    11981201}
    11991202
     1203- (void) setUseGlobalSpeedLimit: (id) sender
     1204{
     1205    if ([sender state] == NSMixedState)
     1206        [sender setState: NSOnState];
     1207    const BOOL limit = [sender state] == NSOnState;
     1208   
     1209    for (Torrent * torrent in fTorrents)
     1210        [torrent setUseGlobalSpeedLimit: limit];
     1211}
     1212
    12001213- (void) setSpeedLimit: (id) sender
    12011214{
    1202     BOOL upload = sender == fUploadLimitField;
    1203     NSInteger limit = [sender intValue];
     1215    const BOOL upload = sender == fUploadLimitField;
     1216    const NSInteger limit = [sender intValue];
    12041217   
    12051218    for (Torrent * torrent in fTorrents)
     
    12361249        [[self window] makeKeyAndOrderFront: self];
    12371250    }
    1238 }
    1239 
    1240 - (void) setUseGlobalSpeedLimit: (id) sender
    1241 {
    1242     const BOOL limit = [sender state] == NSOnState;
    1243    
    1244     for (Torrent * torrent in fTorrents)
    1245         [torrent setUseGlobalSpeedLimit: limit];
    12461251}
    12471252
Note: See TracChangeset for help on using the changeset viewer.