Ignore:
Timestamp:
Sep 25, 2006, 6:37:45 PM (15 years ago)
Author:
joshe
Message:

Merge nat-traversal branch to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r842 r920  
    4444#define TAB_PEERS_HEIGHT 255.0
    4545#define TAB_FILES_HEIGHT 255.0
    46 #define TAB_OPTIONS_HEIGHT 116.0
     46#define TAB_OPTIONS_HEIGHT 83.0
    4747
    4848@interface InfoWindowController (Private)
     
    210210   
    211211    //update stats and settings
    212     [self updateInfoStatsAndSettings];
     212    [self updateInfoStats];
     213    [self updateInfoSettings];
    213214
    214215    //set file table
     
    283284}
    284285
    285 - (void) updateInfoStatsAndSettings
     286- (void) updateInfoSettings
    286287{
    287288    int numberSelected = [fTorrents count];
    288 
    289     //set wait to start
    290     BOOL waiting = NO, notWaiting = NO, canEnableWaiting = numberSelected > 0,
    291         waitingSettingOn = [[[NSUserDefaults standardUserDefaults] stringForKey: @"StartSetting"]
    292                                 isEqualToString: @"Wait"];
    293    
    294     NSEnumerator * enumerator = [fTorrents objectEnumerator];
    295     Torrent * torrent;
    296     while ((torrent = [enumerator nextObject]))
    297     {
    298         if ([torrent waitingToStart])
    299             waiting = YES;
    300         else
    301             notWaiting = YES;
    302        
    303         if (canEnableWaiting && !(![torrent isActive] && [torrent progress] < 1.0 && waitingSettingOn))
    304             canEnableWaiting = NO;
    305     }
    306    
    307     [fWaitToStartButton setState: waiting && notWaiting ? NSMixedState : (waiting ? NSOnState : NSOffState)];
    308     [fWaitToStartButton setEnabled: canEnableWaiting];
    309289
    310290    //set ratio settings
    311291    if (numberSelected > 0)
    312292    {
    313         enumerator = [fTorrents objectEnumerator];
    314         torrent = [enumerator nextObject]; //first torrent
     293        NSEnumerator * enumerator = [fTorrents objectEnumerator];
     294        Torrent * torrent = [enumerator nextObject]; //first torrent
    315295        const int INVALID = -99;
    316296        int ratioSetting = [torrent stopRatioSetting];
     
    593573}
    594574
    595 - (void) setWaitToStart: (id) sender
    596 {
    597     int state = [sender state];
    598 
    599     NSEnumerator * enumerator = [fTorrents objectEnumerator];
    600     Torrent * torrent;
    601     while ((torrent = [enumerator nextObject]))
    602         [torrent setWaitToStart: state];
    603    
    604     [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentStartSettingChange" object: fTorrents];
    605 }
    606 
    607575@end
Note: See TracChangeset for help on using the changeset viewer.