Changeset 1080


Ignore:
Timestamp:
Nov 11, 2006, 9:03:50 PM (15 years ago)
Author:
livings124
Message:

use bindings for speed limit

Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r1078 r1080  
    150150                A2AF1C390A3D0F6200F1575D /* FileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2AF1C370A3D0F6200F1575D /* FileTableView.m */; };
    151151                A2BD40070A09BBEA008CCE96 /* bencode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D1838B709DEC0430047D688 /* bencode.h */; };
     152                A2BF07910B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A2BF078F0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m */; };
    152153                A2C655650A04FEDC00E9FD82 /* BottomBorder.png in Resources */ = {isa = PBXBuildFile; fileRef = A2C655640A04FEDC00E9FD82 /* BottomBorder.png */; };
    153154                A2D0E0490A54A97C003C72CF /* Bandwidth.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D0E0480A54A97C003C72CF /* Bandwidth.png */; };
     
    364365                A2AF1C360A3D0F6200F1575D /* FileTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FileTableView.h; path = macosx/FileTableView.h; sourceTree = "<group>"; };
    365366                A2AF1C370A3D0F6200F1575D /* FileTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FileTableView.m; path = macosx/FileTableView.m; sourceTree = "<group>"; };
     367                A2BF078E0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SpeedLimitToTurtleIconTransformer.h; path = macosx/SpeedLimitToTurtleIconTransformer.h; sourceTree = "<group>"; };
     368                A2BF078F0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = SpeedLimitToTurtleIconTransformer.m; path = macosx/SpeedLimitToTurtleIconTransformer.m; sourceTree = "<group>"; };
    366369                A2C655640A04FEDC00E9FD82 /* BottomBorder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BottomBorder.png; path = macosx/Images/BottomBorder.png; sourceTree = "<group>"; };
    367370                A2D0E0480A54A97C003C72CF /* Bandwidth.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Bandwidth.png; path = macosx/Images/Bandwidth.png; sourceTree = "<group>"; };
     
    408411                        isa = PBXGroup;
    409412                        children = (
     413                                A2BF078F0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m */,
     414                                A2BF078E0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.h */,
    410415                                A25E74440AF5089E006F11AE /* ExpandedPathToPathTransformer.m */,
    411416                                A25E74450AF5089E006F11AE /* ExpandedPathToPathTransformer.h */,
     
    924929                                A25E74650AF5097C006F11AE /* ExpandedPathToPathTransformer.m in Sources */,
    925930                                A25E74660AF5097D006F11AE /* ExpandedPathToIconTransformer.m in Sources */,
     931                                A2BF07910B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m in Sources */,
    926932                        );
    927933                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/Controller.h

    r1050 r1080  
    5858    IBOutlet NSMenuItem             * fOpenIgnoreDownloadFolder;
    5959   
    60     IBOutlet NSMenuItem             * fSpeedLimitItem, * fSpeedLimitDockItem;
    6160    IBOutlet NSButton               * fActionButton, * fSpeedLimitButton;
    62     NSImage                         * fSpeedLimitNormalImage, * fSpeedLimitBlueImage, * fSpeedLimitGraphiteImage;
    6361    NSTimer                         * fSpeedLimitTimer;
    6462   
     
    153151- (void) switchFilter: (id) sender;
    154152
     153- (void) applySpeedLimit: (id) sender;
    155154- (void) toggleSpeedLimit: (id) sender;
    156155- (void) autoSpeedLimitChange: (NSNotification *) notification;
  • trunk/macosx/Controller.m

    r1065 r1080  
    3535#import "ExpandedPathToPathTransformer.h"
    3636#import "ExpandedPathToIconTransformer.h"
     37#import "SpeedLimitToTurtleIconTransformer.h"
    3738
    3839#import <Sparkle/Sparkle.h>
     
    9394                        [[[ExpandedPathToIconTransformer alloc] init] autorelease];
    9495    [NSValueTransformer setValueTransformer: iconTransformer forName: @"ExpandedPathToIconTransformer"];
     96   
     97    SpeedLimitToTurtleIconTransformer * speedLimitIconTransformer =
     98                        [[[SpeedLimitToTurtleIconTransformer alloc] init] autorelease];
     99    [NSValueTransformer setValueTransformer: speedLimitIconTransformer forName: @"SpeedLimitToTurtleIconTransformer"];
    95100}
    96101
     
    201206    [fStatusBar setFrameOrigin: NSMakePoint(0, NSMaxY([contentView frame]))];
    202207    [self showStatusBar: [fDefaults boolForKey: @"StatusBar"] animate: NO];
    203    
    204     //set speed limit
    205     fSpeedLimitNormalImage = [fSpeedLimitButton image];
    206     fSpeedLimitBlueImage = [NSImage imageNamed: @"SpeedLimitButtonBlue.png"];
    207     fSpeedLimitGraphiteImage = [NSImage imageNamed: @"SpeedLimitButtonGraphite.png"];
    208    
    209     [self updateControlTint: nil];
    210    
    211     if ([fDefaults boolForKey: @"SpeedLimit"])
    212     {
    213         #warning get rid of
    214         [fSpeedLimitItem setState: NSOnState];
    215         [fSpeedLimitDockItem setState: NSOnState];
    216        
    217         [fSpeedLimitButton setImage: [NSColor currentControlTint] == NSBlueControlTint
    218                                         ? fSpeedLimitBlueImage : fSpeedLimitGraphiteImage];
    219     }
    220208
    221209    [fActionButton setToolTip: NSLocalizedString(@"Shortcuts for changing global settings.",
     
    928916}
    929917
    930 - (void) updateControlTint: (NSNotification *) notification
    931 {
    932     if ([fDefaults boolForKey: @"SpeedLimit"])
    933         [fSpeedLimitButton setImage: [NSColor currentControlTint] == NSBlueControlTint
    934                                         ? fSpeedLimitBlueImage : fSpeedLimitGraphiteImage];
    935 }
    936 
    937918- (void) updateUI: (NSTimer *) timer
    938919{
     
    12841265}
    12851266
     1267- (void) updateControlTint: (NSNotification *) notification
     1268{
     1269    if ([fDefaults boolForKey: @"SpeedLimit"])
     1270        [fSpeedLimitButton setImage: [NSColor currentControlTint] == NSBlueControlTint
     1271            ? [NSImage imageNamed: @"SpeedLimitButtonBlue.png"] : [NSImage imageNamed: @"SpeedLimitButtonGraphite.png"]];
     1272}
     1273
     1274- (void) applySpeedLimit: (id) sender
     1275{
     1276    [fPrefsController applySpeedSettings: nil];
     1277}
     1278
    12861279- (void) toggleSpeedLimit: (id) sender
    12871280{
    1288     BOOL setEnabled = ![fDefaults boolForKey: @"SpeedLimit"];
    1289     int state = setEnabled ? NSOnState : NSOffState;
    1290    
    1291     [fDefaults setBool: setEnabled forKey: @"SpeedLimit"];
    1292 
    1293     #warning get rid of
    1294     [fSpeedLimitItem setState: state];
    1295     [fSpeedLimitDockItem setState: state];
    1296    
    1297     [fSpeedLimitButton setImage: !setEnabled ? fSpeedLimitNormalImage
    1298         : ([NSColor currentControlTint] == NSBlueControlTint ? fSpeedLimitBlueImage : fSpeedLimitGraphiteImage)];
    1299    
    1300     [fPrefsController applySpeedSettings: nil];
     1281    [fDefaults setBool: ![fDefaults boolForKey: @"SpeedLimit"] forKey: @"SpeedLimit"];
     1282    [self applySpeedLimit: nil];
    13011283}
    13021284
  • trunk/macosx/English.lproj/MainMenu.nib/classes.nib

    r1044 r1080  
    55            ACTIONS = {
    66                applyFilter = id;
     7                applySpeedLimit = id;
    78                copyTorrentFile = id;
    89                doNothing = id;
     
    6667                fSeedFilterButton = BarButton;
    6768                fSpeedLimitButton = NSButton;
    68                 fSpeedLimitDockItem = NSMenuItem;
    69                 fSpeedLimitItem = NSMenuItem;
    7069                fStateSortActionItem = NSMenuItem;
    7170                fStateSortItem = NSMenuItem;
  • trunk/macosx/English.lproj/MainMenu.nib/info.nib

    r1059 r1080  
    3232        <key>IBOpenObjects</key>
    3333        <array>
     34                <integer>581</integer>
    3435                <integer>21</integer>
    3536        </array>
Note: See TracChangeset for help on using the changeset viewer.