mirror of
https://github.com/transmission/transmission
synced 2025-03-04 02:28:03 +00:00
remove bindings from the global ratio menu items
This commit is contained in:
parent
4cfc42437b
commit
44400b6a49
8 changed files with 35 additions and 97 deletions
|
@ -80,7 +80,6 @@
|
|||
A215760B0C0D449A0057A26A /* NSBezierPathAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A21576090C0D449A0057A26A /* NSBezierPathAdditions.m */; };
|
||||
A219798B0D07B78400438EA7 /* GroupToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A219798A0D07B78400438EA7 /* GroupToolbarItem.m */; };
|
||||
A21DFF100A292B2B007C5F76 /* Transfers.png in Resources */ = {isa = PBXBuildFile; fileRef = A21DFF0F0A292B2B007C5F76 /* Transfers.png */; };
|
||||
A21F5B890AF25FB6008CE5CE /* ActionMenuRatioToDisplayRatioTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A21F5B870AF25FB6008CE5CE /* ActionMenuRatioToDisplayRatioTransformer.m */; };
|
||||
A22180980D148A71007D09ED /* GroupsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A22180970D148A71007D09ED /* GroupsWindowController.m */; };
|
||||
A22180B60D148F0F007D09ED /* GroupsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A22180B50D148F0F007D09ED /* GroupsWindow.xib */; };
|
||||
A22180F60D14A32F007D09ED /* GradientCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A22180F40D14A32F007D09ED /* GradientCell.m */; };
|
||||
|
@ -431,8 +430,6 @@
|
|||
A21979890D07B78400438EA7 /* GroupToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupToolbarItem.h; path = macosx/GroupToolbarItem.h; sourceTree = "<group>"; };
|
||||
A219798A0D07B78400438EA7 /* GroupToolbarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupToolbarItem.m; path = macosx/GroupToolbarItem.m; sourceTree = "<group>"; };
|
||||
A21DFF0F0A292B2B007C5F76 /* Transfers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Transfers.png; path = macosx/Images/Transfers.png; sourceTree = "<group>"; };
|
||||
A21F5B860AF25FB6008CE5CE /* ActionMenuRatioToDisplayRatioTransformer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ActionMenuRatioToDisplayRatioTransformer.h; path = macosx/ActionMenuRatioToDisplayRatioTransformer.h; sourceTree = "<group>"; };
|
||||
A21F5B870AF25FB6008CE5CE /* ActionMenuRatioToDisplayRatioTransformer.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ActionMenuRatioToDisplayRatioTransformer.m; path = macosx/ActionMenuRatioToDisplayRatioTransformer.m; sourceTree = "<group>"; };
|
||||
A22180960D148A71007D09ED /* GroupsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupsWindowController.h; path = macosx/GroupsWindowController.h; sourceTree = "<group>"; };
|
||||
A22180970D148A71007D09ED /* GroupsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupsWindowController.m; path = macosx/GroupsWindowController.m; sourceTree = "<group>"; };
|
||||
A22180B50D148F0F007D09ED /* GroupsWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = GroupsWindow.xib; path = macosx/GroupsWindow.xib; sourceTree = "<group>"; };
|
||||
|
@ -771,8 +768,6 @@
|
|||
A26397540D0F714300D36DF2 /* ActionPopUpButton.m */,
|
||||
A2BF078E0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.h */,
|
||||
A2BF078F0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m */,
|
||||
A21F5B860AF25FB6008CE5CE /* ActionMenuRatioToDisplayRatioTransformer.h */,
|
||||
A21F5B870AF25FB6008CE5CE /* ActionMenuRatioToDisplayRatioTransformer.m */,
|
||||
A25E74450AF5089E006F11AE /* ExpandedPathToPathTransformer.h */,
|
||||
A25E74440AF5089E006F11AE /* ExpandedPathToPathTransformer.m */,
|
||||
A25E74470AF5089E006F11AE /* ExpandedPathToIconTransformer.h */,
|
||||
|
@ -1687,7 +1682,6 @@
|
|||
A2A306620AAD24A80049E2AC /* UKMainThreadProxy.m in Sources */,
|
||||
A29C8B370ACC6EB3000ED9F9 /* PortChecker.m in Sources */,
|
||||
A2AA579D0ADFCAB400CA59F6 /* PiecesView.m in Sources */,
|
||||
A21F5B890AF25FB6008CE5CE /* ActionMenuRatioToDisplayRatioTransformer.m in Sources */,
|
||||
A25E74650AF5097C006F11AE /* ExpandedPathToPathTransformer.m in Sources */,
|
||||
A25E74660AF5097D006F11AE /* ExpandedPathToIconTransformer.m in Sources */,
|
||||
A2BF07910B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m in Sources */,
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
/******************************************************************************
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2007 Transmission authors and contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*****************************************************************************/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface ActionMenuRatioToDisplayRatioTransformer : NSValueTransformer
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,45 +0,0 @@
|
|||
/******************************************************************************
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2007 Transmission authors and contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*****************************************************************************/
|
||||
|
||||
#import "ActionMenuRatioToDisplayRatioTransformer.h"
|
||||
|
||||
@implementation ActionMenuRatioToDisplayRatioTransformer
|
||||
|
||||
+ (Class) transformedValueClass
|
||||
{
|
||||
return [NSString class];
|
||||
}
|
||||
|
||||
+ (BOOL) allowsReverseTransformation
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (id) transformedValue: (id) value
|
||||
{
|
||||
return value == nil ? nil : [NSString stringWithFormat: NSLocalizedString(@"Stop at Ratio (%.2f)",
|
||||
"Action context menu -> ratio stop"), [value floatValue]];
|
||||
}
|
||||
|
||||
@end
|
|
@ -81,6 +81,8 @@
|
|||
IBOutlet NSMenuItem * fUploadLimitItem, * fUploadNoLimitItem,
|
||||
* fDownloadLimitItem, * fDownloadNoLimitItem;
|
||||
|
||||
IBOutlet NSMenuItem * fCheckRatioItem, * fNoCheckRatioItem;
|
||||
|
||||
IBOutlet NSMenu * fGroupsSetMenu, * fGroupsSetContextMenu, * fGroupFilterMenu;
|
||||
IBOutlet NSPopUpButton * fGroupsButton;
|
||||
|
||||
|
@ -206,6 +208,7 @@
|
|||
- (void) setLimitGlobalEnabled: (id) sender;
|
||||
- (void) setQuickLimitGlobal: (id) sender;
|
||||
|
||||
- (void) setRatioGlobalEnabled: (id) sender;
|
||||
- (void) setQuickRatioGlobal: (id) sender;
|
||||
|
||||
- (void) torrentStoppedForRatio: (NSNotification *) notification;
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#import "NSStringAdditions.h"
|
||||
#import "NSMenuAdditions.h"
|
||||
#import "UKKQueue.h"
|
||||
#import "ActionMenuRatioToDisplayRatioTransformer.h"
|
||||
#import "ExpandedPathToPathTransformer.h"
|
||||
#import "ExpandedPathToIconTransformer.h"
|
||||
#import "SpeedLimitToTurtleIconTransformer.h"
|
||||
|
@ -176,10 +175,6 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
[[NSBundle mainBundle] pathForResource: @"Defaults" ofType: @"plist"]]];
|
||||
|
||||
//set custom value transformers
|
||||
ActionMenuRatioToDisplayRatioTransformer * ratioTransformer =
|
||||
[[[ActionMenuRatioToDisplayRatioTransformer alloc] init] autorelease];
|
||||
[NSValueTransformer setValueTransformer: ratioTransformer forName: @"ActionMenuRatioToDisplayRatioTransformer"];
|
||||
|
||||
ExpandedPathToPathTransformer * pathTransformer =
|
||||
[[[ExpandedPathToPathTransformer alloc] init] autorelease];
|
||||
[NSValueTransformer setValueTransformer: pathTransformer forName: @"ExpandedPathToPathTransformer"];
|
||||
|
@ -2203,6 +2198,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
{
|
||||
[fDefaults setBool: sender == ([sender menu] == fUploadMenu ? fUploadLimitItem : fDownloadLimitItem)
|
||||
forKey: [sender menu] == fUploadMenu ? @"CheckUpload" : @"CheckDownload"];
|
||||
|
||||
[fPrefsController applySpeedSettings: nil];
|
||||
}
|
||||
|
||||
|
@ -2215,7 +2211,11 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
[fPrefsController applySpeedSettings: nil];
|
||||
}
|
||||
|
||||
#warning get rid of bindings :(
|
||||
- (void) setRatioGlobalEnabled: (id) sender
|
||||
{
|
||||
[fDefaults setBool: sender == fCheckRatioItem forKey: @"RatioCheck"];
|
||||
}
|
||||
|
||||
- (void) setQuickRatioGlobal: (id) sender
|
||||
{
|
||||
[fDefaults setBool: YES forKey: @"RatioCheck"];
|
||||
|
@ -3209,6 +3209,17 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
[menuItem setState: [fDefaults boolForKey: upload ? @"CheckUpload" : @"CheckDownload"] ? limit : !limit];
|
||||
return YES;
|
||||
}
|
||||
|
||||
if (action == @selector(setRatioGlobalEnabled:))
|
||||
{
|
||||
BOOL check = menuItem == fCheckRatioItem;
|
||||
if (check)
|
||||
[menuItem setTitle: [NSString stringWithFormat: NSLocalizedString(@"Stop at Ratio (%.2f)",
|
||||
"Action context menu -> ratio stop"), [fDefaults floatForKey: @"RatioLimit"]]];
|
||||
|
||||
[menuItem setState: [fDefaults boolForKey: @"RatioCheck"] ? check : !check];
|
||||
return YES;
|
||||
}
|
||||
|
||||
//enable show info
|
||||
if (action == @selector(showInfo:))
|
||||
|
|
22
macosx/English.lproj/MainMenu.nib/classes.nib
generated
22
macosx/English.lproj/MainMenu.nib/classes.nib
generated
|
@ -122,6 +122,8 @@
|
|||
<string>id</string>
|
||||
<key>setQuickRatioGlobal</key>
|
||||
<string>id</string>
|
||||
<key>setRatioGlobalEnabled</key>
|
||||
<string>id</string>
|
||||
<key>setSort</key>
|
||||
<string>id</string>
|
||||
<key>setSortByGroup</key>
|
||||
|
@ -177,6 +179,8 @@
|
|||
<string>StatusBarView</string>
|
||||
<key>fBottomTigerLine</key>
|
||||
<string>NSBox</string>
|
||||
<key>fCheckRatioItem</key>
|
||||
<string>NSMenuItem</string>
|
||||
<key>fDockMenu</key>
|
||||
<string>NSMenu</string>
|
||||
<key>fDownloadFilterButton</key>
|
||||
|
@ -201,6 +205,8 @@
|
|||
<string>NSMenuItem</string>
|
||||
<key>fNextInfoTabItem</key>
|
||||
<string>NSMenuItem</string>
|
||||
<key>fNoCheckRatioItem</key>
|
||||
<string>NSMenuItem</string>
|
||||
<key>fNoFilterButton</key>
|
||||
<string>FilterButton</string>
|
||||
<key>fOpenIgnoreDownloadFolder</key>
|
||||
|
@ -266,6 +272,14 @@
|
|||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>FilterButton</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSButton</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
|
@ -304,14 +318,6 @@
|
|||
<key>SUPERCLASS</key>
|
||||
<string>NSTableView</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>FilterButton</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSButton</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>ActionPopUpButton</string>
|
||||
|
|
2
macosx/English.lproj/MainMenu.nib/info.nib
generated
2
macosx/English.lproj/MainMenu.nib/info.nib
generated
|
@ -10,7 +10,7 @@
|
|||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>1060</integer>
|
||||
<integer>1310</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9B18</string>
|
||||
|
|
BIN
macosx/English.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
macosx/English.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
Loading…
Add table
Reference in a new issue