1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

The Mac UI's "check for stalled transfers" feature now uses the libtransmission hooks

This commit is contained in:
Mitchell Livingston 2011-08-08 03:24:23 +00:00
parent aa3696b309
commit a975fad0c7
2 changed files with 11 additions and 1 deletions

View file

@ -306,6 +306,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
tr_bencDictAddBool(&settings, TR_PREFS_KEY_PEX_ENABLED, [fDefaults boolForKey: @"PEXGlobal"]); tr_bencDictAddBool(&settings, TR_PREFS_KEY_PEX_ENABLED, [fDefaults boolForKey: @"PEXGlobal"]);
tr_bencDictAddBool(&settings, TR_PREFS_KEY_PORT_FORWARDING, [fDefaults boolForKey: @"NatTraversal"]); tr_bencDictAddBool(&settings, TR_PREFS_KEY_PORT_FORWARDING, [fDefaults boolForKey: @"NatTraversal"]);
tr_bencDictAddBool(&settings, TR_PREFS_KEY_QUEUE_STALLED_ENABLED, [fDefaults boolForKey: @"CheckStalled"]);
tr_bencDictAddInt(&settings, TR_PREFS_KEY_QUEUE_STALLED_MINUTES, [fDefaults integerForKey: @"StalledMinutes"]); tr_bencDictAddInt(&settings, TR_PREFS_KEY_QUEUE_STALLED_MINUTES, [fDefaults integerForKey: @"StalledMinutes"]);
tr_bencDictAddReal(&settings, TR_PREFS_KEY_RATIO, [fDefaults floatForKey: @"RatioLimit"]); tr_bencDictAddReal(&settings, TR_PREFS_KEY_RATIO, [fDefaults floatForKey: @"RatioLimit"]);
tr_bencDictAddBool(&settings, TR_PREFS_KEY_RATIO_ENABLED, [fDefaults boolForKey: @"RatioCheck"]); tr_bencDictAddBool(&settings, TR_PREFS_KEY_RATIO_ENABLED, [fDefaults boolForKey: @"RatioCheck"]);

View file

@ -772,6 +772,7 @@ tr_session * fHandle;
tr_sessionSetQueueEnabled(fHandle, TR_DOWN, [fDefaults boolForKey: @"Queue"]); tr_sessionSetQueueEnabled(fHandle, TR_DOWN, [fDefaults boolForKey: @"Queue"]);
tr_sessionSetQueueEnabled(fHandle, TR_UP, [fDefaults boolForKey: @"QueueSeed"]); tr_sessionSetQueueEnabled(fHandle, TR_UP, [fDefaults boolForKey: @"QueueSeed"]);
#warning any of these "UpdateQueue" needed?
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self]; [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self];
} }
@ -789,7 +790,11 @@ tr_session * fHandle;
- (void) setStalled: (id) sender - (void) setStalled: (id) sender
{ {
#warning do something here tr_sessionSetQueueStalledEnabled(fHandle, [fDefaults boolForKey: @"CheckStalled"]);
//reload main table for stalled status
#warning redundant?
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateUI" object: nil];
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self]; [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self];
} }
@ -1255,6 +1260,9 @@ tr_session * fHandle;
const int seedQueueNum = tr_sessionGetQueueSize(fHandle, TR_UP); const int seedQueueNum = tr_sessionGetQueueSize(fHandle, TR_UP);
[fDefaults setInteger: seedQueueNum forKey: @"QueueSeedNumber"]; [fDefaults setInteger: seedQueueNum forKey: @"QueueSeedNumber"];
const BOOL checkStalled = tr_sessionGetQueueStalledEnabled(fHandle);
[fDefaults setBool: checkStalled forKey: @"CheckStalled"];
const int stalledMinutes = tr_sessionGetQueueStalledMinutes(fHandle); const int stalledMinutes = tr_sessionGetQueueStalledMinutes(fHandle);
[fDefaults setInteger: stalledMinutes forKey: @"StalledMinutes"]; [fDefaults setInteger: stalledMinutes forKey: @"StalledMinutes"];
@ -1315,6 +1323,7 @@ tr_session * fHandle;
[fQueueDownloadField setIntValue: downloadQueueNum]; [fQueueDownloadField setIntValue: downloadQueueNum];
[fQueueSeedField setIntValue: seedQueueNum]; [fQueueSeedField setIntValue: seedQueueNum];
//check stalled handled by bindings
[fStalledField setIntValue: stalledMinutes]; [fStalledField setIntValue: stalledMinutes];
} }