From e28afdf1ea3cb78c0fa888e50ecf1c494ff636cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Sat, 26 Mar 2011 23:21:13 +0000 Subject: [PATCH] Changes to the MediaPlayer's playlist window's menu options Remove, Remove all, Move to Trash. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41122 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/mediaplayer/MainWin.cpp | 2 +- .../mediaplayer/playlist/PlaylistWindow.cpp | 30 ++++--------------- .../mediaplayer/playlist/PlaylistWindow.h | 11 ++++++- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/apps/mediaplayer/MainWin.cpp b/src/apps/mediaplayer/MainWin.cpp index cffbac5e99..d938ceec33 100644 --- a/src/apps/mediaplayer/MainWin.cpp +++ b/src/apps/mediaplayer/MainWin.cpp @@ -2176,7 +2176,7 @@ MainWin::_KeyDown(BMessage* msg) case 't': // t for Trash if ((modifiers() & B_COMMAND_KEY) != 0) { BAutolock _(fPlaylist); - BMessage removeMessage(M_PLAYLIST_REMOVE_AND_PUT_INTO_TRASH); + BMessage removeMessage(M_PLAYLIST_MOVE_TO_TRASH); removeMessage.AddInt32("playlist index", fPlaylist->CurrentItemIndex()); fPlaylistWindow->PostMessage(&removeMessage); diff --git a/src/apps/mediaplayer/playlist/PlaylistWindow.cpp b/src/apps/mediaplayer/playlist/PlaylistWindow.cpp index 9bc6537604..1329913839 100644 --- a/src/apps/mediaplayer/playlist/PlaylistWindow.cpp +++ b/src/apps/mediaplayer/playlist/PlaylistWindow.cpp @@ -52,21 +52,6 @@ // * replacing the contents by other stuff. -enum { - // file - M_PLAYLIST_OPEN = 'open', - M_PLAYLIST_SAVE = 'save', - M_PLAYLIST_SAVE_AS = 'svas', - M_PLAYLIST_SAVE_RESULT = 'psrs', - - // edit - M_PLAYLIST_EMPTY = 'emty', - M_PLAYLIST_RANDOMIZE = 'rand', - - M_PLAYLIST_REMOVE = 'rmov' -}; - - static void display_save_alert(const char* message) { @@ -223,16 +208,13 @@ PlaylistWindow::MessageReceived(BMessage* message) _SavePlaylist(message); break; - case M_PLAYLIST_EMPTY: - fListView->RemoveAll(); - break; case M_PLAYLIST_RANDOMIZE: fListView->Randomize(); break; case M_PLAYLIST_REMOVE: fListView->RemoveSelected(); break; - case M_PLAYLIST_REMOVE_AND_PUT_INTO_TRASH: + case M_PLAYLIST_MOVE_TO_TRASH: { int32 index; if (message->FindInt32("playlist index", &index) == B_OK) @@ -280,12 +262,12 @@ PlaylistWindow::_CreateMenu(BRect& frame) editMenu->AddItem(new BMenuItem(B_TRANSLATE("Randomize"), new BMessage(M_PLAYLIST_RANDOMIZE), 'R')); editMenu->AddSeparatorItem(); - editMenu->AddItem(new BMenuItem(B_TRANSLATE("Remove (Del)"), + editMenu->AddItem(new BMenuItem(B_TRANSLATE("Remove"), new BMessage(M_PLAYLIST_REMOVE)/*, B_DELETE, 0*/)); - editMenu->AddItem(new BMenuItem(B_TRANSLATE("Remove and put into Trash"), - new BMessage(M_PLAYLIST_REMOVE_AND_PUT_INTO_TRASH), 'T')); - editMenu->AddItem(new BMenuItem(B_TRANSLATE("Remove all"), - new BMessage(M_PLAYLIST_EMPTY), 'N')); + // 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')); menuBar->AddItem(editMenu); diff --git a/src/apps/mediaplayer/playlist/PlaylistWindow.h b/src/apps/mediaplayer/playlist/PlaylistWindow.h index 41edb657ca..2372385d91 100644 --- a/src/apps/mediaplayer/playlist/PlaylistWindow.h +++ b/src/apps/mediaplayer/playlist/PlaylistWindow.h @@ -29,7 +29,16 @@ class BFilePanel; enum { - M_PLAYLIST_REMOVE_AND_PUT_INTO_TRASH = 'rmtr' + // file + M_PLAYLIST_OPEN = 'open', + M_PLAYLIST_SAVE = 'save', + M_PLAYLIST_SAVE_AS = 'svas', + M_PLAYLIST_SAVE_RESULT = 'psrs', + + // edit + M_PLAYLIST_RANDOMIZE = 'rand', + M_PLAYLIST_REMOVE = 'rmov', + M_PLAYLIST_MOVE_TO_TRASH = 'trsh' };