Implemented Playlist->Edit->Make Empty (undoable).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26144 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-06-26 22:42:20 +00:00
parent 3b057d9fad
commit e9246c710e
3 changed files with 17 additions and 0 deletions

View File

@ -717,6 +717,21 @@ DragSortableListView::RemoveSelected()
RemoveItemList(indices);
}
// RemoveAll
void
DragSortableListView::RemoveAll()
{
BList indices;
int32 count = CountItems();
for (int32 i = 0; i < count; i++) {
if (!indices.AddItem((void*)i))
break;
}
if (indices.CountItems() > 0)
RemoveItemList(indices);
}
// CountSelectedItems
int32
DragSortableListView::CountSelectedItems() const

View File

@ -93,6 +93,7 @@ class DragSortableListView : public BListView {
virtual void CopyItems(BList& indices, int32 toIndex);
virtual void RemoveItemList(BList& indices);
void RemoveSelected(); // uses RemoveItemList()
void RemoveAll(); // uses RemoveItemList()
int32 CountSelectedItems() const;
void SelectAll();
virtual bool DeleteItem(int32 index);

View File

@ -145,6 +145,7 @@ PlaylistWindow::MessageReceived(BMessage* message)
fOpenPanel->Show();
break;
case M_PLAYLIST_EMPTY:
fListView->RemoveAll();
break;
default:
BWindow::MessageReceived(message);