diff --git a/AppController.h b/AppController.h index ef09b4fd5..055c31295 100644 --- a/AppController.h +++ b/AppController.h @@ -30,9 +30,6 @@ - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo; -- (IBAction)sortByPath:(id)sender; -- (IBAction)shufflePlaylist:(id)sender; - - (IBAction)donate:(id)sender; - (IBAction)toggleInfoDrawer:(id)sender; diff --git a/AppController.m b/AppController.m index ae83522d7..c603a2551 100644 --- a/AppController.m +++ b/AppController.m @@ -166,16 +166,6 @@ [infoButton setState:NSOffState]; } -- (IBAction)sortByPath:(id)sender -{ - [playlistController sortByPath]; -} - -- (IBAction)shufflePlaylist:(id)sender -{ - [playlistController randomizeList]; -} - - (IBAction)donate:(id)sender { [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://sourceforge.net/project/project_donations.php?group_id=140003"]]; diff --git a/Cog.xcodeproj/project.pbxproj b/Cog.xcodeproj/project.pbxproj index 87b6ca4c7..6c1b679b3 100644 --- a/Cog.xcodeproj/project.pbxproj +++ b/Cog.xcodeproj/project.pbxproj @@ -99,7 +99,6 @@ 8E757B5709F326710080F1EE /* OggFLAC.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8E75773809F31F1F0080F1EE /* OggFLAC.framework */; }; 8E757C7C09F32F070080F1EE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E757C7A09F32F070080F1EE /* AudioToolbox.framework */; }; 8E757C7D09F32F070080F1EE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E757C7B09F32F070080F1EE /* AudioUnit.framework */; }; - 8EEBC1B50A177D70006F6251 /* PlaylistEntry.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = 8EEBC1B40A177D70006F6251 /* PlaylistEntry.xcdatamodel */; }; /* End PBXBuildFile section */ /* Begin PBXBuildStyle section */ @@ -278,7 +277,6 @@ 8E75777809F320D50080F1EE /* SndFile.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SndFile.framework; path = Libraries/SndFile/build/Release/SndFile.framework; sourceTree = ""; }; 8E757C7A09F32F070080F1EE /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 8E757C7B09F32F070080F1EE /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; - 8EEBC1B40A177D70006F6251 /* PlaylistEntry.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = PlaylistEntry.xcdatamodel; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -348,7 +346,6 @@ 29B97314FDCFA39411CA2CEA /* Cog */ = { isa = PBXGroup; children = ( - 8EEBC1AF0A177D14006F6251 /* Models */, 080E96DDFE201D6D7F000001 /* Classes */, 8E75751809F31D5A0080F1EE /* AppController.h */, 8E75751909F31D5A0080F1EE /* AppController.m */, @@ -576,14 +573,6 @@ name = "Codec Frameworks"; sourceTree = ""; }; - 8EEBC1AF0A177D14006F6251 /* Models */ = { - isa = PBXGroup; - children = ( - 8EEBC1B40A177D70006F6251 /* PlaylistEntry.xcdatamodel */, - ); - name = Models; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -713,7 +702,6 @@ 8E4C7F090A0509FC003BE25F /* DragScrollView.m in Sources */, 8E6A8E2C0A0D8A68002ABE9C /* CoreAudioFile.m in Sources */, 8E6A8E380A0D8AD8002ABE9C /* CoreAudioUtils.m in Sources */, - 8EEBC1B50A177D70006F6251 /* PlaylistEntry.xcdatamodel in Sources */, 8E1296DB0A2BA9CE00443124 /* PlaylistHeaderView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/English.lproj/MainMenu.nib/classes.nib b/English.lproj/MainMenu.nib/classes.nib index f1f2ef367..7cad1b2ce 100644 --- a/English.lproj/MainMenu.nib/classes.nib +++ b/English.lproj/MainMenu.nib/classes.nib @@ -95,10 +95,10 @@ }, {CLASS = PlaylistEntry; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { + ACTIONS = {shufflePlaylist = id; sortByPath = id; }; CLASS = PlaylistView; LANGUAGE = ObjC; OUTLETS = { - appController = AppController; playbackController = PlaybackController; playlistController = PlaylistController; }; diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib index 54f43a740..48d45a79a 100644 --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -7,13 +7,13 @@ IBEditorPositions 1063 - 0 312 189 49 0 0 1280 1002 + 0 228 136 49 0 0 1024 746 29 - 139 888 409 44 0 0 1280 1002 + 98 651 409 44 0 0 1024 746 463 - 486 586 308 187 0 0 1280 1002 + 358 426 308 187 0 0 1024 746 513 - 821 270 125 137 0 0 1280 1002 + 639 190 125 137 0 0 1024 746 IBFramework Version 443.0 @@ -30,12 +30,12 @@ 3 IBOpenObjects - 1063 - 513 - 21 + 29 463 823 - 29 + 21 + 1063 + 513 IBSystem Version 8I127 diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index 2158217d8..314197a06 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index a8ba93165..7fa40de9d 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -321,17 +321,16 @@ - (void)setSortDescriptors:(NSArray *)sortDescriptors { //Cheap hack so the index column isn't sorted - NSLog(@"KEY: %@", [[sortDescriptors objectAtIndex:0] key]); - if ([[[sortDescriptors objectAtIndex:0] key] caseInsensitiveCompare:@"displayIndex"] != NSOrderedSame) + if (([sortDescriptors count] != 0) && [[[sortDescriptors objectAtIndex:0] key] caseInsensitiveCompare:@"displayIndex"] == NSOrderedSame) { - [super setSortDescriptors:sortDescriptors]; + return; } + + [super setSortDescriptors:sortDescriptors]; } - (void)sortByPath { - [self setSortDescriptors:nil]; - NSSortDescriptor *s = [[NSSortDescriptor alloc] initWithKey:@"filename" ascending:YES selector:@selector(compare:)]; // [self setSortDescriptors:[NSArray arrayWithObject:s]]; [self setContent:[[self content] sortedArrayUsingDescriptors:[NSArray arrayWithObject:s]]]; diff --git a/Playlist/PlaylistView.h b/Playlist/PlaylistView.h index b2c7239de..13304136c 100644 --- a/Playlist/PlaylistView.h +++ b/Playlist/PlaylistView.h @@ -19,4 +19,8 @@ } +- (IBAction)sortByPath:(id)sender; +- (IBAction)shufflePlaylist:(id)sender; + + @end diff --git a/Playlist/PlaylistView.m b/Playlist/PlaylistView.m index 390eb6bd2..1ecf9ba83 100644 --- a/Playlist/PlaylistView.m +++ b/Playlist/PlaylistView.m @@ -127,4 +127,16 @@ } } +- (IBAction)sortByPath:(id)sender +{ + [self setSortDescriptors:nil]; + [playlistController sortByPath]; +} + +- (IBAction)shufflePlaylist:(id)sender +{ + [self setSortDescriptors:nil]; + [playlistController randomizeList]; +} + @end