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

This commit is contained in:
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 = { ACTIONS = {
showFileInFinder = id; showFileInFinder = id;
sortByPath = id;
takeRepeatFromObject = id; takeRepeatFromObject = id;
takeShuffleFromObject = id; takeShuffleFromObject = id;
}; };

View file

@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <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> <key>IBEditorPositions</key>
<dict> <dict>
<key>1063</key> <key>1063</key>
@ -11,7 +11,7 @@
<key>1156</key> <key>1156</key>
<string>391 336 241 366 0 0 1024 746 </string> <string>391 336 241 366 0 0 1024 746 </string>
<key>29</key> <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> <key>463</key>
<string>341 447 341 145 0 0 1024 746 </string> <string>341 447 341 145 0 0 1024 746 </string>
<key>513</key> <key>513</key>
@ -32,11 +32,11 @@
<integer>4</integer> <integer>4</integer>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>21</integer>
<integer>1156</integer>
<integer>29</integer>
<integer>463</integer>
<integer>513</integer> <integer>513</integer>
<integer>21</integer>
<integer>29</integer>
<integer>1156</integer>
<integer>463</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8L127</string> <string>8L127</string>

Binary file not shown.

View file

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

View file

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