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:
parent
3b057d9fad
commit
e9246c710e
@ -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
|
||||
|
@ -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);
|
||||
|
@ -145,6 +145,7 @@ PlaylistWindow::MessageReceived(BMessage* message)
|
||||
fOpenPanel->Show();
|
||||
break;
|
||||
case M_PLAYLIST_EMPTY:
|
||||
fListView->RemoveAll();
|
||||
break;
|
||||
default:
|
||||
BWindow::MessageReceived(message);
|
||||
|
Loading…
Reference in New Issue
Block a user