notify user if some files failed to be added

This commit is contained in:
Andrzej Rybczak
2014-01-18 16:44:39 +01:00
parent 7094852c20
commit 34923a035c
6 changed files with 59 additions and 31 deletions

View File

@@ -127,8 +127,10 @@ void Browser::enterPressed()
{
MPD::SongList list;
Mpd.GetPlaylistContentNoInfo(item.name, vectorMoveInserter(list));
addSongsToPlaylist(list.begin(), list.end(), true, -1);
Statusbar::msg("Playlist \"%s\" loaded", item.name.c_str());
bool success = addSongsToPlaylist(list.begin(), list.end(), true, -1);
Statusbar::msg("Playlist \"%s\" loaded%s",
item.name.c_str(), withErrors(success)
);
}
}
}
@@ -156,6 +158,7 @@ void Browser::spacePressed()
{
case itDirectory:
{
bool success;
# ifndef WIN32
if (isLocal())
{
@@ -166,12 +169,17 @@ void Browser::spacePressed()
list.reserve(items.size());
for (MPD::ItemList::const_iterator it = items.begin(); it != items.end(); ++it)
list.push_back(*it->song);
addSongsToPlaylist(list.begin(), list.end(), false, -1);
success = addSongsToPlaylist(list.begin(), list.end(), false, -1);
}
else
# endif // !WIN32
{
Mpd.Add(item.name);
Statusbar::msg("Directory \"%s\" added", item.name.c_str());
success = true;
}
Statusbar::msg("Directory \"%s\" added%s",
item.name.c_str(), withErrors(success)
);
break;
}
case itSong: