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
This commit is contained in:
Jonas Sundström
2011-03-26 23:21:13 +00:00
parent 5b82a6b615
commit e28afdf1ea
3 changed files with 17 additions and 26 deletions
+1 -1
View File
@@ -2176,7 +2176,7 @@ MainWin::_KeyDown(BMessage* msg)
case 't': // t for Trash case 't': // t for Trash
if ((modifiers() & B_COMMAND_KEY) != 0) { if ((modifiers() & B_COMMAND_KEY) != 0) {
BAutolock _(fPlaylist); BAutolock _(fPlaylist);
BMessage removeMessage(M_PLAYLIST_REMOVE_AND_PUT_INTO_TRASH); BMessage removeMessage(M_PLAYLIST_MOVE_TO_TRASH);
removeMessage.AddInt32("playlist index", removeMessage.AddInt32("playlist index",
fPlaylist->CurrentItemIndex()); fPlaylist->CurrentItemIndex());
fPlaylistWindow->PostMessage(&removeMessage); fPlaylistWindow->PostMessage(&removeMessage);
@@ -52,21 +52,6 @@
// * replacing the contents by other stuff. // * 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 static void
display_save_alert(const char* message) display_save_alert(const char* message)
{ {
@@ -223,16 +208,13 @@ PlaylistWindow::MessageReceived(BMessage* message)
_SavePlaylist(message); _SavePlaylist(message);
break; break;
case M_PLAYLIST_EMPTY:
fListView->RemoveAll();
break;
case M_PLAYLIST_RANDOMIZE: case M_PLAYLIST_RANDOMIZE:
fListView->Randomize(); fListView->Randomize();
break; break;
case M_PLAYLIST_REMOVE: case M_PLAYLIST_REMOVE:
fListView->RemoveSelected(); fListView->RemoveSelected();
break; break;
case M_PLAYLIST_REMOVE_AND_PUT_INTO_TRASH: case M_PLAYLIST_MOVE_TO_TRASH:
{ {
int32 index; int32 index;
if (message->FindInt32("playlist index", &index) == B_OK) if (message->FindInt32("playlist index", &index) == B_OK)
@@ -280,12 +262,12 @@ PlaylistWindow::_CreateMenu(BRect& frame)
editMenu->AddItem(new BMenuItem(B_TRANSLATE("Randomize"), editMenu->AddItem(new BMenuItem(B_TRANSLATE("Randomize"),
new BMessage(M_PLAYLIST_RANDOMIZE), 'R')); new BMessage(M_PLAYLIST_RANDOMIZE), 'R'));
editMenu->AddSeparatorItem(); 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*/)); new BMessage(M_PLAYLIST_REMOVE)/*, B_DELETE, 0*/));
editMenu->AddItem(new BMenuItem(B_TRANSLATE("Remove and put into Trash"), // TODO: See if we can support the modifier-less B_DELETE
new BMessage(M_PLAYLIST_REMOVE_AND_PUT_INTO_TRASH), 'T')); // and draw it properly too. B_NO_MODIFIER?
editMenu->AddItem(new BMenuItem(B_TRANSLATE("Remove all"), editMenu->AddItem(new BMenuItem(B_TRANSLATE("Move file to Trash"),
new BMessage(M_PLAYLIST_EMPTY), 'N')); new BMessage(M_PLAYLIST_MOVE_TO_TRASH), 'T'));
menuBar->AddItem(editMenu); menuBar->AddItem(editMenu);
+10 -1
View File
@@ -29,7 +29,16 @@ class BFilePanel;
enum { 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'
}; };