diff --git a/src/apps/mediaplayer/MainWin.cpp b/src/apps/mediaplayer/MainWin.cpp index ad23ff05ca..b8834c2e81 100644 --- a/src/apps/mediaplayer/MainWin.cpp +++ b/src/apps/mediaplayer/MainWin.cpp @@ -2471,17 +2471,10 @@ MainWin::_KeyDown(BMessage* msg) break; case B_DELETE: - case 'd': // d for delete - case 't': // t for Trash - if ((modifiers() & B_COMMAND_KEY) != 0) { - BAutolock _(fPlaylist); - BMessage removeMessage(M_PLAYLIST_MOVE_TO_TRASH); - removeMessage.AddInt32("playlist index", - fPlaylist->CurrentItemIndex()); - fPlaylistWindow->PostMessage(&removeMessage); - return true; - } - break; + BAutolock _(fPlaylist); + BMessage removeMessage(M_PLAYLIST_REMOVE); + fPlaylistWindow->PostMessage(&removeMessage); + return true; } switch (key) { diff --git a/src/apps/mediaplayer/playlist/ListViews.cpp b/src/apps/mediaplayer/playlist/ListViews.cpp index b296ec4b6d..95b5728893 100644 --- a/src/apps/mediaplayer/playlist/ListViews.cpp +++ b/src/apps/mediaplayer/playlist/ListViews.cpp @@ -398,13 +398,13 @@ DragSortableListView::MessageReceived(BMessage* message) void DragSortableListView::KeyDown( const char* bytes, int32 numBytes ) { - if ( numBytes < 1 ) + if (numBytes < 1) return; - if ( ( bytes[0] == B_BACKSPACE ) || ( bytes[0] == B_DELETE ) ) + if (bytes[0] == B_BACKSPACE) RemoveSelected(); - BListView::KeyDown( bytes, numBytes ); + BListView::KeyDown(bytes, numBytes); } // MouseDown diff --git a/src/apps/mediaplayer/playlist/PlaylistListView.cpp b/src/apps/mediaplayer/playlist/PlaylistListView.cpp index 2468158621..b3fe60ef52 100644 --- a/src/apps/mediaplayer/playlist/PlaylistListView.cpp +++ b/src/apps/mediaplayer/playlist/PlaylistListView.cpp @@ -396,7 +396,6 @@ PlaylistListView::KeyDown(const char* bytes, int32 numBytes) break; case B_BACKSPACE: - case B_DELETE: RemoveSelected(); break; @@ -567,24 +566,6 @@ PlaylistListView::Randomize() } -void -PlaylistListView::RemoveSelectionToTrash() -{ - BList indices; - GetSelectedItems(indices); - RemoveItemList(indices, true); -} - - -void -PlaylistListView::RemoveToTrash(int32 index) -{ - BList indices; - indices.AddItem((void*)(addr_t)index); - RemoveItemList(indices, true); -} - - void PlaylistListView::RemoveItemList(const BList& indices, bool intoTrash) { diff --git a/src/apps/mediaplayer/playlist/PlaylistListView.h b/src/apps/mediaplayer/playlist/PlaylistListView.h index 8c8c9808fa..311f3170b0 100644 --- a/src/apps/mediaplayer/playlist/PlaylistListView.h +++ b/src/apps/mediaplayer/playlist/PlaylistListView.h @@ -47,8 +47,6 @@ public: int32 appendIndex); void Randomize(); - void RemoveSelectionToTrash(); - void RemoveToTrash(int32 index); void RemoveItemList(const BList& indices, bool intoTrash); virtual void SkipBackward(); diff --git a/src/apps/mediaplayer/playlist/PlaylistWindow.cpp b/src/apps/mediaplayer/playlist/PlaylistWindow.cpp index 1fef9dc702..9c03e13c53 100644 --- a/src/apps/mediaplayer/playlist/PlaylistWindow.cpp +++ b/src/apps/mediaplayer/playlist/PlaylistWindow.cpp @@ -246,16 +246,6 @@ PlaylistWindow::MessageReceived(BMessage* message) fListView->RemoveSelected(); break; - case M_PLAYLIST_MOVE_TO_TRASH: - { - int32 index; - if (message->FindInt32("playlist index", &index) == B_OK) - fListView->RemoveToTrash(index); - else - fListView->RemoveSelectionToTrash(); - break; - } - default: BWindow::MessageReceived(message); break; @@ -282,28 +272,21 @@ PlaylistWindow::_CreateMenu(BRect& frame) fileMenu->AddSeparatorItem(); - fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Close"), - new BMessage(B_QUIT_REQUESTED), 'W')); + fileMenu->AddItem(new BMenuItem(B_TRANSLATE("Close"), new BMessage(B_QUIT_REQUESTED), 'W')); BMenu* editMenu = new BMenu(B_TRANSLATE("Edit")); fUndoMI = new BMenuItem(B_TRANSLATE("Undo"), new BMessage(B_UNDO), 'Z'); editMenu->AddItem(fUndoMI); - fRedoMI = new BMenuItem(B_TRANSLATE("Redo"), new BMessage(B_REDO), 'Z', - B_SHIFT_KEY); + fRedoMI = new BMenuItem(B_TRANSLATE("Redo"), new BMessage(B_REDO), 'Z', B_SHIFT_KEY); editMenu->AddItem(fRedoMI); editMenu->AddSeparatorItem(); - editMenu->AddItem(new BMenuItem(B_TRANSLATE("Select all"), - new BMessage(B_SELECT_ALL), 'A')); + editMenu->AddItem(new BMenuItem(B_TRANSLATE("Select all"), new BMessage(B_SELECT_ALL), 'A')); editMenu->AddSeparatorItem(); - editMenu->AddItem(new BMenuItem(B_TRANSLATE("Randomize"), - new BMessage(M_PLAYLIST_RANDOMIZE), 'R')); + editMenu->AddItem( + new BMenuItem(B_TRANSLATE("Randomize"), new BMessage(M_PLAYLIST_RANDOMIZE), 'R')); editMenu->AddSeparatorItem(); - editMenu->AddItem(new BMenuItem(B_TRANSLATE("Remove"), - new BMessage(M_PLAYLIST_REMOVE)/*, B_DELETE, 0*/)); - // TODO: See if we can support the modifier-less B_DELETE - // and draw it properly too. B_NO_MODIFIER? - editMenu->AddItem(new BMenuItem(B_TRANSLATE("Move file to Trash"), - new BMessage(M_PLAYLIST_MOVE_TO_TRASH), 'T')); + editMenu->AddItem(new BMenuItem(B_TRANSLATE("Remove"), new BMessage(M_PLAYLIST_REMOVE), + B_DELETE, B_NO_COMMAND_KEY)); menuBar->AddItem(editMenu); diff --git a/src/apps/mediaplayer/playlist/PlaylistWindow.h b/src/apps/mediaplayer/playlist/PlaylistWindow.h index 4ca65a7c1f..05aa5ccaea 100644 --- a/src/apps/mediaplayer/playlist/PlaylistWindow.h +++ b/src/apps/mediaplayer/playlist/PlaylistWindow.h @@ -39,8 +39,7 @@ enum { // edit M_PLAYLIST_RANDOMIZE = 'rand', - M_PLAYLIST_REMOVE = 'rmov', - M_PLAYLIST_MOVE_TO_TRASH = 'trsh' + M_PLAYLIST_REMOVE = 'rmov' };