make blocking search constraints change after successful searching optional
it's still enabled by default though.
This commit is contained in:
@@ -1206,7 +1206,7 @@ int main(int argc, char *argv[])
|
||||
Config.stop_after_current_song = !Config.stop_after_current_song;
|
||||
ShowMessage("Stop playing after current song: %s", Config.stop_after_current_song ? "on" : "off");
|
||||
}
|
||||
else if (myScreen == mySearcher)
|
||||
else if (myScreen == mySearcher && !mySearcher->Main()->isStatic(0))
|
||||
{
|
||||
mySearcher->Main()->Highlight(SearchEngine::SearchButton);
|
||||
mySearcher->Main()->Highlighting(0);
|
||||
|
||||
@@ -186,6 +186,8 @@ void SearchEngine::EnterPressed()
|
||||
case 15:
|
||||
{
|
||||
ShowMessage("Searching...");
|
||||
if (w->Size() > StaticOptions)
|
||||
Prepare();
|
||||
Search();
|
||||
if (!w->Back().first)
|
||||
{
|
||||
@@ -200,8 +202,9 @@ void SearchEngine::EnterPressed()
|
||||
w->InsertSeparator(ResetButton+3);
|
||||
UpdateFoundList();
|
||||
ShowMessage("Searching finished!");
|
||||
for (size_t i = 0; i < StaticOptions-4; i++)
|
||||
w->Static(i, 1);
|
||||
if (Config.block_search_constraints_change)
|
||||
for (size_t i = 0; i < StaticOptions-4; i++)
|
||||
w->Static(i, 1);
|
||||
w->Scroll(wDown);
|
||||
w->Scroll(wDown);
|
||||
}
|
||||
@@ -212,6 +215,8 @@ void SearchEngine::EnterPressed()
|
||||
case 16:
|
||||
{
|
||||
CLEAR_FIND_HISTORY;
|
||||
itsPattern.Clear();
|
||||
w->Reset();
|
||||
Prepare();
|
||||
ShowMessage("Search state reset");
|
||||
break;
|
||||
@@ -334,10 +339,8 @@ void SearchEngine::Prepare()
|
||||
catch (List::InvalidItem) { }
|
||||
}
|
||||
|
||||
itsPattern.Clear();
|
||||
w->SetTitle("");
|
||||
w->Clear();
|
||||
w->Reset();
|
||||
w->Clear(0);
|
||||
w->ResizeBuffer(17);
|
||||
|
||||
w->IntoSeparator(10);
|
||||
|
||||
@@ -267,6 +267,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
|
||||
conf.clock_display_seconds = false;
|
||||
conf.ignore_leading_the = false;
|
||||
conf.stop_after_current_song = false;
|
||||
conf.block_search_constraints_change = true;
|
||||
conf.set_window_title = true;
|
||||
conf.mpd_port = 6600;
|
||||
conf.mpd_connection_timeout = 15;
|
||||
@@ -638,6 +639,10 @@ void ReadConfiguration(ncmpcpp_config &conf)
|
||||
{
|
||||
conf.ignore_leading_the = v == "yes";
|
||||
}
|
||||
else if (cl.find("block_search_constraints_change_if_items_found") != string::npos)
|
||||
{
|
||||
conf.block_search_constraints_change = v == "yes";
|
||||
}
|
||||
else if (cl.find("enable_window_title") != string::npos)
|
||||
{
|
||||
conf.set_window_title = v == "yes";
|
||||
|
||||
@@ -159,6 +159,7 @@ struct ncmpcpp_config
|
||||
bool clock_display_seconds;
|
||||
bool ignore_leading_the;
|
||||
bool stop_after_current_song;
|
||||
bool block_search_constraints_change;
|
||||
|
||||
int mpd_port;
|
||||
int mpd_connection_timeout;
|
||||
|
||||
Reference in New Issue
Block a user