#4379 Lion: Use popovers for global gear button

This commit is contained in:
Mitchell Livingston 2011-07-23 15:54:02 +00:00
parent 5076efd20e
commit 4cdb84aa0d
12 changed files with 2410 additions and 625 deletions

View File

@ -118,6 +118,7 @@
A21FBBAB0EDA78C300BC3C51 /* bandwidth.h in Headers */ = {isa = PBXBuildFile; fileRef = A21FBBA90EDA78C300BC3C51 /* bandwidth.h */; };
A21FBBAC0EDA78C300BC3C51 /* bandwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = A21FBBAA0EDA78C300BC3C51 /* bandwidth.c */; };
A220AF7513D7C4B00035C512 /* evutil_rand.c in Sources */ = {isa = PBXBuildFile; fileRef = A220AF7413D7C4B00035C512 /* evutil_rand.c */; };
A220AF7B13D7CC460035C512 /* GlobalOptionsPopover.xib in Resources */ = {isa = PBXBuildFile; fileRef = A220AF7913D7CC460035C512 /* GlobalOptionsPopover.xib */; };
A220EC5B118C8A060022B4BE /* tr-lpd.c in Sources */ = {isa = PBXBuildFile; fileRef = A220EC59118C8A060022B4BE /* tr-lpd.c */; };
A220EC5C118C8A060022B4BE /* tr-lpd.h in Headers */ = {isa = PBXBuildFile; fileRef = A220EC5A118C8A060022B4BE /* tr-lpd.h */; };
A22180980D148A71007D09ED /* GroupsPrefsController.m in Sources */ = {isa = PBXBuildFile; fileRef = A22180970D148A71007D09ED /* GroupsPrefsController.m */; };
@ -217,6 +218,7 @@
A28F4F770E085BDC003A3882 /* ColorTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = A28F4F760E085BDC003A3882 /* ColorTextField.m */; };
A292A6E80DFB45FC004B9C0A /* webseed.c in Sources */ = {isa = PBXBuildFile; fileRef = A292A6E50DFB45EC004B9C0A /* webseed.c */; };
A29576030D11D63C0093B167 /* Creator.xib in Resources */ = {isa = PBXBuildFile; fileRef = A29576010D11D63C0093B167 /* Creator.xib */; };
A2966E8713DAF74C007B52DF /* GlobalOptionsPopoverViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2966E8613DAF74C007B52DF /* GlobalOptionsPopoverViewController.m */; };
A296EF3B11E560A7004A2781 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; };
A296EF3C11E560BD004A2781 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; };
A296EF3D11E560C3004A2781 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; };
@ -591,6 +593,7 @@
A21FBBA90EDA78C300BC3C51 /* bandwidth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bandwidth.h; path = libtransmission/bandwidth.h; sourceTree = "<group>"; };
A21FBBAA0EDA78C300BC3C51 /* bandwidth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bandwidth.c; path = libtransmission/bandwidth.c; sourceTree = "<group>"; };
A220AF7413D7C4B00035C512 /* evutil_rand.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = evutil_rand.c; path = "third-party/evutil_rand.c"; sourceTree = "<group>"; };
A220AF7A13D7CC460035C512 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = macosx/en.lproj/GlobalOptionsPopover.xib; sourceTree = "<group>"; };
A220EC59118C8A060022B4BE /* tr-lpd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "tr-lpd.c"; path = "libtransmission/tr-lpd.c"; sourceTree = "<group>"; };
A220EC5A118C8A060022B4BE /* tr-lpd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "tr-lpd.h"; path = "libtransmission/tr-lpd.h"; sourceTree = "<group>"; };
A220EE6611A8382C0022B4BE /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = macosx/de.lproj/AddMagnetWindow.xib; sourceTree = "<group>"; };
@ -784,6 +787,8 @@
A292A6E40DFB45E5004B9C0A /* peer-common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "peer-common.h"; path = "libtransmission/peer-common.h"; sourceTree = "<group>"; };
A292A6E50DFB45EC004B9C0A /* webseed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = webseed.c; path = libtransmission/webseed.c; sourceTree = "<group>"; };
A292A6E60DFB45EC004B9C0A /* webseed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = webseed.h; path = libtransmission/webseed.h; sourceTree = "<group>"; };
A2966E8513DAF74C007B52DF /* GlobalOptionsPopoverViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlobalOptionsPopoverViewController.h; path = macosx/GlobalOptionsPopoverViewController.h; sourceTree = "<group>"; };
A2966E8613DAF74C007B52DF /* GlobalOptionsPopoverViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GlobalOptionsPopoverViewController.m; path = macosx/GlobalOptionsPopoverViewController.m; sourceTree = "<group>"; };
A296EF3411E5605E004A2781 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; };
A29AF4F60D01BADC00D097EC /* DownArrowTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownArrowTemplate.png; path = macosx/Images/DownArrowTemplate.png; sourceTree = "<group>"; };
A29AF4F80D01BAEB00D097EC /* UpArrowTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = UpArrowTemplate.png; path = macosx/Images/UpArrowTemplate.png; sourceTree = "<group>"; };
@ -1119,6 +1124,8 @@
A2085DDA0C53BC74000BC3B7 /* AboutWindowController.m */,
A2F7CF5D13035FFD0016FF10 /* URLSheetWindowController.h */,
A2F7CF5E13035FFD0016FF10 /* URLSheetWindowController.m */,
A2966E8513DAF74C007B52DF /* GlobalOptionsPopoverViewController.h */,
A2966E8613DAF74C007B52DF /* GlobalOptionsPopoverViewController.m */,
A234D0D40C79FB6000A82373 /* Additions */,
E1B6FBF80C0D719B0015FE4D /* Info Window */,
A26AF2220D2DA42800FF7140 /* File Outline View */,
@ -1226,6 +1233,7 @@
A209EBA61142EAF3002B02D1 /* InfoPeersView.xib */,
A209EBD81142F52B002B02D1 /* InfoFileView.xib */,
A209EC11114301C6002B02D1 /* InfoOptionsView.xib */,
A220AF7913D7CC460035C512 /* GlobalOptionsPopover.xib */,
A20B6FA40C4D97840034AB1D /* PriorityNone.png */,
A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */,
A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */,
@ -2116,6 +2124,7 @@
A2E57AC61310831400A7DAB1 /* StatusBar.xib in Resources */,
A2E57B9C13109DC200A7DAB1 /* FilterBar.xib in Resources */,
A23D5DA71320570800E422BA /* CleanupTemplate.png in Resources */,
A220AF7B13D7CC460035C512 /* GlobalOptionsPopover.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2311,6 +2320,7 @@
A2E57ABB1310822C00A7DAB1 /* StatusBarController.m in Sources */,
A2E57BA713109E6B00A7DAB1 /* FilterBarController.m in Sources */,
A22BAE281388040500FB022F /* NSMutableArrayAdditions.m in Sources */,
A2966E8713DAF74C007B52DF /* GlobalOptionsPopoverViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2544,6 +2554,14 @@
name = AddMagnetWindow.xib;
sourceTree = "<group>";
};
A220AF7913D7CC460035C512 /* GlobalOptionsPopover.xib */ = {
isa = PBXVariantGroup;
children = (
A220AF7A13D7CC460035C512 /* en */,
);
name = GlobalOptionsPopover.xib;
sourceTree = "<group>";
};
A22A8D540AEEAFA5007E9CB9 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (

View File

@ -80,6 +80,8 @@ typedef enum
IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem;
IBOutlet NSMenu * fActionMenu;
IBOutlet NSMenu * fUploadMenu, * fDownloadMenu;
IBOutlet NSMenuItem * fUploadLimitItem, * fUploadNoLimitItem,
* fDownloadLimitItem, * fDownloadNoLimitItem;
@ -200,6 +202,8 @@ typedef enum
- (void) switchFilter: (id) sender;
- (IBAction) showGlobalPopover: (id) sender;
- (void) setGroup: (id) sender; //used by delegate-generated menu items
- (void) toggleSpeedLimit: (id) sender;

View File

@ -40,6 +40,7 @@
#import "AddWindowController.h"
#import "AddMagnetWindowController.h"
#import "MessageWindowController.h"
#import "GlobalOptionsPopoverViewController.h"
#import "ButtonToolbarItem.h"
#import "GroupToolbarItem.h"
#import "ToolbarSegmentedCell.h"
@ -2214,6 +2215,40 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
[fFilterBar switchFilter: sender == fNextFilterItem];
}
- (IBAction) showGlobalPopover: (id) sender
{
if ([NSApp isOnLionOrBetter])
{
NSPopover * popover = [[NSPopoverLion alloc] init];
[popover setBehavior: NSPopoverBehaviorTransient];
GlobalOptionsPopoverViewController * viewController = [[GlobalOptionsPopoverViewController alloc] initWithHandle: [PrefsController handle]];
[popover setContentViewController: viewController];
[popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge];
[viewController release];
[popover release];
}
else
{
//place menu below button
NSRect rect = [sender frame];
NSPoint location = rect.origin;
location.y += NSHeight(rect) + 5.0;
if ([NSApp isOnSnowLeopardOrBetter])
[fActionMenu popUpMenuPositioningItem: nil atLocation: location inView: sender];
else
{
NSEvent * newEvent = [NSEvent mouseEventWithType: NSLeftMouseDown location: location
modifierFlags: NSLeftMouseDownMask timestamp: GetCurrentEventTime() windowNumber: [fWindow windowNumber]
context: nil eventNumber: 1 clickCount: 1 pressure: 1];
[NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: sender];
}
}
}
- (void) menuNeedsUpdate: (NSMenu *) menu
{
if (menu == fGroupsSetMenu || menu == fGroupsSetContextMenu)
@ -2346,7 +2381,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
[fDefaults setBool: YES forKey: @"RatioCheck"];
[fDefaults setFloat: [[sender representedObject] floatValue] forKey: @"RatioLimit"];
[fPrefsController updateRatioStopField];
[fPrefsController updateRatioStopFieldOld];
}
- (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) finishedPlaying

View File

@ -0,0 +1,57 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2011 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 <Cocoa/Cocoa.h>
#import "transmission.h"
@interface GlobalOptionsPopoverViewController : NSViewController
{
tr_session * fHandle;
NSUserDefaults * fDefaults;
IBOutlet NSTextField * fUploadLimitField, * fDownloadLimitField;
IBOutlet NSTextField * fRatioStopField, * fIdleStopField;
NSString * fInitialString;
}
- (id) initWithHandle: (tr_session *) handle;
- (IBAction) updatedDisplayString: (id) sender;
- (IBAction) setDownSpeedSetting: (id) sender;
- (IBAction) setDownSpeedLimit: (id) sender;
- (IBAction) setUpSpeedSetting: (id) sender;
- (IBAction) setUpSpeedLimit: (id) sender;
- (IBAction) setRatioStopSetting: (id) sender;
- (IBAction) setRatioStopLimit: (id) sender;
- (IBAction) setIdleStopSetting: (id) sender;
- (IBAction) setIdleStopLimit: (id) sender;
@end

View File

@ -0,0 +1,149 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2011 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 "GlobalOptionsPopoverViewController.h"
@implementation GlobalOptionsPopoverViewController
- (id) initWithHandle: (tr_session *) handle
{
if ((self = [super initWithNibName: @"GlobalOptionsPopover" bundle: nil]))
{
fHandle = handle;
fDefaults = [NSUserDefaults standardUserDefaults];
}
return self;
}
- (void) awakeFromNib
{
[fUploadLimitField setIntValue: [fDefaults integerForKey: @"UploadLimit"]];
[fDownloadLimitField setIntValue: [fDefaults integerForKey: @"DownloadLimit"]];
[fRatioStopField setFloatValue: [fDefaults floatForKey: @"RatioLimit"]];
[fIdleStopField setIntegerValue: [fDefaults integerForKey: @"IdleLimitMinutes"]];
}
- (IBAction) updatedDisplayString: (id) sender
{
[[NSNotificationCenter defaultCenter] postNotificationName: @"ReloadTorrentTable" object: nil];
}
- (IBAction) setDownSpeedSetting: (id) sender
{
tr_sessionLimitSpeed(fHandle, TR_DOWN, [fDefaults boolForKey: @"CheckDownload"]);
[[NSNotificationCenter defaultCenter] postNotificationName: @"SpeedLimitUpdate" object: nil];
}
- (IBAction) setDownSpeedLimit: (id) sender
{
const NSInteger limit = [sender integerValue];
[fDefaults setInteger: limit forKey: @"DownloadLimit"];
tr_sessionSetSpeedLimit_KBps(fHandle, TR_DOWN, limit);
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateSpeedLimitValuesOutsidePrefs" object: nil];
[[NSNotificationCenter defaultCenter] postNotificationName: @"SpeedLimitUpdate" object: nil];
}
- (IBAction) setUpSpeedSetting: (id) sender
{
tr_sessionLimitSpeed(fHandle, TR_UP, [fDefaults boolForKey: @"CheckUpload"]);
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateSpeedLimitValuesOutsidePrefs" object: nil];
[[NSNotificationCenter defaultCenter] postNotificationName: @"SpeedLimitUpdate" object: nil];
}
- (IBAction) setUpSpeedLimit: (id) sender
{
const NSInteger limit = [sender integerValue];
[fDefaults setInteger: limit forKey: @"UploadLimit"];
tr_sessionSetSpeedLimit_KBps(fHandle, TR_UP, limit);
[[NSNotificationCenter defaultCenter] postNotificationName: @"SpeedLimitUpdate" object: nil];
}
- (IBAction) setRatioStopSetting: (id) sender
{
tr_sessionSetRatioLimited(fHandle, [fDefaults boolForKey: @"RatioCheck"]);
//reload global settings in inspector
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateGlobalOptions" object: nil];
}
- (IBAction) setRatioStopLimit: (id) sender
{
const CGFloat value = [sender floatValue];
[fDefaults setFloat: value forKey: @"RatioLimit"];
tr_sessionSetRatioLimit(fHandle, value);
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateRatioStopValueOutsidePrefs" object: nil];
//reload global settings in inspector
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateGlobalOptions" object: nil];
}
- (IBAction) setIdleStopSetting: (id) sender
{
tr_sessionSetIdleLimited(fHandle, [fDefaults boolForKey: @"IdleLimitCheck"]);
//reload global settings in inspector
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateGlobalOptions" object: nil];
}
- (IBAction) setIdleStopLimit: (id) sender
{
const NSInteger value = [sender integerValue];
[fDefaults setInteger: value forKey: @"IdleLimitMinutes"];
tr_sessionSetIdleLimit(fHandle, value);
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateIdleStopValueOutsidePrefs" object: nil];
//reload global settings in inspector
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateGlobalOptions" object: nil];
}
- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
{
[fInitialString release];
fInitialString = [[control stringValue] retain];
return YES;
}
- (BOOL) control: (NSControl *) control didFailToFormatString: (NSString *) string errorDescription: (NSString *) error
{
NSBeep();
if (fInitialString)
{
[control setStringValue: fInitialString];
[fInitialString release];
fInitialString = nil;
}
return NO;
}
@end

View File

@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">10K540</string>
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
<string key="IBDocument.AppKitVersion">1038.36</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<string key="IBDocument.SystemVersion">11A511</string>
<string key="IBDocument.InterfaceBuilderVersion">1617</string>
<string key="IBDocument.AppKitVersion">1138</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">1306</string>
<string key="NS.object.0">1617</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -63,9 +63,8 @@
<object class="NSOutlineView" id="553375370">
<reference key="NSNextResponder" ref="95499405"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{303, 324}</string>
<string key="NSFrameSize">{318, 324}</string>
<reference key="NSSuperview" ref="95499405"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/>
@ -76,7 +75,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTableColumn" id="109083469">
<string key="NSIdentifier">Name</string>
<double key="NSWidth">241.59910000000002</double>
<double key="NSWidth">256.59910000000002</double>
<double key="NSMinWidth">38.599119999999999</double>
<double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
@ -221,11 +220,11 @@
<int key="NSDraggingSourceMaskForNonLocal">0</int>
<bool key="NSAllowsTypeSelect">YES</bool>
<int key="NSTableViewDraggingDestinationStyle">0</int>
<int key="NSTableViewGroupRowStyle">1</int>
</object>
</object>
<string key="NSFrame">{{1, 1}, {303, 324}}</string>
<string key="NSFrame">{{1, 1}, {318, 324}}</string>
<reference key="NSSuperview" ref="850988097"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="553375370"/>
<reference key="NSDocView" ref="553375370"/>
<reference key="NSBGColor" ref="576649451"/>
@ -236,7 +235,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{304, 1}, {15, 324}}</string>
<reference key="NSSuperview" ref="850988097"/>
<reference key="NSWindow"/>
<reference key="NSTarget" ref="850988097"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.99692307692307691</double>
@ -246,7 +244,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-100, -100}, {328, 15}}</string>
<reference key="NSSuperview" ref="850988097"/>
<reference key="NSWindow"/>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="850988097"/>
<string key="NSAction">_doScroller:</string>
@ -255,9 +252,8 @@
</object>
<string key="NSFrame">{{10, 34}, {320, 326}}</string>
<reference key="NSSuperview" ref="30097843"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="95499405"/>
<int key="NSsFlags">18</int>
<int key="NSsFlags">133138</int>
<reference key="NSVScroller" ref="205767664"/>
<reference key="NSHScroller" ref="401920833"/>
<reference key="NSContentView" ref="95499405"/>
@ -268,7 +264,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{10, 10}, {110, 19}}</string>
<reference key="NSSuperview" ref="30097843"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSearchFieldCell" key="NSCell" id="28724714">
<int key="NSCellFlags">343014976</int>
@ -334,7 +329,6 @@
</object>
<string key="NSFrameSize">{340, 365}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<object class="NSMutableString" key="NSClassName">
<characters key="NS.bytes">NSView</characters>
</object>
@ -546,33 +540,24 @@
<string>-2.IBPluginDependency</string>
<string>-3.IBPluginDependency</string>
<string>10.IBPluginDependency</string>
<string>10.ImportedFromIB2</string>
<string>11.IBPluginDependency</string>
<string>11.IBShouldRemoveOnLegacySave</string>
<string>12.IBPluginDependency</string>
<string>12.ImportedFromIB2</string>
<string>13.IBPluginDependency</string>
<string>13.IBShouldRemoveOnLegacySave</string>
<string>14.IBPluginDependency</string>
<string>15.IBPluginDependency</string>
<string>2.IBEditorWindowLastContentRect</string>
<string>2.IBPluginDependency</string>
<string>2.ImportedFromIB2</string>
<string>2.editorWindowContentRectSynchronizationRect</string>
<string>3.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
<string>4.ImportedFromIB2</string>
<string>5.IBPluginDependency</string>
<string>5.IBShouldRemoveOnLegacySave</string>
<string>6.IBPluginDependency</string>
<string>6.IBShouldRemoveOnLegacySave</string>
<string>7.CustomClassName</string>
<string>7.IBPluginDependency</string>
<string>7.ImportedFromIB2</string>
<string>8.IBPluginDependency</string>
<string>8.ImportedFromIB2</string>
<string>9.IBPluginDependency</string>
<string>9.ImportedFromIB2</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -580,33 +565,24 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{322, 493}, {340, 365}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{0, 648}, {340, 347}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>FileOutlineView</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@ -623,78 +599,7 @@
<nil key="sourceID"/>
<int key="maxID">24</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">FileOutlineController</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">fOutline</string>
<string key="NS.object.0">FileOutlineView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">fOutline</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">fOutline</string>
<string key="candidateClassName">FileOutlineView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/FileOutlineController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">FileOutlineView</string>
<string key="superclassName">NSOutlineView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/FileOutlineView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">InfoFileViewController</string>
<string key="superclassName">NSViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>fFileController</string>
<string>fFileFilterField</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>FileOutlineController</string>
<string>NSSearchField</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>fFileController</string>
<string>fFileFilterField</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">fFileController</string>
<string key="candidateClassName">FileOutlineController</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">fFileFilterField</string>
<string key="candidateClassName">NSSearchField</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/InfoFileViewController.h</string>
</object>
</object>
</object>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">

View File

@ -80,6 +80,8 @@ EXTRA_DIST = \
FilterBarView.m \
FilterButton.h \
FilterButton.m \
GlobalOptionsPopoverViewController.h \
GlobalOptionsPopoverViewController.m \
GroupsController.h \
GroupsController.m \
GroupsPrefsController.h \

View File

@ -125,9 +125,11 @@
- (void) applyRatioSetting: (id) sender;
- (void) setRatioStop: (id) sender;
- (void) updateRatioStopField;
- (void) updateRatioStopFieldOld;
- (void) applyIdleStopSetting: (id) sender;
- (void) setIdleStop: (id) sender;
- (void) updateLimitStopField;
- (void) applySpeedSettings: (id) sender;
- (void) applyAltSpeedSettings;

View File

@ -223,6 +223,15 @@ tr_session * fHandle;
[self updateBlocklistButton];
[self updateBlocklistFields];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateLimitFields)
name: @"UpdateSpeedLimitValuesOutsidePrefs" object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateRatioStopField)
name: @"UpdateRatioStopValueOutsidePrefs" object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateLimitStopField)
name: @"UpdateIdleStopValueOutsidePrefs" object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateBlocklistFields)
name: @"BlocklistUpdated" object: nil];
@ -618,6 +627,11 @@ tr_session * fHandle;
{
if (fHasLoaded)
[fRatioStopField setFloatValue: [fDefaults floatForKey: @"RatioLimit"]];
}
- (void) updateRatioStopFieldOld
{
[self updateRatioStopField];
[self applyRatioSetting: nil];
}
@ -638,6 +652,12 @@ tr_session * fHandle;
[self applyIdleStopSetting: nil];
}
- (void) updateLimitStopField
{
if (fHasLoaded)
[fIdleStopField setIntegerValue: [fDefaults integerForKey: @"IdleLimitMinutes"]];
}
- (void) updateLimitFields
{
if (!fHasLoaded)

View File

@ -84,6 +84,8 @@
- (void) dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[fCollapsedGroups release];
[fPiecesBarAnimation release];
@ -100,6 +102,9 @@
{
//set group columns to show ratio, needs to be in awakeFromNib to size columns correctly
[self setGroupStatusColumns];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reloadData)
name: @"ReloadTorrentTable" object: nil];
}
- (BOOL) isGroupCollapsed: (NSInteger) value

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff