Changeset 3638


Ignore:
Timestamp:
Oct 29, 2007, 6:07:09 PM (14 years ago)
Author:
livings124
Message:

trunk: Leopard: Fix bug with typing values in Inspector->Options

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r3624 r3638  
    11NEWS file for Transmission <http://transmission.m0k.org/>
     2
     30.92 (2007/xx/yy)
     4- OS X:
     5   + Leopard: Fix bug with typing values in Inspector->Options
    26
    370.91 (2007/10/28)
  • trunk/macosx/Controller.m

    r3613 r3638  
    21142114    [self updateTorrentsInQueue];
    21152115    [fInfoController updateInfoStats];
     2116    [fInfoController updateOptions];
    21162117   
    21172118    if ([fDefaults boolForKey: @"PlaySeedingSound"])
     
    23412342- (void) torrentTableViewSelectionDidChange: (NSNotification *) notification
    23422343{
    2343     [fInfoController updateInfoForTorrents: [fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]]];
     2344    [fInfoController setInfoForTorrents: [fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]]];
    23442345}
    23452346
  • trunk/macosx/InfoWindowController.h

    r3601 r3638  
    6969}
    7070
    71 - (void) updateInfoForTorrents: (NSArray *) torrents;
     71- (void) setInfoForTorrents: (NSArray *) torrents;
    7272- (void) updateInfoStats;
     73- (void) updateOptions;
    7374
    7475- (void) setTab: (id) sender;
  • trunk/macosx/InfoWindowController.m

    r3611 r3638  
    149149   
    150150    //set blank inspector
    151     [self updateInfoForTorrents: [NSArray array]];
     151    [self setInfoForTorrents: [NSArray array]];
    152152   
    153153    //allow for update notifications
    154154    NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
    155155    [nc addObserver: self selector: @selector(updateInfoStats) name: @"UpdateStats" object: nil];
     156    [nc addObserver: self selector: @selector(updateOptions) name: @"UpdateOptions" object: nil];
    156157}
    157158
     
    172173}
    173174
    174 - (void) updateInfoForTorrents: (NSArray *) torrents
     175- (void) setInfoForTorrents: (NSArray *) torrents
    175176{
    176177    [fTorrents release];
     
    387388    //update stats and settings
    388389    [self updateInfoStats];
     390    [self updateOptions];
    389391   
    390392    [fPeerTable reloadData];
     
    12451247    if ([fTorrents count] == 0)
    12461248        return;
    1247 
     1249   
     1250    //set pex check
     1251    NSEnumerator * enumerator = [fTorrents objectEnumerator];
     1252    Torrent * torrent = [enumerator nextObject]; //first torrent
     1253   
     1254    BOOL pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
     1255    int pexState = [torrent pex] ? NSOnState : NSOffState;
     1256   
     1257    while ((torrent = [enumerator nextObject]) && (pexEnabled || pexState != NSMixedState))
     1258    {
     1259        if (pexEnabled)
     1260            pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
     1261       
     1262        if (pexState != NSMixedState && pexState != ([torrent pex] ? NSOnState : NSOffState))
     1263            pexState = NSMixedState;
     1264    }
     1265   
     1266    [fPexCheck setEnabled: pexEnabled];
     1267    [fPexCheck setState: pexState];
     1268    [fPexCheck setToolTip: !pexEnabled ? NSLocalizedString(@"PEX can only be toggled on paused public torrents.",
     1269                                "Inspector -> pex check") : nil];
     1270}
     1271
     1272- (void) updateOptions
     1273{
     1274    if ([fTorrents count] == 0)
     1275        return;
     1276   
     1277    [self updateInfoOptions];
     1278   
    12481279    //get bandwidth info
    12491280    NSEnumerator * enumerator = [fTorrents objectEnumerator];
     
    13441375    else
    13451376        [fRatioLimitField setStringValue: @""];
    1346    
    1347     //set pex check
    1348     enumerator = [fTorrents objectEnumerator];
    1349     torrent = [enumerator nextObject]; //first torrent
    1350    
    1351     BOOL pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
    1352     int pexState = [torrent pex] ? NSOnState : NSOffState;
    1353    
    1354     while ((torrent = [enumerator nextObject]) && (pexEnabled || pexState != NSMixedState))
    1355     {
    1356         if (pexEnabled)
    1357             pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
    1358        
    1359         if (pexState != NSMixedState && pexState != ([torrent pex] ? NSOnState : NSOffState))
    1360             pexState = NSMixedState;
    1361     }
    1362    
    1363     [fPexCheck setEnabled: pexEnabled];
    1364     [fPexCheck setState: pexState];
    1365     [fPexCheck setToolTip: !pexEnabled ? NSLocalizedString(@"PEX can only be toggled on paused public torrents.",
    1366                                 "Inspector -> pex check") : nil];
    13671377}
    13681378
  • trunk/macosx/TorrentTableView.m

    r3601 r3638  
    418418    [fMenuTorrent setSpeedMode: mode upload: [sender menu] == fUploadMenu];
    419419   
    420     [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
     420    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
    421421}
    422422
     
    427427    [fMenuTorrent setSpeedLimit: [[sender title] intValue] upload: upload];
    428428   
    429     [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
     429    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
    430430}
    431431
     
    450450    [fMenuTorrent setRatioSetting: mode];
    451451   
    452     [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
     452    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
    453453}
    454454
     
    458458    [fMenuTorrent setRatioLimit: [[sender title] floatValue]];
    459459   
    460     [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
     460    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
    461461}
    462462
Note: See TracChangeset for help on using the changeset viewer.