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);
|
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
|
// CountSelectedItems
|
||||||
int32
|
int32
|
||||||
DragSortableListView::CountSelectedItems() const
|
DragSortableListView::CountSelectedItems() const
|
||||||
|
@ -93,6 +93,7 @@ class DragSortableListView : public BListView {
|
|||||||
virtual void CopyItems(BList& indices, int32 toIndex);
|
virtual void CopyItems(BList& indices, int32 toIndex);
|
||||||
virtual void RemoveItemList(BList& indices);
|
virtual void RemoveItemList(BList& indices);
|
||||||
void RemoveSelected(); // uses RemoveItemList()
|
void RemoveSelected(); // uses RemoveItemList()
|
||||||
|
void RemoveAll(); // uses RemoveItemList()
|
||||||
int32 CountSelectedItems() const;
|
int32 CountSelectedItems() const;
|
||||||
void SelectAll();
|
void SelectAll();
|
||||||
virtual bool DeleteItem(int32 index);
|
virtual bool DeleteItem(int32 index);
|
||||||
|
@ -145,6 +145,7 @@ PlaylistWindow::MessageReceived(BMessage* message)
|
|||||||
fOpenPanel->Show();
|
fOpenPanel->Show();
|
||||||
break;
|
break;
|
||||||
case M_PLAYLIST_EMPTY:
|
case M_PLAYLIST_EMPTY:
|
||||||
|
fListView->RemoveAll();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
|
Loading…
Reference in New Issue
Block a user