'go to dir containing found item' function added

master
unK 18 years ago
parent a37882f62a
commit 2f4463080a
  1. 2
      doc/ncmpcpp_keys
  2. 14
      src/ncmpcpp.cpp
  3. 4
      src/settings.cpp
  4. 1
      src/settings.h

@ -115,6 +115,8 @@
#
#key_toggle_auto_center = 'U'
#
#key_go_to_containing_directory = 'G'
#
#key_go_to_parent_dir = 263 127
#
#key_quit = 'q' 'Q'

@ -295,7 +295,8 @@ int main(int argc, char *argv[])
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.Space) + "Add item to playlist\n\n\n");
sHelp->Add(DisplayKeys(Key.Space) + "Add item to playlist\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(DisplayKeys(&Key.VolumeDown[0], 1) + "Previous column\n");
@ -1836,6 +1837,17 @@ int main(int argc, char *argv[])
ShowMessage("Cannot read file!");
}
}
else if (Keypressed(input, Key.GoToContainingDir))
{
if (wCurrent == mSearcher && !vSearched.empty() && mSearcher->GetChoice() > search_engine_static_option)
{
GetDirectory(vSearched[mSearcher->GetChoice()-search_engine_static_option-1]->GetDirectory());
for (int i = 1; i < mBrowser->MaxChoice(); i++)
if (mSearcher->GetCurrentOption() == mBrowser->GetOption(i))
mBrowser->Highlight(i);
goto SWITCHER_BROWSER_REDIRECT;
}
}
else if (Keypressed(input, Key.GoToPosition))
{
if (now_playing < 0)

@ -77,6 +77,7 @@ void DefaultKeys(ncmpcpp_keys &keys)
keys.Add[0] = 'a';
keys.SavePlaylist[0] = 'S';
keys.GoToNowPlaying[0] = 'o';
keys.GoToContainingDir[0] = 'G';
keys.ToggleAutoCenter[0] = 'U';
keys.GoToParentDir[0] = 263;
keys.Quit[0] = 'q';
@ -131,6 +132,7 @@ void DefaultKeys(ncmpcpp_keys &keys)
keys.Add[1] = null_key;
keys.SavePlaylist[1] = null_key;
keys.GoToNowPlaying[1] = null_key;
keys.GoToContainingDir[1] = null_key;
keys.ToggleAutoCenter[1] = null_key;
keys.GoToParentDir[1] = 127;
keys.Quit[1] = 'Q';
@ -380,6 +382,8 @@ void ReadKeys(ncmpcpp_keys &keys)
GetKeys(*it, keys.GoToNowPlaying);
else if (it->find("key_toggle_auto_center ") != string::npos)
GetKeys(*it, keys.ToggleAutoCenter);
else if (it->find("key_go_to_containing_directory ") != string::npos)
GetKeys(*it, keys.GoToContainingDir);
else if (it->find("key_go_to_parent_dir ") != string::npos)
GetKeys(*it, keys.GoToParentDir);
else if (it->find("key_quit ") != string::npos)

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

Loading…
Cancel
Save