Changeset 7802
- Timestamp:
- Jan 26, 2009, 2:16:03 AM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r7795 r7802 348 348 { 349 349 if ((history = [fDefaults arrayForKey: @"History"])) 350 { 350 351 [history retain]; 351 [fDefaults removeObjectForKey: @"History"]; 352 [fDefaults removeObjectForKey: @"History"]; 353 } 352 354 } 353 355 … … 1783 1785 { 1784 1786 NSString * sortType = [fDefaults stringForKey: @"Sort"]; 1785 const BOOL asc = ![fDefaults boolForKey: @"SortReverse"];1786 1787 NSSortDescriptor * nameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"name" ascending: asc1788 selector: @selector(compareFinder:)] autorelease];1789 1790 NSArray * descriptors = nil;1791 if ([sortType isEqualToString: SORT_NAME])1792 descriptors = [[NSArray alloc] initWithObjects: nameDescriptor, nil];1793 else if ([sortType isEqualToString: SORT_STATE])1794 {1795 NSSortDescriptor * stateDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"stateSortKey" ascending: !asc] autorelease],1796 * progressDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"progress" ascending: !asc] autorelease],1797 * ratioDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"ratio" ascending: !asc] autorelease];1798 1799 descriptors = [[NSArray alloc] initWithObjects: stateDescriptor, progressDescriptor, ratioDescriptor,1800 nameDescriptor, nil];1801 }1802 else if ([sortType isEqualToString: SORT_PROGRESS])1803 {1804 NSSortDescriptor * progressDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"progress" ascending: asc] autorelease],1805 * ratioProgressDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"progressStopRatio"1806 ascending: asc] autorelease],1807 * ratioDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"ratio" ascending: asc] autorelease];1808 1809 descriptors = [[NSArray alloc] initWithObjects: progressDescriptor, ratioProgressDescriptor, ratioDescriptor,1810 nameDescriptor, nil];1811 }1812 else if ([sortType isEqualToString: SORT_TRACKER])1813 {1814 NSSortDescriptor * trackerDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"trackerAddressAnnounce" ascending: asc1815 selector: @selector(localizedCaseInsensitiveCompare:)] autorelease];1816 1817 descriptors = [[NSArray alloc] initWithObjects: trackerDescriptor, nameDescriptor, nil];1818 }1819 else if ([sortType isEqualToString: SORT_ACTIVITY])1820 {1821 NSSortDescriptor * rateDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"totalRate" ascending: !asc] autorelease];1822 NSSortDescriptor * activityDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"dateActivityOrAdd" ascending: !asc]1823 autorelease];1824 1825 descriptors = [[NSArray alloc] initWithObjects: rateDescriptor, activityDescriptor, nameDescriptor, nil];1826 }1827 else if ([sortType isEqualToString: SORT_DATE])1828 {1829 NSSortDescriptor * dateDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"dateAdded" ascending: asc] autorelease];1830 1831 descriptors = [[NSArray alloc] initWithObjects: dateDescriptor, nameDescriptor, nil];1832 }1833 else; //no need to sort by queue order1834 1835 //actually sort1836 if (descriptors)1837 {1787 1788 if (![sortType isEqualToString: SORT_ORDER]) 1789 { 1790 const BOOL asc = ![fDefaults boolForKey: @"SortReverse"]; 1791 1792 NSArray * descriptors; 1793 NSSortDescriptor * nameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"name" ascending: asc 1794 selector: @selector(compareFinder:)] autorelease]; 1795 1796 if ([sortType isEqualToString: SORT_STATE]) 1797 { 1798 NSSortDescriptor * stateDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"stateSortKey" ascending: !asc] autorelease], 1799 * progressDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"progress" ascending: !asc] autorelease], 1800 * ratioDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"ratio" ascending: !asc] autorelease]; 1801 1802 descriptors = [[NSArray alloc] initWithObjects: stateDescriptor, progressDescriptor, ratioDescriptor, 1803 nameDescriptor, nil]; 1804 } 1805 else if ([sortType isEqualToString: SORT_PROGRESS]) 1806 { 1807 NSSortDescriptor * progressDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"progress" ascending: asc] autorelease], 1808 * ratioProgressDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"progressStopRatio" 1809 ascending: asc] autorelease], 1810 * ratioDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"ratio" ascending: asc] autorelease]; 1811 1812 descriptors = [[NSArray alloc] initWithObjects: progressDescriptor, ratioProgressDescriptor, ratioDescriptor, 1813 nameDescriptor, nil]; 1814 } 1815 else if ([sortType isEqualToString: SORT_TRACKER]) 1816 { 1817 NSSortDescriptor * trackerDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"trackerAddressAnnounce" ascending: asc 1818 selector: @selector(localizedCaseInsensitiveCompare:)] autorelease]; 1819 1820 descriptors = [[NSArray alloc] initWithObjects: trackerDescriptor, nameDescriptor, nil]; 1821 } 1822 else if ([sortType isEqualToString: SORT_ACTIVITY]) 1823 { 1824 NSSortDescriptor * rateDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"totalRate" ascending: !asc] autorelease]; 1825 NSSortDescriptor * activityDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"dateActivityOrAdd" ascending: !asc] 1826 autorelease]; 1827 1828 descriptors = [[NSArray alloc] initWithObjects: rateDescriptor, activityDescriptor, nameDescriptor, nil]; 1829 } 1830 else if ([sortType isEqualToString: SORT_DATE]) 1831 { 1832 NSSortDescriptor * dateDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"dateAdded" ascending: asc] autorelease]; 1833 1834 descriptors = [[NSArray alloc] initWithObjects: dateDescriptor, nameDescriptor, nil]; 1835 } 1836 else 1837 descriptors = [[NSArray alloc] initWithObjects: nameDescriptor, nil]; 1838 1839 //actually sort 1838 1840 if ([fDefaults boolForKey: @"SortByGroup"]) 1839 1841 { … … 1866 1868 NSArray * selectedValues = [fTableView selectedValues]; 1867 1869 1868 NS Integer active = 0, downloading = 0, seeding = 0, paused = 0;1870 NSUInteger active = 0, downloading = 0, seeding = 0, paused = 0; 1869 1871 NSString * filterType = [fDefaults stringForKey: @"Filter"]; 1870 1872 BOOL filterActive = NO, filterDownload = NO, filterSeed = NO, filterPause = NO, filterStatus = YES; … … 1880 1882 filterStatus = NO; 1881 1883 1882 NSInteger groupFilterValue = [fDefaults integerForKey: @"FilterGroup"];1883 BOOL filterGroup = groupFilterValue != GROUP_FILTER_ALL_TAG;1884 const NSInteger groupFilterValue = [fDefaults integerForKey: @"FilterGroup"]; 1885 const BOOL filterGroup = groupFilterValue != GROUP_FILTER_ALL_TAG; 1884 1886 1885 1887 NSString * searchString = [fSearchFilterField stringValue]; 1886 BOOL filterText = [searchString length] > 0,1887 filterTracker = filterText && [[fDefaults stringForKey: @"FilterSearchType"] isEqualToString: FILTER_TYPE_TRACKER];1888 const BOOL filterText = [searchString length] > 0, 1889 filterTracker = filterText && [[fDefaults stringForKey: @"FilterSearchType"] isEqualToString: FILTER_TYPE_TRACKER]; 1888 1890 1889 1891 NSMutableArray * allTorrents = [NSMutableArray arrayWithCapacity: [fTorrents count]]; -
trunk/macosx/FileOutlineController.m
r7659 r7802 30 30 #import "QuickLookController.h" 31 31 32 #define ROW_SMALL_HEIGHT 18.0 f32 #define ROW_SMALL_HEIGHT 18.0 33 33 34 34 typedef enum -
trunk/macosx/MessageWindowController.m
r7659 r7802 159 159 [NSString stringWithUTF8String: currentMessage->message], @"Message", 160 160 [NSDate dateWithTimeIntervalSince1970: currentMessage->when], @"Date", 161 [NSNumber numberWithUnsignedInt: fIndex ], @"Index", //more accurate when sorting by date161 [NSNumber numberWithUnsignedInt: fIndex++], @"Index", //more accurate when sorting by date 162 162 [NSNumber numberWithInt: currentMessage->level], @"Level", 163 163 name, @"Name", … … 166 166 167 167 [fMessages addObject: message]; 168 fIndex++;169 168 } 170 169 -
trunk/macosx/en.lproj/Localizable.strings
r7519 r7802 155 155 /* Groups -> Button */ 156 156 "All Groups" = "All Groups"; 157 158 /* Create torrent -> failed -> warning */ 159 "An unknown error has occurred." = "An unknown error has occurred."; 157 160 158 161 /* All toolbar item -> label */
Note: See TracChangeset
for help on using the changeset viewer.