Disable the stop ratio once it is reached (while seeding).

This commit is contained in:
Mitchell Livingston 2007-04-20 23:07:10 +00:00
parent 36bb16a66f
commit 7b78590acf
4 changed files with 11 additions and 3 deletions

View File

@ -1776,6 +1776,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[self updateTorrentsInQueue]; [self updateTorrentsInQueue];
[fInfoController updateInfoStats]; [fInfoController updateInfoStats];
[fInfoController updateRatioForTorrent: torrent];
if ([fDefaults boolForKey: @"PlaySeedingSound"]) if ([fDefaults boolForKey: @"PlaySeedingSound"])
{ {

View File

@ -64,6 +64,8 @@
- (void) updateInfoForTorrents: (NSArray *) torrents; - (void) updateInfoForTorrents: (NSArray *) torrents;
- (void) updateInfoStats; - (void) updateInfoStats;
- (void) updateRatioForTorrent: (Torrent *) torrent;
- (void) setNextTab; - (void) setNextTab;
- (void) setPreviousTab; - (void) setPreviousTab;

View File

@ -433,9 +433,7 @@
- (void) updateInfoSettings - (void) updateInfoSettings
{ {
int numberSelected = [fTorrents count]; if ([fTorrents count] > 0)
if (numberSelected > 0)
{ {
Torrent * torrent; Torrent * torrent;
@ -554,6 +552,12 @@
[self updateInfoStats]; [self updateInfoStats];
} }
- (void) updateRatioForTorrent: (Torrent *) torrent
{
if ([fTorrents containsObject: torrent])
[self updateInfoSettings];
}
- (int) stateSettingToPopUpIndex: (int) index - (int) stateSettingToPopUpIndex: (int) index
{ {
if (index == NSOnState) if (index == NSOnState)

View File

@ -298,6 +298,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
fFinishedSeeding = YES; fFinishedSeeding = YES;
[self setRatioSetting: NSOffState];
[[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentStoppedForRatio" object: self]; [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentStoppedForRatio" object: self];
} }