From 7b78590acf42ebdd6bc2c7e91d93c9a9b52787a0 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 20 Apr 2007 23:07:10 +0000 Subject: [PATCH] Disable the stop ratio once it is reached (while seeding). --- macosx/Controller.m | 1 + macosx/InfoWindowController.h | 2 ++ macosx/InfoWindowController.m | 10 +++++++--- macosx/Torrent.m | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index e67820a00..434916858 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1776,6 +1776,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy [self updateTorrentsInQueue]; [fInfoController updateInfoStats]; + [fInfoController updateRatioForTorrent: torrent]; if ([fDefaults boolForKey: @"PlaySeedingSound"]) { diff --git a/macosx/InfoWindowController.h b/macosx/InfoWindowController.h index 7843020cc..5d48c5472 100644 --- a/macosx/InfoWindowController.h +++ b/macosx/InfoWindowController.h @@ -64,6 +64,8 @@ - (void) updateInfoForTorrents: (NSArray *) torrents; - (void) updateInfoStats; +- (void) updateRatioForTorrent: (Torrent *) torrent; + - (void) setNextTab; - (void) setPreviousTab; diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 88cea66ed..59b0c8145 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -433,9 +433,7 @@ - (void) updateInfoSettings { - int numberSelected = [fTorrents count]; - - if (numberSelected > 0) + if ([fTorrents count] > 0) { Torrent * torrent; @@ -554,6 +552,12 @@ [self updateInfoStats]; } +- (void) updateRatioForTorrent: (Torrent *) torrent +{ + if ([fTorrents containsObject: torrent]) + [self updateInfoSettings]; +} + - (int) stateSettingToPopUpIndex: (int) index { if (index == NSOnState) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 2927d5e49..86321b4f9 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -298,6 +298,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 fFinishedSeeding = YES; + [self setRatioSetting: NSOffState]; [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentStoppedForRatio" object: self]; }