Ignore:
Timestamp:
Jan 6, 2011, 4:09:04 AM (11 years ago)
Author:
livings124
Message:

replace the "Reverse Sort Order" menu item with "Ascending" and "Descending" menu items

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r11621 r11640  
    9999    SORT_ACTIVITY_TAG = 6
    100100} sortTag;
     101
     102typedef enum
     103{
     104    SORT_ASC_TAG = 0,
     105    SORT_DESC_TAG = 1
     106} sortOrderTag;
     107
    101108
    102109#define FILTER_NONE     @"None"
     
    20582065- (void) setSortReverse: (id) sender
    20592066{
    2060     [fDefaults setBool: ![fDefaults boolForKey: @"SortReverse"] forKey: @"SortReverse"];
    2061     [self sortTorrents];
     2067    const BOOL setReverse = [sender tag] == SORT_DESC_TAG;
     2068    if (setReverse != [fDefaults boolForKey: @"SortReverse"])
     2069    {
     2070        [fDefaults setBool: setReverse forKey: @"SortReverse"];
     2071        [self sortTorrents];
     2072    }
    20622073}
    20632074
     
    40224033    if (action == @selector(setSortReverse:))
    40234034    {
    4024         [menuItem setState: [fDefaults boolForKey: @"SortReverse"] ? NSOnState : NSOffState];
     4035        const BOOL isReverse = [menuItem tag] == SORT_DESC_TAG;
     4036        [menuItem setState: (isReverse == [fDefaults boolForKey: @"SortReverse"]) ? NSOnState : NSOffState];
    40254037        return ![[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER];
    40264038    }
Note: See TracChangeset for help on using the changeset viewer.