Add command to clear filter.
This commit is contained in:
committed by
Andrzej Rybczak
parent
7b90daa690
commit
10f5ec1e78
@@ -210,6 +210,7 @@ void Help::GetKeybindings()
|
||||
*w << DisplayKeys(Key.UpdateDB) << "Start a music database update\n";
|
||||
*w << "\n";
|
||||
*w << DisplayKeys(Key.ApplyFilter) << "Apply filter\n";
|
||||
*w << DisplayKeys(Key.DisableFilter) << "Disable filter\n";
|
||||
*w << DisplayKeys(Key.FindForward) << "Forward find\n";
|
||||
*w << DisplayKeys(Key.FindBackward) << "Backward find\n";
|
||||
*w << DisplayKeys(Key.PrevFoundPosition) << "Go to previous found position\n";
|
||||
|
||||
@@ -2028,6 +2028,24 @@ int main(int argc, char **argv)
|
||||
RedrawHeader = 1;
|
||||
}
|
||||
}
|
||||
else if (Keypressed(input, Key.DisableFilter))
|
||||
{
|
||||
List *mList = myScreen->GetList();
|
||||
|
||||
if (!mList)
|
||||
continue;
|
||||
|
||||
mList->ApplyFilter("");
|
||||
|
||||
ShowMessage("Filtering disabled");
|
||||
|
||||
if (myScreen == myPlaylist)
|
||||
{
|
||||
myPlaylist->EnableHighlighting();
|
||||
Playlist::ReloadTotalLength = 1;
|
||||
RedrawHeader = 1;
|
||||
}
|
||||
}
|
||||
else if (Keypressed(input, Key.FindForward) || Keypressed(input, Key.FindBackward))
|
||||
{
|
||||
List *mList = myScreen->GetList();
|
||||
@@ -2356,6 +2374,7 @@ int main(int argc, char **argv)
|
||||
|| Keypressed(input, Key.Home)
|
||||
|| Keypressed(input, Key.End)
|
||||
|| Keypressed(input, Key.ApplyFilter)
|
||||
|| Keypressed(input, Key.DisableFilter)
|
||||
|| Keypressed(input, Key.FindForward)
|
||||
|| Keypressed(input, Key.FindBackward)
|
||||
|| Keypressed(input, Key.NextFoundPosition)
|
||||
|
||||
@@ -230,6 +230,7 @@ void NcmpcppKeys::SetDefaults()
|
||||
UpdateDB[0] = 'u';
|
||||
SortPlaylist[0] = 22;
|
||||
ApplyFilter[0] = 6;
|
||||
DisableFilter[0] = 7;
|
||||
FindForward[0] = '/';
|
||||
FindBackward[0] = '?';
|
||||
NextFoundPosition[0] = '.';
|
||||
@@ -320,6 +321,7 @@ void NcmpcppKeys::SetDefaults()
|
||||
UpdateDB[1] = NullKey;
|
||||
SortPlaylist[1] = NullKey;
|
||||
ApplyFilter[1] = NullKey;
|
||||
DisableFilter[1] = NullKey;
|
||||
FindForward[1] = NullKey;
|
||||
FindBackward[1] = NullKey;
|
||||
NextFoundPosition[1] = NullKey;
|
||||
@@ -595,6 +597,8 @@ void NcmpcppKeys::Read()
|
||||
GetKeys(key, SortPlaylist);
|
||||
else if (name == "key_apply_filter")
|
||||
GetKeys(key, ApplyFilter);
|
||||
else if (name == "key_clear_filter")
|
||||
GetKeys(key, DisableFilter);
|
||||
else if (name == "key_find_forward")
|
||||
GetKeys(key, FindForward);
|
||||
else if (name == "key_find_backward")
|
||||
|
||||
@@ -101,6 +101,7 @@ struct NcmpcppKeys
|
||||
int UpdateDB[2];
|
||||
int SortPlaylist[2];
|
||||
int ApplyFilter[2];
|
||||
int DisableFilter[2];
|
||||
int FindForward[2];
|
||||
int FindBackward[2];
|
||||
int NextFoundPosition[2];
|
||||
|
||||
Reference in New Issue
Block a user