Ignore:
Timestamp:
Jul 1, 2006, 9:34:53 PM (16 years ago)
Author:
livings124
Message:

Auto-start check in the inspector now can be applied to multiple torrents.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r496 r497  
    122122    NSView * contentView = [fWindow contentView];
    123123    [contentView addSubview: fStatusBar];
    124     [fStatusBar setFrameOrigin: NSMakePoint(0, [fScrollView frame].origin.y
    125                                                 + [fScrollView frame].size.height)];
     124    [fStatusBar setFrameOrigin: NSMakePoint(0, [fScrollView frame].origin.y + [fScrollView frame].size.height)];
    126125    [self showStatusBar: [fDefaults boolForKey: @"StatusBar"] animate: NO];
    127126   
    128127    //set speed limit
    129     BOOL speedLimit = [fDefaults boolForKey: @"SpeedLimit"];
    130     if (speedLimit)
    131     {
    132         [fSpeedLimitItem setState: speedLimit];
    133         [fSpeedLimitDockItem setState: speedLimit];
     128    if ([fDefaults boolForKey: @"SpeedLimit"])
     129    {
     130        [fSpeedLimitItem setState: NSOnState];
     131        [fSpeedLimitDockItem setState: NSOnState];
    134132        [fSpeedLimitButton setState: NSOnState];
    135133    }
    136    
     134
    137135    [fActionButton setToolTip: @"Shortcuts for changing global settings."];
    138136    [fSpeedLimitButton setToolTip: @"Speed Limit overrides the total bandwidth limits with its own limits."];
     
    241239    fTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target: self
    242240        selector: @selector( updateUI: ) userInfo: nil repeats: YES];
    243     [[NSRunLoop currentRunLoop] addTimer: fTimer
    244         forMode: NSModalPanelRunLoopMode];
    245     [[NSRunLoop currentRunLoop] addTimer: fTimer
    246         forMode: NSEventTrackingRunLoopMode];
     241    [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode];
     242    [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode];
    247243   
    248244    [self sortTorrents];
    249245   
    250     //show windows
    251246    [fWindow makeKeyAndOrderFront: nil];
    252247
     
    10381033- (void) globalStartSettingChange: (NSNotification *) notification
    10391034{
     1035    #warning redo
    10401036    NSString * startSetting = [fDefaults stringForKey: @"StartSetting"];
    10411037   
     
    10781074                amountToStart = waitingCount;
    10791075           
    1080             //sort torrents by date to start earliest added
     1076            //sort torrents by order
    10811077            if (amountToStart < waitingCount)
    10821078            {
     
    11061102- (void) torrentStartSettingChange: (NSNotification *) notification
    11071103{
    1108     [self attemptToStartAuto: [notification object]];
     1104    //sort torrents by order value
     1105    NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey:
     1106                                                @"orderValue" ascending: YES] autorelease];
     1107    NSArray * descriptors = [[NSArray alloc] initWithObjects: orderDescriptor, nil];
     1108               
     1109    NSArray * torrents = [[notification object] sortedArrayUsingDescriptors: descriptors];
     1110    [descriptors release];
     1111
     1112    //attempt to start all torrents
     1113    NSEnumerator * enumerator = [torrents objectEnumerator];
     1114    Torrent * torrent;
     1115
     1116    while ((torrent = [enumerator nextObject]))
     1117        [self attemptToStartAuto: torrent];
    11091118
    11101119    [self updateUI: nil];
Note: See TracChangeset for help on using the changeset viewer.