add an option to peer prefs to toggle LDS

This commit is contained in:
Mitchell Livingston
2010-05-01 16:31:44 +00:00
parent 3473686ee2
commit c206ccfad0
4 changed files with 101 additions and 18 deletions

View File

@@ -481,6 +481,11 @@ tr_session * fHandle;
tr_sessionSetDHTEnabled(fHandle, [fDefaults boolForKey: @"DHTGlobal"]);
}
- (void) setLDS: (id) sender
{
tr_sessionSetLDSEnabled(fHandle, [fDefaults boolForKey: @"LocalPeerDiscoveryGlobal"]);
}
- (void) setEncryptionMode: (id) sender
{
const tr_encryption_mode mode = [fDefaults boolForKey: @"EncryptionPrefer"] ?
@@ -1149,6 +1154,10 @@ tr_session * fHandle;
const BOOL dht = tr_sessionIsDHTEnabled(fHandle);
[fDefaults setBool: dht forKey: @"DHTGlobal"];
//dht
const BOOL lds = tr_sessionIsLDSEnabled(fHandle);
[fDefaults setBool: lds forKey: @"LocalPeerDiscovery"];
//auto start
const BOOL autoStart = !tr_sessionGetPaused(fHandle);
[fDefaults setBool: autoStart forKey: @"AutoStartDownload"];
@@ -1231,6 +1240,8 @@ tr_session * fHandle;
//dht handled by bindings
//lds handled by bindings
[fPortField setIntValue: port];
//port forwarding (nat) handled by bindings
//random port handled by bindings