make 'go to containing dir' function work on all screens
This commit is contained in:
@@ -271,6 +271,7 @@ int main(int argc, char *argv[])
|
|||||||
sHelp->Add(DisplayKeys(Key.PrevFoundPosition) + "Go to previous found position\n");
|
sHelp->Add(DisplayKeys(Key.PrevFoundPosition) + "Go to previous found position\n");
|
||||||
sHelp->Add(DisplayKeys(Key.NextFoundPosition) + "Go to next found position\n");
|
sHelp->Add(DisplayKeys(Key.NextFoundPosition) + "Go to next found position\n");
|
||||||
sHelp->Add(DisplayKeys(Key.ToggleFindMode) + "Toggle find mode (normal/wrapped)\n");
|
sHelp->Add(DisplayKeys(Key.ToggleFindMode) + "Toggle find mode (normal/wrapped)\n");
|
||||||
|
sHelp->Add(DisplayKeys(Key.GoToContainingDir) + "Go to directory containing current item\n");
|
||||||
sHelp->Add(DisplayKeys(Key.EditTags) + tag_screen_keydesc);
|
sHelp->Add(DisplayKeys(Key.EditTags) + tag_screen_keydesc);
|
||||||
sHelp->Add(DisplayKeys(Key.GoToPosition) + "Go to chosen position in current song\n");
|
sHelp->Add(DisplayKeys(Key.GoToPosition) + "Go to chosen position in current song\n");
|
||||||
sHelp->Add(DisplayKeys(Key.Lyrics) + "Show/hide song's lyrics\n\n");
|
sHelp->Add(DisplayKeys(Key.Lyrics) + "Show/hide song's lyrics\n\n");
|
||||||
@@ -298,8 +299,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.StartSearching) + "Start searching immediately\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");
|
||||||
sHelp->Add(DisplayKeys(&Key.VolumeDown[0], 1) + "Previous column\n");
|
sHelp->Add(DisplayKeys(&Key.VolumeDown[0], 1) + "Previous column\n");
|
||||||
@@ -1803,12 +1803,39 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if (Keypressed(input, Key.GoToContainingDir))
|
else if (Keypressed(input, Key.GoToContainingDir))
|
||||||
{
|
{
|
||||||
if (wCurrent == mSearcher && !vSearched.empty() && mSearcher->GetChoice() > search_engine_static_option)
|
if ((wCurrent == mPlaylist && !mPlaylist->Empty())
|
||||||
|
|| (wCurrent == mSearcher && !vSearched.empty() && mSearcher->GetChoice() > search_engine_static_option)
|
||||||
|
|| (wCurrent == mLibSongs && !mLibSongs->Empty())
|
||||||
|
|| (wCurrent == mPlaylistEditor && !mPlaylistEditor->Empty()))
|
||||||
{
|
{
|
||||||
GetDirectory(vSearched[mSearcher->GetRealChoice()-2]->GetDirectory());
|
int id = wCurrent->GetChoice()-1;
|
||||||
for (int i = 1; i < mBrowser->Size(); i++)
|
Song *s;
|
||||||
|
switch (current_screen)
|
||||||
{
|
{
|
||||||
if (mSearcher->GetCurrentOption() == mBrowser->GetOption(i))
|
case csPlaylist:
|
||||||
|
s = &mPlaylist->at(id);
|
||||||
|
break;
|
||||||
|
case csSearcher:
|
||||||
|
s = vSearched[mSearcher->GetRealChoice()-2];
|
||||||
|
break;
|
||||||
|
case csLibrary:
|
||||||
|
s = &mLibSongs->at(id);
|
||||||
|
break;
|
||||||
|
case csPlaylistEditor:
|
||||||
|
s = &mPlaylistEditor->at(id);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s->GetDirectory() == EMPTY_TAG) // for streams
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string option = OmitBBCodes(DisplaySong(*s));
|
||||||
|
GetDirectory(s->GetDirectory());
|
||||||
|
for (int i = 1; i <= mBrowser->Size(); i++)
|
||||||
|
{
|
||||||
|
if (option == mBrowser->GetOption(i))
|
||||||
{
|
{
|
||||||
mBrowser->Highlight(i);
|
mBrowser->Highlight(i);
|
||||||
break;
|
break;
|
||||||
|
|||||||
10
src/song.cpp
10
src/song.cpp
@@ -57,7 +57,12 @@ Song::Song(mpd_Song *s) : itsHash(0),
|
|||||||
s->comment ? itsComment = s->comment : itsComment = "";
|
s->comment ? itsComment = s->comment : itsComment = "";
|
||||||
|
|
||||||
int i = itsFile.find_last_of("/");
|
int i = itsFile.find_last_of("/");
|
||||||
if (i != string::npos)
|
|
||||||
|
if (itsFile.substr(0, 7) == "http://")
|
||||||
|
{
|
||||||
|
itsShortName = itsFile;
|
||||||
|
}
|
||||||
|
else if (i != string::npos)
|
||||||
{
|
{
|
||||||
itsDirectory = itsFile.substr(0, i);
|
itsDirectory = itsFile.substr(0, i);
|
||||||
itsShortName = itsFile.substr(i+1);
|
itsShortName = itsFile.substr(i+1);
|
||||||
@@ -81,6 +86,9 @@ string Song::GetLength() const
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
||||||
|
if (!GetTotalLength())
|
||||||
|
return "unknown";
|
||||||
|
|
||||||
ss << itsMinutesLength << ":";
|
ss << itsMinutesLength << ":";
|
||||||
if (!itsSecondsLength)
|
if (!itsSecondsLength)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user