add an option in the per-torrent action menu to follow the global bandwidth limit

This commit is contained in:
Mitchell Livingston
2009-03-05 22:48:01 +00:00
parent bfbab6d523
commit 80eca9666d
3 changed files with 52 additions and 4 deletions

View File

@@ -555,6 +555,9 @@
fMenuTorrent = [[self itemAtRow: row] retain];
[self createFileMenu: fActionMenu forFiles: [fMenuTorrent fileList]];
//update global limit check
[fGlobalLimitItem setState: [fMenuTorrent usesGlobalSpeedLimit] ? NSOnState : NSOffState];
//place menu below button
NSRect rect = [fTorrentCell iconRectForBounds: [self rectOfRow: row]];
NSPoint location = rect.origin;
@@ -580,7 +583,6 @@
if (!fMenuTorrent || ![menu supermenu])
return;
#warning add menu item for global limit
if (menu == fUploadMenu || menu == fDownloadMenu)
{
NSMenuItem * item;
@@ -735,6 +737,13 @@
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
}
- (void) setGlobalLimit: (id) sender
{
[fMenuTorrent setUseGlobalSpeedLimit: [sender state] != NSOnState];
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateOptions" object: nil];
}
- (void) setQuickRatioMode: (id) sender
{
tr_ratiolimit mode;