'start searching immediately' function added

This commit is contained in:
unK
2008-09-02 06:00:00 +02:00
parent 0f0bf11652
commit 451f2e112e
4 changed files with 18 additions and 0 deletions

View File

@@ -117,6 +117,8 @@
# #
#key_go_to_containing_directory = 'G' #key_go_to_containing_directory = 'G'
# #
#key_start_searching = 'y'
#
#key_go_to_parent_dir = 263 127 #key_go_to_parent_dir = 263 127
# #
#key_quit = 'q' 'Q' #key_quit = 'q' 'Q'

View File

@@ -296,6 +296,7 @@ int main(int argc, char *argv[])
sHelp->Add(" [b]Keys - Search engine\n -----------------------------------------[/b]\n"); sHelp->Add(" [b]Keys - Search engine\n -----------------------------------------[/b]\n");
sHelp->Add(DisplayKeys(Key.Enter) + "Add item to playlist and play/change option\n"); sHelp->Add(DisplayKeys(Key.Enter) + "Add item to playlist and play/change option\n");
sHelp->Add(DisplayKeys(Key.Space) + "Add item to playlist\n"); sHelp->Add(DisplayKeys(Key.Space) + "Add item to playlist\n");
sHelp->Add(DisplayKeys(Key.StartSearching) + "Start searching immediately\n");
sHelp->Add(DisplayKeys(Key.GoToContainingDir) + "Go to directory containing found item\n\n\n"); sHelp->Add(DisplayKeys(Key.GoToContainingDir) + "Go to directory containing found item\n\n\n");
sHelp->Add(" [b]Keys - Media library\n -----------------------------------------[/b]\n"); sHelp->Add(" [b]Keys - Media library\n -----------------------------------------[/b]\n");
@@ -1012,6 +1013,8 @@ int main(int argc, char *argv[])
} }
case csSearcher: case csSearcher:
{ {
ENTER_SEARCH_ENGINE_SCREEN:
int id = mSearcher->GetChoice(); int id = mSearcher->GetChoice();
int option = mSearcher->GetChoice(); int option = mSearcher->GetChoice();
LOCK_STATUSBAR; LOCK_STATUSBAR;
@@ -1853,6 +1856,14 @@ int main(int argc, char *argv[])
goto SWITCHER_BROWSER_REDIRECT; goto SWITCHER_BROWSER_REDIRECT;
} }
} }
else if (Keypressed(input, Key.StartSearching))
{
if (wCurrent == mSearcher)
{
mSearcher->Highlight(13);
goto ENTER_SEARCH_ENGINE_SCREEN;
}
}
else if (Keypressed(input, Key.GoToPosition)) else if (Keypressed(input, Key.GoToPosition))
{ {
if (now_playing < 0) if (now_playing < 0)

View File

@@ -78,6 +78,7 @@ void DefaultKeys(ncmpcpp_keys &keys)
keys.SavePlaylist[0] = 'S'; keys.SavePlaylist[0] = 'S';
keys.GoToNowPlaying[0] = 'o'; keys.GoToNowPlaying[0] = 'o';
keys.GoToContainingDir[0] = 'G'; keys.GoToContainingDir[0] = 'G';
keys.StartSearching[0] = 'y';
keys.ToggleAutoCenter[0] = 'U'; keys.ToggleAutoCenter[0] = 'U';
keys.GoToParentDir[0] = 263; keys.GoToParentDir[0] = 263;
keys.Quit[0] = 'q'; keys.Quit[0] = 'q';
@@ -133,6 +134,7 @@ void DefaultKeys(ncmpcpp_keys &keys)
keys.SavePlaylist[1] = null_key; keys.SavePlaylist[1] = null_key;
keys.GoToNowPlaying[1] = null_key; keys.GoToNowPlaying[1] = null_key;
keys.GoToContainingDir[1] = null_key; keys.GoToContainingDir[1] = null_key;
keys.StartSearching[1] = null_key;
keys.ToggleAutoCenter[1] = null_key; keys.ToggleAutoCenter[1] = null_key;
keys.GoToParentDir[1] = 127; keys.GoToParentDir[1] = 127;
keys.Quit[1] = 'Q'; keys.Quit[1] = 'Q';
@@ -384,6 +386,8 @@ void ReadKeys(ncmpcpp_keys &keys)
GetKeys(*it, keys.ToggleAutoCenter); GetKeys(*it, keys.ToggleAutoCenter);
else if (it->find("key_go_to_containing_directory ") != string::npos) else if (it->find("key_go_to_containing_directory ") != string::npos)
GetKeys(*it, keys.GoToContainingDir); GetKeys(*it, keys.GoToContainingDir);
else if (it->find("key_start_searching ") != string::npos)
GetKeys(*it, keys.StartSearching);
else if (it->find("key_go_to_parent_dir ") != string::npos) else if (it->find("key_go_to_parent_dir ") != string::npos)
GetKeys(*it, keys.GoToParentDir); GetKeys(*it, keys.GoToParentDir);
else if (it->find("key_quit ") != string::npos) else if (it->find("key_quit ") != string::npos)

View File

@@ -80,6 +80,7 @@ struct ncmpcpp_keys
int SavePlaylist[2]; int SavePlaylist[2];
int GoToNowPlaying[2]; int GoToNowPlaying[2];
int GoToContainingDir[2]; int GoToContainingDir[2];
int StartSearching[2];
int ToggleAutoCenter[2]; int ToggleAutoCenter[2];
int GoToParentDir[2]; int GoToParentDir[2];
int Quit[2]; int Quit[2];