provide generic interface for dealing with selected items

This commit is contained in:
Andrzej Rybczak
2009-02-16 18:20:45 +01:00
parent 2ec7748acd
commit 43a8e2284e
21 changed files with 172 additions and 106 deletions

View File

@@ -266,7 +266,7 @@ void PlaylistEditor::SpacePressed()
{
if (Config.space_selects && w == Content)
{
Select(Content);
Content->SelectCurrent();
w->Scroll(wDown);
return;
}
@@ -278,3 +278,13 @@ MPD::Song *PlaylistEditor::CurrentSong()
return w == Content && !Content->Empty() ? &Content->Current() : 0;
}
void PlaylistEditor::GetSelectedSongs(MPD::SongList &v)
{
std::vector<size_t> selected;
Content->GetSelected(selected);
for (std::vector<size_t>::const_iterator it = selected.begin(); it != selected.end(); it++)
{
v.push_back(new MPD::Song(Content->at(*it)));
}
}