Ignore:
Timestamp:
Jan 6, 2016, 11:05:37 AM (6 years ago)
Author:
mikedld
Message:

#6042: Remove dead code now that we build for OS X 10.7+ (patch by mattrajca)

In addition to the patch,

  • remove unused global actions menu (popover is used instead)
  • remove *Lion class macros, use NSPopover and NSDataDetector directly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r14632 r14662  
    14751475- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData
    14761476{
    1477     NSMutableArray * selectedValues = nil;
    1478     if (![NSApp isOnLionOrBetter])
    1479     {
    1480         selectedValues = [NSMutableArray arrayWithArray: [fTableView selectedValues]];
    1481         [selectedValues removeObjectsInArray: torrents];
    1482     }
    1483    
    14841477    //miscellaneous
    14851478    for (Torrent * torrent in torrents)
     
    15241517        if ([indexes count] > 0)
    15251518        {
    1526             if ([NSApp isOnLionOrBetter])
     1519            if (!beganUpdate)
    15271520            {
    1528                 if (!beganUpdate)
    1529                 {
    1530                     [NSAnimationContext beginGrouping]; //this has to be before we set the completion handler (#4874)
    1531                    
    1532                     //we can't closeRemoveTorrent: until it's no longer in the GUI at all
    1533                     [[NSAnimationContext currentContext] setCompletionHandler: ^{
    1534                         for (Torrent * torrent in torrents)
    1535                             [torrent closeRemoveTorrent: deleteData];
    1536                     }];
    1537                    
    1538                     [fTableView beginUpdates];
    1539                     beganUpdate = YES;
    1540                 }
     1521                [NSAnimationContext beginGrouping]; //this has to be before we set the completion handler (#4874)
    15411522               
    1542                 [fTableView removeItemsAtIndexes: indexes inParent: parent withAnimation: NSTableViewAnimationSlideLeft];
     1523                //we can't closeRemoveTorrent: until it's no longer in the GUI at all
     1524                [[NSAnimationContext currentContext] setCompletionHandler: ^{
     1525                    for (Torrent * torrent in torrents)
     1526                        [torrent closeRemoveTorrent: deleteData];
     1527                }];
     1528               
     1529                [fTableView beginUpdates];
     1530                beganUpdate = YES;
    15431531            }
     1532           
     1533            [fTableView removeItemsAtIndexes: indexes inParent: parent withAnimation: NSTableViewAnimationSlideLeft];
     1534
    15441535            [displayedTorrents removeObjectsAtIndexes: indexes];
    15451536        }
     
    15701561            [torrent closeRemoveTorrent: deleteData];
    15711562    }
    1572    
    1573     if (selectedValues)
    1574         [fTableView selectValues: selectedValues];
    15751563   
    15761564    [self fullUpdateUI];
     
    22272215- (void) sortTorrents: (BOOL) includeQueueOrder
    22282216{
    2229     const BOOL onLion = [NSApp isOnLionOrBetter];
    2230    
    2231     NSArray * selectedValues;
    2232     if (!onLion)
    2233         selectedValues = [fTableView selectedValues];
    2234    
    22352217    //actually sort
    22362218    [self sortTorrentsCallUpdates: YES includeQueueOrder: includeQueueOrder];
    2237    
    2238     if (!onLion)
    2239         [fTableView selectValues: selectedValues];
    2240    
    22412219    [fTableView setNeedsDisplay: YES];
    22422220}
     
    23072285    }
    23082286   
    2309     BOOL beganTableUpdate = !callUpdates || ![NSApp isOnLionOrBetter];
     2287    BOOL beganTableUpdate = !callUpdates;
    23102288   
    23112289    //actually sort
     
    23202298    if (beganTableUpdate && callUpdates)
    23212299    {
    2322         if ([NSApp isOnLionOrBetter])
    2323             [fTableView endUpdates];
    2324         else
    2325             [fTableView reloadData];
     2300        [fTableView endUpdates];
    23262301    }
    23272302}
     
    23492324            {
    23502325                *beganTableUpdate = YES;
    2351                 if ([NSApp isOnLionOrBetter])
    2352                     [fTableView beginUpdates];
     2326                [fTableView beginUpdates];
    23532327            }
    23542328           
    23552329            [rearrangeArray moveObjectAtIndex: currentIndex toIndex: insertIndex];
    2356             if ([NSApp isOnLionOrBetter])
    2357                 [fTableView moveItemAtIndex: currentIndex inParent: parent toIndex: insertIndex inParent: parent];
     2330            [fTableView moveItemAtIndex: currentIndex inParent: parent toIndex: insertIndex inParent: parent];
    23582331        }
    23592332    }
     
    23642337- (void) applyFilter
    23652338{
    2366     const BOOL onLion = [NSApp isOnLionOrBetter];
    2367    
    2368     NSArray * selectedValuesSL = nil;
    2369     if (!onLion)
    2370         selectedValuesSL = [fTableView selectedValues];
    2371    
    23722339    __block int32_t active = 0, downloading = 0, seeding = 0, paused = 0;
    23732340    NSString * filterType = [fDefaults stringForKey: @"Filter"];
     
    24992466   
    25002467    BOOL beganUpdates = NO;
    2501    
    2502     if (onLion)
    2503     {
    2504         //don't animate torrents when first launching
    2505         static dispatch_once_t onceToken;
    2506         dispatch_once(&onceToken, ^{
    2507             [[NSAnimationContext currentContext] setDuration: 0];
    2508         });
    2509         [NSAnimationContext beginGrouping];
    2510     }
     2468
     2469    //don't animate torrents when first launching
     2470    static dispatch_once_t onceToken;
     2471    dispatch_once(&onceToken, ^{
     2472        [[NSAnimationContext currentContext] setDuration: 0];
     2473    });
     2474    [NSAnimationContext beginGrouping];
    25112475   
    25122476    //add/remove torrents (and rearrange for groups), one by one
     
    25302494        {
    25312495            beganUpdates = YES;
    2532             if (onLion)
    2533                 [fTableView beginUpdates];
     2496            [fTableView beginUpdates];
    25342497           
    25352498            //remove torrents we didn't find
     
    25372500            {
    25382501                [fDisplayedTorrents removeObjectsAtIndexes: removePreviousIndexes];
    2539                 if (onLion)
    2540                     [fTableView removeItemsAtIndexes: removePreviousIndexes inParent: nil withAnimation: NSTableViewAnimationSlideDown];
     2502                [fTableView removeItemsAtIndexes: removePreviousIndexes inParent: nil withAnimation: NSTableViewAnimationSlideDown];
    25412503            }
    25422504           
     
    25542516                   
    25552517                    [fDisplayedTorrents addObjectsFromArray: [allTorrents objectsAtIndexes: newAddIndexes]];
    2556                     if (onLion)
    2557                         [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [newAddIndexes count], [newAddIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideLeft];
     2518                    [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [newAddIndexes count], [newAddIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideLeft];
    25582519                }
    25592520               
    25602521                [fDisplayedTorrents addObjectsFromArray: [allTorrents objectsAtIndexes: addIndexes]];
    2561                 if (onLion)
    2562                     [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [addIndexes count], [addIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown];
     2522                [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [addIndexes count], [addIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown];
    25632523            }
    25642524        }
     
    25702530        #warning don't always do?
    25712531        beganUpdates = YES;
    2572         if (onLion)
    2573             [fTableView beginUpdates];
     2532        [fTableView beginUpdates];
    25742533       
    25752534        NSMutableIndexSet * unusedAllTorrentsIndexes = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [allTorrents count])];
     
    26082567                            [groupsByIndex setObject: newGroup forKey: [NSNumber numberWithInteger: groupValue]];
    26092568                            [fDisplayedTorrents addObject: newGroup];
    2610                            
    2611                             if (onLion)
    2612                             {
    2613                                 [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [fDisplayedTorrents count]-1] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
    2614                                 [fTableView isGroupCollapsed: groupValue] ? [fTableView collapseItem: newGroup] : [fTableView expandItem: newGroup];
    2615                             }
     2569
     2570                            [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [fDisplayedTorrents count]-1] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
     2571                            [fTableView isGroupCollapsed: groupValue] ? [fTableView collapseItem: newGroup] : [fTableView expandItem: newGroup];
    26162572                        }
    26172573                        else //if we haven't processed the other group yet, we have to make sure we don't flag it for removal the next time
     
    26242580                        [[group torrents] removeObjectAtIndex: indexInGroup];
    26252581                        [[newGroup torrents] addObject: torrent];
    2626                        
    2627                         if (onLion)
    2628                             [fTableView moveItemAtIndex: indexInGroup inParent: group toIndex: [[newGroup torrents] count]-1 inParent: newGroup];
     2582
     2583                        [fTableView moveItemAtIndex: indexInGroup inParent: group toIndex: [[newGroup torrents] count]-1 inParent: newGroup];
    26292584                       
    26302585                        --indexInGroup;
     
    26392594            {
    26402595                [[group torrents] removeObjectsAtIndexes: removeIndexes];
    2641                 if (onLion)
    2642                     [fTableView removeItemsAtIndexes: removeIndexes inParent: group withAnimation: NSTableViewAnimationEffectFade];
     2596                [fTableView removeItemsAtIndexes: removeIndexes inParent: group withAnimation: NSTableViewAnimationEffectFade];
    26432597            }
    26442598        }
     
    26542608                [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]];
    26552609                [fDisplayedTorrents addObject: group];
    2656                
    2657                 if (onLion)
    2658                 {
    2659                     [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [fDisplayedTorrents count]-1] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
    2660                     [fTableView isGroupCollapsed: groupValue] ? [fTableView collapseItem: group] : [fTableView expandItem: group];
    2661                 }
     2610
     2611                [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [fDisplayedTorrents count]-1] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
     2612                [fTableView isGroupCollapsed: groupValue] ? [fTableView collapseItem: group] : [fTableView expandItem: group];
    26622613            }
    26632614           
    26642615            [[group torrents] addObject: torrent];
    2665             if (onLion)
    2666             {
    2667                 const BOOL newTorrent = fAddingTransfers && [fAddingTransfers containsObject: torrent];
    2668                 [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [[group torrents] count]-1] inParent: group withAnimation: newTorrent ? NSTableViewAnimationSlideLeft : NSTableViewAnimationSlideDown];
    2669             }
     2616
     2617            const BOOL newTorrent = fAddingTransfers && [fAddingTransfers containsObject: torrent];
     2618            [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [[group torrents] count]-1] inParent: group withAnimation: newTorrent ? NSTableViewAnimationSlideLeft : NSTableViewAnimationSlideDown];
    26702619        }
    26712620       
     
    26782627        {
    26792628            [fDisplayedTorrents removeObjectsAtIndexes: removeGroupIndexes];
    2680             if (onLion)
    2681                 [fTableView removeItemsAtIndexes: removeGroupIndexes inParent: nil withAnimation: NSTableViewAnimationEffectFade];
     2629            [fTableView removeItemsAtIndexes: removeGroupIndexes inParent: nil withAnimation: NSTableViewAnimationEffectFade];
    26822630        }
    26832631       
     
    26982646       
    26992647        beganUpdates = YES;
    2700         if (onLion)
    2701             [fTableView beginUpdates];
    2702        
    2703         if (onLion)
    2704             [fTableView removeItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown];
     2648        [fTableView beginUpdates];
     2649
     2650        [fTableView removeItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown];
    27052651       
    27062652        if (groupRows)
     
    27292675        else
    27302676            [fDisplayedTorrents setArray: allTorrents];
    2731        
    2732         if (onLion)
    2733             [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
     2677
     2678        [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
    27342679       
    27352680        if (groupRows)
     
    27462691    //sort the torrents (won't sort the groups, though)
    27472692    [self sortTorrentsCallUpdates: !beganUpdates includeQueueOrder: YES];
    2748    
    2749     if (onLion)
    2750     {
    2751         if (beganUpdates)
    2752             [fTableView endUpdates];
    2753         [fTableView setNeedsDisplay: YES];
    2754        
    2755         [NSAnimationContext endGrouping];
    2756     }
    2757     else
    2758     {
    2759         [fTableView reloadData];
    2760        
    2761         if (groupRows)
    2762         {
    2763             for (TorrentGroup * group in fDisplayedTorrents)
    2764             {
    2765                 if ([fTableView isGroupCollapsed: [group groupIndex]])
    2766                     [fTableView collapseItem: group];
    2767                 else
    2768                     [fTableView expandItem: group];
    2769             }
    2770         }
    2771     }
    2772    
    2773     if (!onLion)
    2774         [fTableView selectValues: selectedValuesSL];
    2775    
     2693
     2694    if (beganUpdates)
     2695        [fTableView endUpdates];
     2696    [fTableView setNeedsDisplay: YES];
     2697   
     2698    [NSAnimationContext endGrouping];
     2699
    27762700    [self resetInfo]; //if group is already selected, but the torrents in it change
    27772701   
     
    27942718- (IBAction) showGlobalPopover: (id) sender
    27952719{
    2796     if ([NSApp isOnLionOrBetter])
    2797     {
    2798         if (fGlobalPopoverShown)
    2799             return;
    2800        
    2801         NSPopover * popover = [[NSPopoverLion alloc] init];
    2802         [popover setBehavior: NSPopoverBehaviorTransient];
    2803         GlobalOptionsPopoverViewController * viewController = [[GlobalOptionsPopoverViewController alloc] initWithHandle: fLib];
    2804         [popover setContentViewController: viewController];
    2805         [popover setDelegate: self];
    2806        
    2807         [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge];
    2808        
    2809         [viewController release];
    2810         [popover release];
    2811     }
    2812     else
    2813     {
    2814         //place menu below button
    2815         NSRect rect = [sender frame];
    2816         NSPoint location = rect.origin;
    2817         location.y += NSHeight(rect) + 5.0;
    2818        
    2819         [fActionMenu popUpMenuPositioningItem: nil atLocation: location inView: sender];
    2820     }
     2720    if (fGlobalPopoverShown)
     2721        return;
     2722   
     2723    NSPopover * popover = [[NSPopover alloc] init];
     2724    [popover setBehavior: NSPopoverBehaviorTransient];
     2725    GlobalOptionsPopoverViewController * viewController = [[GlobalOptionsPopoverViewController alloc] initWithHandle: fLib];
     2726    [popover setContentViewController: viewController];
     2727    [popover setDelegate: self];
     2728   
     2729    [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge];
     2730   
     2731    [viewController release];
     2732    [popover release];
    28212733}
    28222734
     
    28462758            NSMenuItem * item = [[groupMenu itemAtIndex: 0] retain];
    28472759            [groupMenu removeItemAtIndex: 0];
    2848             [menu addItem: item];
    2849             [item release];
    2850         }
    2851     }
    2852     else if (menu == fUploadMenu || menu == fDownloadMenu)
    2853     {
    2854         if ([menu numberOfItems] > 3)
    2855             return;
    2856        
    2857         const NSInteger speedLimitActionValue[] = { 5, 10, 20, 30, 40, 50, 75, 100, 150, 200, 250, 500, 750, 1000, 1500, 2000, -1 };
    2858        
    2859         NSMenuItem * item;
    2860         for (NSInteger i = 0; speedLimitActionValue[i] != -1; i++)
    2861         {
    2862             item = [[NSMenuItem alloc] initWithTitle: [NSString stringWithFormat: NSLocalizedString(@"%d KB/s",
    2863                     "Action menu -> upload/download limit"), speedLimitActionValue[i]] action: @selector(setQuickLimitGlobal:)
    2864                     keyEquivalent: @""];
    2865             [item setTarget: self];
    2866             [item setRepresentedObject: [NSNumber numberWithInt: speedLimitActionValue[i]]];
    2867             [menu addItem: item];
    2868             [item release];
    2869         }
    2870     }
    2871     else if (menu == fRatioStopMenu)
    2872     {
    2873         if ([menu numberOfItems] > 3)
    2874             return;
    2875        
    2876         const float ratioLimitActionValue[] = { 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, -1 };
    2877        
    2878         NSMenuItem * item;
    2879         for (NSInteger i = 0; ratioLimitActionValue[i] != -1; i++)
    2880         {
    2881             item = [[NSMenuItem alloc] initWithTitle: [NSString localizedStringWithFormat: @"%.2f", ratioLimitActionValue[i]]
    2882                     action: @selector(setQuickRatioGlobal:) keyEquivalent: @""];
    2883             [item setTarget: self];
    2884             [item setRepresentedObject: [NSNumber numberWithFloat: ratioLimitActionValue[i]]];
    28852760            [menu addItem: item];
    28862761            [item release];
     
    29432818   
    29442819    [dict release];
    2945 }
    2946 
    2947 - (void) setLimitGlobalEnabled: (id) sender
    2948 {
    2949     BOOL upload = [sender menu] == fUploadMenu;
    2950     [fDefaults setBool: sender == (upload ? fUploadLimitItem : fDownloadLimitItem) forKey: upload ? @"CheckUpload" : @"CheckDownload"];
    2951    
    2952     [fPrefsController applySpeedSettings: nil];
    2953 }
    2954 
    2955 - (void) setQuickLimitGlobal: (id) sender
    2956 {
    2957     BOOL upload = [sender menu] == fUploadMenu;
    2958     [fDefaults setInteger: [[sender representedObject] intValue] forKey: upload ? @"UploadLimit" : @"DownloadLimit"];
    2959     [fDefaults setBool: YES forKey: upload ? @"CheckUpload" : @"CheckDownload"];
    2960    
    2961     [fPrefsController updateLimitFields];
    2962     [fPrefsController applySpeedSettings: nil];
    2963 }
    2964 
    2965 - (void) setRatioGlobalEnabled: (id) sender
    2966 {
    2967     [fDefaults setBool: sender == fCheckRatioItem forKey: @"RatioCheck"];
    2968    
    2969     [fPrefsController applyRatioSetting: nil];
    2970 }
    2971 
    2972 - (void) setQuickRatioGlobal: (id) sender
    2973 {
    2974     [fDefaults setBool: YES forKey: @"RatioCheck"];
    2975     [fDefaults setFloat: [[sender representedObject] floatValue] forKey: @"RatioLimit"];
    2976    
    2977     [fPrefsController updateRatioStopFieldOld];
    29782820}
    29792821
     
    32333075    if ([[pasteboard types] containsObject: TORRENT_TABLE_VIEW_DATA_TYPE])
    32343076    {
    3235         //remember selected rows
    3236         NSArray * selectedValues = nil;
    3237         if (![NSApp isOnLionOrBetter])
    3238             selectedValues = [fTableView selectedValues];
    3239    
    32403077        NSIndexSet * indexes = [NSKeyedUnarchiver unarchiveObjectWithData: [pasteboard dataForType: TORRENT_TABLE_VIEW_DATA_TYPE]];
    32413078       
     
    32853122           
    32863123            //do the drag animation here so that the dragged torrents are the ones that are animated as moving, and not the torrents around them
    3287             const BOOL onLion = [NSApp isOnLionOrBetter];
    3288             if (onLion)
    3289                 [fTableView beginUpdates];
     3124            [fTableView beginUpdates];
    32903125           
    32913126            NSUInteger insertDisplayIndex = topTorrent ? [groupTorrents indexOfObject: topTorrent] + 1 : 0;
     
    33113146                    [oldTorrents removeObjectAtIndex: oldIndex];
    33123147                }
    3313                
    3314                 if (onLion)
    3315                     [fTableView moveItemAtIndex: oldIndex inParent: oldParent toIndex: insertDisplayIndex inParent: item];
     3148
     3149                [fTableView moveItemAtIndex: oldIndex inParent: oldParent toIndex: insertDisplayIndex inParent: item];
    33163150               
    33173151                ++insertDisplayIndex;
    33183152            }
    3319            
    3320             if (onLion)
    3321                 [fTableView endUpdates];
     3153
     3154            [fTableView endUpdates];
    33223155        }
    33233156       
    33243157        [self applyFilter];
    3325         if (selectedValues)
    3326             [fTableView selectValues: selectedValues];
    33273158    }
    33283159   
     
    34543285   
    34553286    [fTableView setRowHeight: makeSmall ? ROW_HEIGHT_SMALL : ROW_HEIGHT_REGULAR];
    3456    
    3457     if ([NSApp isOnLionOrBetter])
    3458         [fTableView beginUpdates];
     3287
     3288    [fTableView beginUpdates];
    34593289    [fTableView noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fTableView numberOfRows])]];
    3460     if ([NSApp isOnLionOrBetter])
    3461         [fTableView endUpdates];
     3290    [fTableView endUpdates];
    34623291   
    34633292    //resize for larger min height if not set to auto size
     
    34953324    [fDefaults setBool: ![fDefaults boolForKey: @"DisplayProgressBarAvailable"] forKey: @"DisplayProgressBarAvailable"];
    34963325    [fTableView display];
    3497 }
    3498 
    3499 #warning elliminate when 10.7-only
    3500 - (void) toggleStatusString: (id) sender
    3501 {
    3502     if ([fDefaults boolForKey: @"SmallView"])
    3503         [fDefaults setBool: ![fDefaults boolForKey: @"DisplaySmallStatusRegular"] forKey: @"DisplaySmallStatusRegular"];
    3504     else
    3505         [fDefaults setBool: ![fDefaults boolForKey: @"DisplayStatusProgressSelected"] forKey: @"DisplayStatusProgressSelected"];
    3506    
    3507     [fTableView setNeedsDisplay: YES];
    35083326}
    35093327
     
    43024120    }
    43034121   
    4304     #warning remove when menu is removed (10.7-only)
    4305     if (action == @selector(toggleStatusString:))
    4306     {
    4307         if ([fDefaults boolForKey: @"SmallView"])
    4308         {
    4309             [menuItem setTitle: NSLocalizedString(@"Remaining Time", "Action menu -> status string toggle")];
    4310             [menuItem setState: ![fDefaults boolForKey: @"DisplaySmallStatusRegular"] ? NSOnState : NSOffState];
    4311         }
    4312         else
    4313         {
    4314             [menuItem setTitle: NSLocalizedString(@"Status of Selected Files", "Action menu -> status string toggle")];
    4315             [menuItem setState: [fDefaults boolForKey: @"DisplayStatusProgressSelected"] ? NSOnState : NSOffState];
    4316         }
    4317        
    4318         return [fWindow isVisible];
    4319     }
    4320    
    43214122    if (action == @selector(toggleAvailabilityBar:))
    43224123    {
     
    43254126    }
    43264127   
    4327     if (action == @selector(setLimitGlobalEnabled:))
    4328     {
    4329         BOOL upload = [menuItem menu] == fUploadMenu;
    4330         BOOL limit = menuItem == (upload ? fUploadLimitItem : fDownloadLimitItem);
    4331         if (limit)
    4332             [menuItem setTitle: [NSString stringWithFormat: NSLocalizedString(@"Limit (%d KB/s)",
    4333                                     "Action menu -> upload/download limit"),
    4334                                     [fDefaults integerForKey: upload ? @"UploadLimit" : @"DownloadLimit"]]];
    4335        
    4336         [menuItem setState: [fDefaults boolForKey: upload ? @"CheckUpload" : @"CheckDownload"] ? limit : !limit];
    4337         return YES;
    4338     }
    4339    
    4340     if (action == @selector(setRatioGlobalEnabled:))
    4341     {
    4342         BOOL check = menuItem == fCheckRatioItem;
    4343         if (check)
    4344             [menuItem setTitle: [NSString localizedStringWithFormat: NSLocalizedString(@"Stop at Ratio (%.2f)",
    4345                                     "Action menu -> ratio stop"), [fDefaults floatForKey: @"RatioLimit"]]];
    4346        
    4347         [menuItem setState: [fDefaults boolForKey: @"RatioCheck"] ? check : !check];
    4348         return YES;
    4349     }
    4350 
    43514128    //enable show info
    43524129    if (action == @selector(showInfo:))
Note: See TracChangeset for help on using the changeset viewer.