Changeset 4280


Ignore:
Timestamp:
Dec 22, 2007, 4:15:35 AM (14 years ago)
Author:
livings124
Message:

add functionality to set number of connected peers for new torrents

Location:
trunk/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Defaults.plist

    r4258 r4280  
    7777        <key>PeersGlobal</key>
    7878        <integer>500</integer>
     79        <key>PeersTorrent</key>
     80        <integer>75</integer>
    7981        <key>PiecesBar</key>
    8082        <false/>
  • trunk/macosx/English.lproj/PrefsWindow.nib/classes.nib

    r4256 r4280  
    4141                                <string>id</string>
    4242                                <key>setPeersGlobal</key>
     43                                <string>id</string>
     44                                <key>setPeersTorrent</key>
    4345                                <string>id</string>
    4446                                <key>setPort</key>
  • trunk/macosx/PrefsController.h

    r4256 r4280  
    7171
    7272- (void) setPeersGlobal: (id) sender;
     73- (void) setPeersTorrent: (id) sender;
    7374
    7475- (void) setEncryptionMode: (id) sender;
  • trunk/macosx/PrefsController.m

    r4256 r4280  
    149149    //set peer connections
    150150    [fPeersGlobalField setIntValue: [fDefaults integerForKey: @"PeersGlobal"]];
     151    [fPeersTorrentField setIntValue: [fDefaults integerForKey: @"PeersTorrent"]];
    151152   
    152153    //set queue values
     
    328329}
    329330
     331- (void) setPeersTorrent: (id) sender
     332{
     333    int count = [sender intValue];
     334    [fDefaults setInteger: count forKey: @"PeersTorrent"];
     335}
     336
    330337- (void) setEncryptionMode: (id) sender
    331338{
  • trunk/macosx/Torrent.m

    r4278 r4280  
    14701470    tr_ctor * ctor = tr_ctorNew(fLib);
    14711471    tr_ctorSetPaused(ctor, TR_FORCE, YES);
     1472    tr_ctorSetMaxConnectedPeers(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]);
    14721473   
    14731474    tr_info info;
Note: See TracChangeset for help on using the changeset viewer.