Changeset 496


Ignore:
Timestamp:
Jul 1, 2006, 6:02:36 PM (16 years ago)
Author:
livings124
Message:

Dock menu item for Speed Limit, among smaller changed.

Location:
trunk/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r491 r496  
    5050    NSToolbar                   * fToolbar;
    5151   
    52     IBOutlet NSMenuItem         * fAdvancedBarItem, * fSpeedLimitItem;
     52    IBOutlet NSMenuItem         * fAdvancedBarItem, * fSpeedLimitItem, * fSpeedLimitDockItem;
    5353    IBOutlet NSButton           * fActionButton, * fSpeedLimitButton;
    5454   
     
    7878}
    7979
    80 - (void) advancedChanged: (id) sender;
    8180- (void) openShowSheet:   (id) sender;
    8281- (void) openSheetClosed: (NSOpenPanel *) s returnCode: (int) code
     
    149148- (void) toggleStatusBar: (id) sender;
    150149- (void) showStatusBar: (BOOL) show animate: (BOOL) animate;
     150- (void) toggleAdvancedBar: (id) sender;
    151151
    152152- (void) showMainWindow:    (id) sender;
  • trunk/macosx/Controller.m

    r494 r496  
    128128    //set speed limit
    129129    BOOL speedLimit = [fDefaults boolForKey: @"SpeedLimit"];
    130     [fSpeedLimitItem setState: speedLimit];
    131130    if (speedLimit)
     131    {
     132        [fSpeedLimitItem setState: speedLimit];
     133        [fSpeedLimitDockItem setState: speedLimit];
    132134        [fSpeedLimitButton setState: NSOnState];
     135    }
    133136   
    134137    [fActionButton setToolTip: @"Shortcuts for changing global settings."];
     
    428431    [fTotalTorrentsField setStringValue: [NSString stringWithFormat:
    429432        @"%d Transfer%s", count, count == 1 ? "" : "s"]];
    430 }
    431 
    432 - (void) advancedChanged: (id) sender
    433 {
    434     [fAdvancedBarItem setState: ![fAdvancedBarItem state]];
    435     [fDefaults setBool: [fAdvancedBarItem state] forKey: @"UseAdvancedBar"];
    436 
    437     [fTableView display];
    438433}
    439434
     
    926921
    927922    [fSpeedLimitItem setState: state];
     923    [fSpeedLimitDockItem setState: state];
    928924    [fSpeedLimitButton setState: state];
    929925   
     
    11201116- (void) attemptToStartAuto: (Torrent *) torrent
    11211117{
    1122     #warning expand upon
    11231118    if ([torrent progress] >= 1.0)
    11241119        [torrent startTransfer];
     
    12191214    fStatusBarVisible = !fStatusBarVisible;
    12201215   
    1221     //reloads stats
    12221216    [self updateUI: nil];
    12231217   
     
    12381232    minSize.height += heightChange;
    12391233    [fWindow setContentMinSize: minSize];
     1234}
     1235
     1236- (void) toggleAdvancedBar: (id) sender
     1237{
     1238    [fAdvancedBarItem setState: ![fAdvancedBarItem state]];
     1239    [fDefaults setBool: [fAdvancedBarItem state] forKey: @"UseAdvancedBar"];
     1240
     1241    [fTableView display];
    12401242}
    12411243
     
    13221324            TOOLBAR_OPEN, TOOLBAR_REMOVE,
    13231325            TOOLBAR_PAUSE_SELECTED, TOOLBAR_RESUME_SELECTED,
    1324             TOOLBAR_PAUSE_ALL, TOOLBAR_RESUME_ALL,
    1325             TOOLBAR_INFO,
     1326            TOOLBAR_PAUSE_ALL, TOOLBAR_RESUME_ALL, TOOLBAR_INFO,
    13261327            NSToolbarSeparatorItemIdentifier,
    13271328            NSToolbarSpaceItemIdentifier,
     
    14031404
    14041405    //only enable some items if it is in a context menu or the window is useable
    1405     BOOL canUseMenu = [[[menuItem menu] title] isEqualToString: @"Context"]
    1406                         || [fWindow isKeyWindow];
     1406    BOOL canUseMenu = [fWindow isKeyWindow] || [[[menuItem menu] title] isEqualToString: @"Context"];
    14071407
    14081408    //enable show info
     
    14161416    }
    14171417   
     1418    //enable prev/next inspector tab
    14181419    if (action == @selector(setInfoTab:))
    14191420        return [[fInfoController window] isVisible];
     
    14511452    }
    14521453
     1454    //enable reveal in finder
    14531455    if (action == @selector(revealFile:))
    1454     {
    14551456        return canUseMenu && [fTableView numberOfSelectedRows] > 0;
    1456     }
    14571457
    14581458    //enable remove items
     
    15381538    }
    15391539   
    1540     //enable resume item
    1541     if (action == @selector(setSort:) || (action == @selector(advancedChanged:)))
     1540    //enable sort and advanced bar items
     1541    if (action == @selector(setSort:) || (action == @selector(toggleAdvancedBar:)))
    15421542        return canUseMenu;
    15431543   
  • trunk/macosx/English.lproj/MainMenu.nib/classes.nib

    r491 r496  
    33        {
    44            ACTIONS = {
    5                 advancedChanged = id;
    65                checkUpdate = id;
    76                copyTorrentFile = id;
     
    2726                stopAllTorrents = id;
    2827                stopTorrent = id;
     28                toggleAdvancedBar = id;
    2929                toggleSpeedLimit = id;
    3030                toggleStatusBar = id;
     
    4848                fScrollView = NSScrollView;
    4949                fSpeedLimitButton = NSButton;
     50                fSpeedLimitDockItem = NSMenuItem;
    5051                fSpeedLimitItem = NSMenuItem;
    5152                fStateSortItem = NSMenuItem;
  • trunk/macosx/English.lproj/MainMenu.nib/info.nib

    r494 r496  
    1616                <string>396 374 216 206 0 0 1152 842 </string>
    1717                <key>581</key>
    18                 <string>324 628 112 68 0 0 1152 842 </string>
     18                <string>571 464 115 99 0 0 1152 842 </string>
    1919                <key>589</key>
    2020                <string>54 521 139 68 0 0 1152 842 </string>
     
    3030        <key>IBOpenObjects</key>
    3131        <array>
     32                <integer>29</integer>
     33                <integer>581</integer>
    3234                <integer>21</integer>
    33                 <integer>29</integer>
    3435        </array>
    3536        <key>IBSystem Version</key>
  • trunk/macosx/TorrentTableView.m

    r424 r496  
    7979    if ([event modifierFlags] & NSAlternateKeyMask)
    8080    {
    81         [fController advancedChanged: self];
     81        [fController toggleAdvancedBar: self];
    8282        fClickPoint = NSZeroPoint;
    8383    }
Note: See TracChangeset for help on using the changeset viewer.