From 07099d4dc0d1488d27ab5efa8ebc83668804b8ce Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 13 Nov 2009 19:38:47 +0100 Subject: [PATCH] clear menu option right before rewriting it, not earlier when it was cleared earlier, mpd status tracer could refresh window while ncmpcpp was waiting for new string and empty line was visible. --- src/search_engine.cpp | 3 ++- src/tiny_tag_editor.cpp | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/search_engine.cpp b/src/search_engine.cpp index 4e626d06..dcffd307 100644 --- a/src/search_engine.cpp +++ b/src/search_engine.cpp @@ -107,7 +107,7 @@ std::basic_string SearchEngine::Title() void SearchEngine::EnterPressed() { size_t option = w->Choice(); - if (option < SearchButton) + if (option > 10 && option < SearchButton) w->Current().first->Clear(); if (option < 15) LockStatusbar(); @@ -116,6 +116,7 @@ void SearchEngine::EnterPressed() { Statusbar() << fmtBold << ConstraintsNames[option] << fmtBoldEnd << ' '; itsConstraints[option] = wFooter->GetString(itsConstraints[option]); + w->Current().first->Clear(); *w->Current().first << fmtBold << std::setw(10) << std::left << ConstraintsNames[option] << fmtBoldEnd << ' '; ShowTag(*w->Current().first, itsConstraints[option]); } diff --git a/src/tiny_tag_editor.cpp b/src/tiny_tag_editor.cpp index ab2801eb..bdda4b34 100644 --- a/src/tiny_tag_editor.cpp +++ b/src/tiny_tag_editor.cpp @@ -98,15 +98,13 @@ void TinyTagEditor::EnterPressed() size_t option = w->Choice(); MPD::Song &s = itsEdited; - if (option < 20) // separator after filename - w->at(option).Clear(); - LockStatusbar(); if (option < 17) // separator after comment { size_t pos = option-8; Statusbar() << fmtBold << Info::Tags[pos].Name << ": " << fmtBoldEnd; s.SetTags(Info::Tags[pos].Set, wFooter->GetString(s.GetTags(Info::Tags[pos].Get))); + w->at(option).Clear(); w->at(option) << fmtBold << Info::Tags[pos].Name << ':' << fmtBoldEnd << ' '; ShowTag(w->at(option), s.GetTags(Info::Tags[pos].Get)); } @@ -119,6 +117,7 @@ void TinyTagEditor::EnterPressed() filename = filename.substr(0, dot); std::string new_name = wFooter->GetString(filename); s.SetNewName(new_name + extension); + w->at(option).Clear(); w->at(option) << fmtBold << "Filename:" << fmtBoldEnd << ' ' << (s.GetNewName().empty() ? s.GetName() : s.GetNewName()); } UnlockStatusbar();