Click index column to remove sort descriptor. Added sort by path connection.

CQTexperiment
vspader 2007-02-18 22:27:55 +00:00
parent 4a2cddb8ab
commit 59b42286e5
5 changed files with 18 additions and 9 deletions

View File

@ -123,6 +123,7 @@
{
ACTIONS = {
showFileInFinder = id;
sortByPath = id;
takeRepeatFromObject = id;
takeShuffleFromObject = id;
};

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>48 332 639 388 0 0 1024 746 </string>
<string>56 66 639 388 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>1063</key>
@ -11,7 +11,7 @@
<key>1156</key>
<string>391 336 241 366 0 0 1024 746 </string>
<key>29</key>
<string>79 702 383 44 0 0 1024 746 </string>
<string>-3 695 383 44 0 0 1024 746 </string>
<key>463</key>
<string>341 447 341 145 0 0 1024 746 </string>
<key>513</key>
@ -32,11 +32,11 @@
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
<integer>1156</integer>
<integer>29</integer>
<integer>463</integer>
<integer>513</integer>
<integer>21</integer>
<integer>29</integer>
<integer>1156</integer>
<integer>463</integer>
</array>
<key>IBSystem Version</key>
<string>8L127</string>

Binary file not shown.

View File

@ -51,6 +51,8 @@
- (IBAction)takeShuffleFromObject:(id)sender;
- (IBAction)takeRepeatFromObject:(id)sender;
- (IBAction)sortByPath:(id)sender;
- (void)setTotalTimeDisplay:(NSString *)ttd;
- (NSString *)totalTimeDisplay;

View File

@ -354,17 +354,23 @@
//Cheap hack so the index column isn't sorted
if (([sortDescriptors count] != 0) && [[[sortDescriptors objectAtIndex:0] key] caseInsensitiveCompare:@"displayIndex"] == NSOrderedSame)
{
//Remove the sort descriptors
[super setSortDescriptors:nil];
[self rearrangeObjects];
return;
}
[super setSortDescriptors:sortDescriptors];
}
- (void)sortByPath
- (IBAction)sortByPath:(id)sender
{
NSSortDescriptor *s = [[NSSortDescriptor alloc] initWithKey:@"filename" ascending:YES selector:@selector(compare:)];
// [self setSortDescriptors:[NSArray arrayWithObject:s]];
[self setContent:[[self content] sortedArrayUsingDescriptors:[NSArray arrayWithObject:s]]];
[self setSortDescriptors:[NSArray arrayWithObject:s]];
[self rearrangeObjects];
[s release];
if (shuffle == YES)