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

update the main window when a torrent is auto-started from the queue

This commit is contained in:
Mitchell Livingston 2011-08-04 00:36:02 +00:00
parent ae89e4683d
commit 4d5c05177d
3 changed files with 17 additions and 5 deletions

View file

@ -1241,7 +1241,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
/*for (Torrent * torrent in torrents)
[torrent setWaitToStart: NO];*/
[torrents makeObjectsPerformSelector: @selector(stopTransfer)];
for (Torrent * torrent in torrents)
[torrent stopTransfer];
[self updateTorrentsInQueue];
}

View file

@ -641,6 +641,8 @@ tr_session * fHandle;
tr_sessionSetIdleLimited(fHandle, [fDefaults boolForKey: @"IdleLimitCheck"]);
tr_sessionSetIdleLimit(fHandle, [fDefaults integerForKey: @"IdleLimitMinutes"]);
#warning reload main table for remaining seeding time
//reload global settings in inspector
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateGlobalOptions" object: nil];
}

View file

@ -47,6 +47,7 @@
index: (NSInteger) index flatList: (NSMutableArray *) flatFileList;
- (void) sortFileList: (NSMutableArray *) fileNodes;
- (void) startQueue;
- (void) completenessChange: (NSDictionary *) statusInfo;
- (void) ratioLimitHit;
- (void) idleLimitHit;
@ -59,6 +60,11 @@
@end
void startQueueCallback(tr_torrent * torrent, void * torrentData)
{
[(Torrent *)torrentData performSelectorOnMainThread: @selector(startQueue) withObject: nil waitUntilDone: NO];
}
void completenessChangeCallback(tr_torrent * torrent, tr_completeness status, bool wasRunning, void * torrentData)
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
@ -159,9 +165,6 @@ int trashDataFile(const char * filename)
[self startTransferNoQueue];
}
//fWaitToStart = waitToStart && [waitToStart boolValue];
//upgrading from versions < 1.30: get old added, activity, and done dates
NSDate * date;
if ((date = [history objectForKey: @"Date"]))
@ -1651,6 +1654,7 @@ int trashDataFile(const char * filename)
fInfo = tr_torrentInfo(fHandle);
tr_torrentSetQueueStartCallback(fHandle, startQueueCallback, self);
tr_torrentSetCompletenessCallback(fHandle, completenessChangeCallback, self);
tr_torrentSetRatioLimitHitCallback(fHandle, ratioLimitHitCallback, self);
tr_torrentSetIdleLimitHitCallback(fHandle, idleLimitHitCallback, self);
@ -1791,6 +1795,11 @@ int trashDataFile(const char * filename)
[self sortFileList: [node children]];
}
- (void) startQueue
{
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self];
}
//status has been retained
- (void) completenessChange: (NSDictionary *) statusInfo
{