Changeset 577


Ignore:
Timestamp:
Jul 15, 2006, 4:33:39 PM (16 years ago)
Author:
livings124
Message:

Filter can now only be accessed from the filter bar.

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BarButton.m

    r576 r577  
    3434        fMouseIn = NO;
    3535       
    36         fButtonNormal = [[NSImage alloc] initWithSize: [self frame].size];
    37         fButtonIn = [[NSImage alloc] initWithSize: [self frame].size];
    38         fButtonDown = [[NSImage alloc] initWithSize: [self frame].size];
     36        NSSize buttonSize = [self frame].size;
     37        fButtonNormal = [[NSImage alloc] initWithSize: buttonSize];
     38        fButtonIn = [[NSImage alloc] initWithSize: buttonSize];
     39        fButtonDown = [[NSImage alloc] initWithSize: buttonSize];
    3940       
    4041        //create shape
     
    4243        float ovalDiamater = 20.0;
    4344        [rect appendBezierPathWithOvalInRect:
    44                 NSMakeRect(0, 0, ovalDiamater, [self frame].size.height)];
     45                NSMakeRect(0, 0, ovalDiamater, buttonSize.height)];
    4546        [rect appendBezierPathWithOvalInRect:
    46                 NSMakeRect([self frame].size.width - ovalDiamater, 0, ovalDiamater, [self frame].size.height)];
     47                NSMakeRect(buttonSize.width - ovalDiamater, 0, ovalDiamater, buttonSize.height)];
    4748        [rect appendBezierPathWithRect:
    48                 NSMakeRect(ovalDiamater * 0.5, 0, [self frame].size.width - ovalDiamater, [self frame].size.height)];
     49                NSMakeRect(ovalDiamater * 0.5, 0, buttonSize.width - ovalDiamater, buttonSize.height)];
    4950       
    5051        //create highlighted button
  • trunk/macosx/Controller.h

    r576 r577  
    6060    IBOutlet NSTextField        * fTotalDLField, * fTotalULField, * fTotalTorrentsField;
    6161   
    62     NSString                    * fSortType, * fFilterType;
     62    NSString                    * fSortType;
    6363    IBOutlet NSMenuItem         * fNameSortItem, * fStateSortItem, * fProgressSortItem,
    64                                 * fDateSortItem, * fOrderSortItem,
    65                                 * fNoFilterItem, * fPauseFilterItem,
    66                                 * fSeedFilterItem, * fDownloadFilterItem;
     64                                * fDateSortItem, * fOrderSortItem;
    6765   
    6866    IBOutlet NSView             * fFilterBar;
    6967    BOOL                        fFilterBarVisible;
     68    NSString                    * fFilterType;
    7069    IBOutlet BarButton          * fNoFilterButton, * fPauseFilterButton,
    7170                                * fSeedFilterButton, * fDownloadFilterButton;
  • trunk/macosx/Controller.m

    r576 r577  
    224224    BarButton * currentFilterButton;
    225225    if ([fFilterType isEqualToString: @"Pause"])
    226     {
    227         currentFilterItem = fPauseFilterItem;
    228226        currentFilterButton = fPauseFilterButton;
    229     }
    230227    else if ([fFilterType isEqualToString: @"Seed"])
    231     {
    232         currentFilterItem = fSeedFilterItem;
    233228        currentFilterButton = fSeedFilterButton;
    234     }
    235229    else if ([fFilterType isEqualToString: @"Download"])
    236     {
    237         currentFilterItem = fDownloadFilterItem;
    238230        currentFilterButton = fDownloadFilterButton;
    239     }
    240231    else
    241     {
    242         currentFilterItem = fNoFilterItem;
    243232        currentFilterButton = fNoFilterButton;
    244     }
    245    
    246     [currentFilterItem setState: NSOnState];
     233
    247234    [currentFilterButton setEnabled: YES];
    248235   
     
    10561043- (void) setFilter: (id) sender
    10571044{
    1058     NSMenuItem * prevFilterItem;
    10591045    BarButton * prevFilterButton;
    10601046    if ([fFilterType isEqualToString: @"Pause"])
    1061     {
    1062         prevFilterItem = fPauseFilterItem;
    10631047        prevFilterButton = fPauseFilterButton;
    1064     }
    10651048    else if ([fFilterType isEqualToString: @"Seed"])
    1066     {
    1067         prevFilterItem = fSeedFilterItem;
    10681049        prevFilterButton = fSeedFilterButton;
    1069     }
    10701050    else if ([fFilterType isEqualToString: @"Download"])
    1071     {
    1072         prevFilterItem = fDownloadFilterItem;
    10731051        prevFilterButton = fDownloadFilterButton;
    1074     }
    10751052    else
    1076     {
    1077         prevFilterItem = fNoFilterItem;
    10781053        prevFilterButton = fNoFilterButton;
    1079     }
    1080    
    1081     if (sender != prevFilterItem && sender != prevFilterButton)
    1082     {
    1083         [prevFilterItem setState: NSOffState];
     1054   
     1055    if (sender != prevFilterButton)
     1056    {
    10841057        [prevFilterButton setEnabled: NO];
    1085 
    1086         NSMenuItem * currentFilterItem;
    1087         BarButton * currentFilterButton;
     1058        [sender setEnabled: YES];
     1059
    10881060        [fFilterType release];
    1089         if (sender == fDownloadFilterItem || sender == fDownloadFilterButton)
    1090         {
     1061        if (sender == fDownloadFilterButton)
    10911062            fFilterType = [[NSString alloc] initWithString: @"Download"];
    1092             currentFilterItem = fDownloadFilterItem;
    1093             currentFilterButton = fDownloadFilterButton;
    1094         }
    1095         else if (sender == fPauseFilterItem || sender == fPauseFilterButton)
    1096         {
     1063        else if (sender == fPauseFilterButton)
    10971064            fFilterType = [[NSString alloc] initWithString: @"Pause"];
    1098             currentFilterItem = fPauseFilterItem;
    1099             currentFilterButton = fPauseFilterButton;
    1100         }
    1101         else if (sender == fSeedFilterItem || sender == fSeedFilterButton)
    1102         {
     1065        else if (sender == fSeedFilterButton)
    11031066            fFilterType = [[NSString alloc] initWithString: @"Seed"];
    1104             currentFilterItem = fSeedFilterItem;
    1105             currentFilterButton = fSeedFilterButton;
    1106         }
    11071067        else
    1108         {
    11091068            fFilterType = [[NSString alloc] initWithString: @"None"];
    1110             currentFilterItem = fNoFilterItem;
    1111             currentFilterButton = fNoFilterButton;
    1112         }
    1113        
    1114         [currentFilterItem setState: NSOnState];
    1115         [currentFilterButton setEnabled: YES];
     1069
    11161070        [fDefaults setObject: fFilterType forKey: @"Filter"];
    11171071    }
  • trunk/macosx/English.lproj/MainMenu.nib/classes.nib

    r576 r577  
    4141                fDateSortItem = NSMenuItem;
    4242                fDownloadFilterButton = BarButton;
    43                 fDownloadFilterItem = NSMenuItem;
    4443                fDownloadLimitItem = NSMenuItem;
    4544                fDownloadMenu = NSMenu;
     
    4948                fNextInfoTabItem = NSMenuItem;
    5049                fNoFilterButton = BarButton;
    51                 fNoFilterItem = NSMenuItem;
    5250                fOrderSortItem = NSMenuItem;
    5351                fPauseFilterButton = BarButton;
    54                 fPauseFilterItem = NSMenuItem;
    5552                fPrevInfoTabItem = NSMenuItem;
    5653                fProgressSortItem = NSMenuItem;
     
    5956                fScrollView = NSScrollView;
    6057                fSeedFilterButton = BarButton;
    61                 fSeedFilterItem = NSMenuItem;
    6258                fSmallViewItem = NSMenuItem;
    6359                fSpeedLimitButton = NSButton;
Note: See TracChangeset for help on using the changeset viewer.