diff --git a/English.lproj/MainMenu.nib/classes.nib b/English.lproj/MainMenu.nib/classes.nib index 61c68fb47..f1f2ef367 100644 --- a/English.lproj/MainMenu.nib/classes.nib +++ b/English.lproj/MainMenu.nib/classes.nib @@ -84,7 +84,11 @@ SUPERCLASS = NSObject; }, { - ACTIONS = {takeRepeatFromObject = id; takeShuffleFromObject = id; }; + ACTIONS = { + showFileInFinder = id; + takeRepeatFromObject = id; + takeShuffleFromObject = id; + }; CLASS = PlaylistController; LANGUAGE = ObjC; SUPERCLASS = DNDArrayController; diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib index 793587e98..54f43a740 100644 --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -3,15 +3,17 @@ IBDocumentLocation - -18 96 617 240 0 0 1024 746 + -9 67 617 240 0 0 1280 1002 IBEditorPositions + 1063 + 0 312 189 49 0 0 1280 1002 29 - 98 651 409 44 0 0 1024 746 + 139 888 409 44 0 0 1280 1002 463 - 358 426 308 187 0 0 1024 746 + 486 586 308 187 0 0 1280 1002 513 - 639 190 125 137 0 0 1024 746 + 821 270 125 137 0 0 1280 1002 IBFramework Version 443.0 @@ -28,11 +30,12 @@ 3 IBOpenObjects + 1063 + 513 + 21 463 823 29 - 21 - 513 IBSystem Version 8I127 diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index 8ec89cdaa..2158217d8 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/French.lproj/MainMenu.nib/classes.nib b/French.lproj/MainMenu.nib/classes.nib index 2f451813f..6b7a8f9c3 100644 --- a/French.lproj/MainMenu.nib/classes.nib +++ b/French.lproj/MainMenu.nib/classes.nib @@ -89,7 +89,11 @@ SUPERCLASS = NSObject; }, { - ACTIONS = {takeRepeatFromObject = id; takeShuffleFromObject = id; }; + ACTIONS = { + showFileInFinder = id; + takeRepeatFromObject = id; + takeShuffleFromObject = id; + }; CLASS = PlaylistController; LANGUAGE = ObjC; SUPERCLASS = DNDArrayController; @@ -105,7 +109,6 @@ }; SUPERCLASS = NSTableView; }, - {CLASS = SeekSlider; LANGUAGE = ObjC; SUPERCLASS = NSSlider; }, { ACTIONS = { changeVolume = id; diff --git a/French.lproj/MainMenu.nib/info.nib b/French.lproj/MainMenu.nib/info.nib index 1e6eacd86..6c0d462fc 100644 --- a/French.lproj/MainMenu.nib/info.nib +++ b/French.lproj/MainMenu.nib/info.nib @@ -12,6 +12,8 @@ 486 586 308 187 0 0 1280 1002 513 689 788 166 137 0 0 1280 1002 + 760 + 465 451 189 49 0 0 1280 1002 IBFramework Version 443.0 @@ -22,7 +24,7 @@ IBOpenObjects 21 - 463 + 760 IBSystem Version 8I127 diff --git a/French.lproj/MainMenu.nib/keyedobjects.nib b/French.lproj/MainMenu.nib/keyedobjects.nib index 222b0c01b..344d16143 100644 Binary files a/French.lproj/MainMenu.nib/keyedobjects.nib and b/French.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Playlist/PlaylistController.h b/Playlist/PlaylistController.h index 6d26953db..ab8149ab6 100644 --- a/Playlist/PlaylistController.h +++ b/Playlist/PlaylistController.h @@ -23,6 +23,8 @@ BOOL shuffle; BOOL repeat; + + int selectedRow; } //All these return the number of things actually added @@ -73,4 +75,7 @@ - (void)setPlaylistFilename:(NSString *)pf; - (NSArray *)acceptablePlaylistTypes; +- (IBAction)showFileInFinder:(id)sender; +- (void)setSelectedRow:(int)row; +- (int)selectedRow; @end diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 2eceaf366..ef2bacaab 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -696,4 +696,24 @@ playlistFilename = pf; } +- (IBAction)showFileInFinder:(id)sender +{ + NSWorkspace* ws = [NSWorkspace sharedWorkspace]; + if (selectedRow < 0) + return; + + PlaylistEntry* curr = [self entryAtIndex:selectedRow]; + [ws selectFile:[curr filename] inFileViewerRootedAtPath:[curr filename]]; +} + +- (void)setSelectedRow:(int)row +{ + selectedRow = row; +} + +- (int)selectedRow +{ + return selectedRow; +} + @end diff --git a/Playlist/PlaylistView.m b/Playlist/PlaylistView.m index b8e9b905f..2de9c1b10 100644 --- a/Playlist/PlaylistView.m +++ b/Playlist/PlaylistView.m @@ -59,6 +59,36 @@ } } +// enables right-click selection for "Show in Finder" contextual menu +-(NSMenu*)menuForEvent:(NSEvent*)event +{ + //Find which row is under the cursor + [[self window] makeFirstResponder:self]; + NSPoint menuPoint = [self convertPoint:[event locationInWindow] fromView:nil]; + int row = [self rowAtPoint:menuPoint]; + + /* Update the table selection before showing menu + Preserves the selection if the row under the mouse is selected (to allow for + multiple items to be selected), otherwise selects the row under the mouse */ + BOOL currentRowIsSelected = [[self selectedRowIndexes] containsIndex:row]; + if (!currentRowIsSelected) + [self selectRow:row byExtendingSelection:NO]; + + [playlistController setSelectedRow:[self selectedRow]]; + + if ([self numberOfSelectedRows] <=0) + { + //No rows are selected, so the table should be displayed with all items disabled + NSMenu* tableViewMenu = [[self menu] copy]; + int i; + for (i=0;i<[tableViewMenu numberOfItems];i++) + [[tableViewMenu itemAtIndex:i] setEnabled:NO]; + return [tableViewMenu autorelease]; + } + else + return [self menu]; +} + - (void)keyDown:(NSEvent *)e {