diff --git a/src/helpers.cpp b/src/helpers.cpp index a4ddd73f..80de044f 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -132,7 +132,7 @@ void UpdateSongList(Menu *menu) menu->Refresh(); } -void UpdateFoundList(const SongList &v, Menu *menu) +void UpdateFoundList(const SongList &v) { int i = search_engine_static_option; bool bold = 0; @@ -146,10 +146,9 @@ void UpdateFoundList(const SongList &v, Menu *menu) break; } } - menu->BoldOption(i, bold); + mSearcher->BoldOption(i, bold); bold = 0; } - menu->Refresh(); } string DisplayKeys(int *key, int size) diff --git a/src/helpers.h b/src/helpers.h index a8113974..eca9981e 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -40,7 +40,7 @@ class CaseInsensitiveSorting void UpdateItemList(Menu *); void UpdateSongList(Menu *); -void UpdateFoundList(const SongList &, Menu *); +void UpdateFoundList(const SongList &); string DisplayKeys(int *, int = 2); bool Keypressed(int, const int *); diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 437e7479..844b1bc9 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -146,6 +146,7 @@ bool block_progressbar_update = 0; bool block_statusbar_update = 0; bool allow_statusbar_unblock = 1; bool block_playlist_update = 0; +bool block_found_item_list_update = 0; bool search_case_sensitive = 1; bool search_mode_match = 1; @@ -411,6 +412,7 @@ int main(int argc, char *argv[]) TraceMpdStatus(); + block_found_item_list_update = 0; block_playlist_update = 0; messages_allowed = 1; @@ -1188,12 +1190,14 @@ int main(int argc, char *argv[]) } default: { + block_found_item_list_update = 1; Song &s = *vSearched[mSearcher->GetRealChoice()-1]; int id = Mpd->AddSong(s); if (id >= 0) { Mpd->PlayID(id); ShowMessage("Added to playlist: " + DisplaySong(s, &Config.song_status_format)); + mSearcher->BoldOption(mSearcher->GetChoice(), 1); } break; } @@ -1502,10 +1506,13 @@ int main(int argc, char *argv[]) int id = mSearcher->GetChoice()-search_engine_static_option; if (id < 0) continue; - + block_found_item_list_update = 1; Song &s = *vSearched[id]; if (Mpd->AddSong(s) != -1) + { ShowMessage("Added to playlist: " + DisplaySong(s, &Config.song_status_format)); + mSearcher->BoldOption(mSearcher->GetChoice(), 1); + } mSearcher->Go(wDown); } else if (current_screen == csLibrary) @@ -2740,7 +2747,7 @@ int main(int argc, char *argv[]) if (!vSearched.empty()) { wCurrent->WriteXY(0, 0, "Updating list..."); - UpdateFoundList(vSearched, mSearcher); + UpdateFoundList(vSearched); } } } diff --git a/src/status_checker.cpp b/src/status_checker.cpp index 876f4e88..ed93e0c1 100644 --- a/src/status_checker.cpp +++ b/src/status_checker.cpp @@ -69,6 +69,7 @@ extern bool allow_statusbar_unblock; extern bool block_progressbar_update; extern bool block_statusbar_update; extern bool block_playlist_update; +extern bool block_found_item_list_update; extern bool redraw_me; @@ -212,9 +213,9 @@ void NcmpcppStatusChanged(MPDConnection *Mpd, MPDStatusChanges changed, void *da { UpdateItemList(mBrowser); } - else if (current_screen == csSearcher) + else if (current_screen == csSearcher && !block_found_item_list_update) { - UpdateFoundList(vSearched, mSearcher); + UpdateFoundList(vSearched); } else if (current_screen == csLibrary) {