Changeset 3639


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

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

Location:
branches/0.9x
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9x/NEWS

    r3625 r3639  
    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)
  • branches/0.9x/macosx/Controller.m

    r3589 r3639  
    20982098    [self updateTorrentsInQueue];
    20992099    [fInfoController updateInfoStats];
     2100    [fInfoController updateOptions];
    21002101   
    21012102    if ([fDefaults boolForKey: @"PlaySeedingSound"])
     
    23252326- (void) torrentTableViewSelectionDidChange: (NSNotification *) notification
    23262327{
    2327     [fInfoController updateInfoForTorrents: [fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]]];
     2328    [fInfoController setInfoForTorrents: [fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]]];
    23282329}
    23292330
  • branches/0.9x/macosx/InfoWindowController.h

    r3475 r3639  
    7070}
    7171
    72 - (void) updateInfoForTorrents: (NSArray *) torrents;
     72- (void) setInfoForTorrents: (NSArray *) torrents;
    7373- (void) updateInfoStats;
     74- (void) updateOptions;
    7475
    7576- (void) setTab: (id) sender;
  • branches/0.9x/macosx/InfoWindowController.m

    r3593 r3639  
    151151   
    152152    //set blank inspector
    153     [self updateInfoForTorrents: [NSArray array]];
     153    [self setInfoForTorrents: [NSArray array]];
    154154   
    155155    //allow for update notifications
    156156    NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
    157157    [nc addObserver: self selector: @selector(updateInfoStats) name: @"UpdateStats" object: nil];
     158    [nc addObserver: self selector: @selector(updateOptions) name: @"UpdateOptions" object: nil];
    158159}
    159160
     
    174175}
    175176
    176 - (void) updateInfoForTorrents: (NSArray *) torrents
     177- (void) setInfoForTorrents: (NSArray *) torrents
    177178{
    178179    [fTorrents release];
     
    379380    //update stats and settings
    380381    [self updateInfoStats];
     382    [self updateOptions];
    381383   
    382384    [fPeerTable reloadData];
     
    12471249    if ([fTorrents count] == 0)
    12481250        return;
    1249 
     1251   
     1252    //set pex check
     1253    NSEnumerator * enumerator = [fTorrents objectEnumerator];
     1254    Torrent * torrent = [enumerator nextObject]; //first torrent
     1255   
     1256    BOOL pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
     1257    int pexState = [torrent pex] ? NSOnState : NSOffState;
     1258   
     1259    while ((torrent = [enumerator nextObject]) && (pexEnabled || pexState != NSMixedState))
     1260    {
     1261        if (pexEnabled)
     1262            pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
     1263       
     1264        if (pexState != NSMixedState && pexState != ([torrent pex] ? NSOnState : NSOffState))
     1265            pexState = NSMixedState;
     1266    }
     1267   
     1268    [fPexCheck setEnabled: pexEnabled];
     1269    [fPexCheck setState: pexState];
     1270    [fPexCheck setToolTip: !pexEnabled ? NSLocalizedString(@"PEX can only be toggled on paused public torrents.",
     1271                                "Inspector -> pex check") : nil];
     1272}
     1273
     1274- (void) updateOptions
     1275{
     1276    if ([fTorrents count] == 0)
     1277        return;
     1278   
     1279    [self updateInfoOptions];
     1280   
    12501281    //get bandwidth info
    12511282    NSEnumerator * enumerator = [fTorrents objectEnumerator];
     
    13461377    else
    13471378        [fRatioLimitField setStringValue: @""];
    1348    
    1349     //set pex check
    1350     enumerator = [fTorrents objectEnumerator];
    1351     torrent = [enumerator nextObject]; //first torrent
    1352    
    1353     BOOL pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
    1354     int pexState = [torrent pex] ? NSOnState : NSOffState;
    1355    
    1356     while ((torrent = [enumerator nextObject]) && (pexEnabled || pexState != NSMixedState))
    1357     {
    1358         if (pexEnabled)
    1359             pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
    1360        
    1361         if (pexState != NSMixedState && pexState != ([torrent pex] ? NSOnState : NSOffState))
    1362             pexState = NSMixedState;
    1363     }
    1364    
    1365     [fPexCheck setEnabled: pexEnabled];
    1366     [fPexCheck setState: pexState];
    1367     [fPexCheck setToolTip: !pexEnabled ? NSLocalizedString(@"PEX can only be toggled on paused public torrents.",
    1368                                 "Inspector -> pex check") : nil];
    13691379}
    13701380
  • branches/0.9x/macosx/TorrentTableView.m

    r3485 r3639  
    398398    [fMenuTorrent setSpeedMode: mode upload: [sender menu] == fUploadMenu];
    399399   
    400     [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
     400    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
    401401}
    402402
     
    407407    [fMenuTorrent setSpeedLimit: [[sender title] intValue] upload: upload];
    408408   
    409     [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
     409    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
    410410}
    411411
     
    430430    [fMenuTorrent setRatioSetting: mode];
    431431   
    432     [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
     432    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
    433433}
    434434
     
    438438    [fMenuTorrent setRatioLimit: [[sender title] floatValue]];
    439439   
    440     [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
     440    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
    441441}
    442442
Note: See TracChangeset for help on using the changeset viewer.