add support for renaming in tiny tag editor

This commit is contained in:
unK
2008-09-25 20:46:53 +02:00
parent 0d0e5e2912
commit b8284ffe61
2 changed files with 15 additions and 1 deletions

View File

@@ -1027,6 +1027,18 @@ int main(int argc, char *argv[])
break;
}
case 8:
{
wFooter->WriteXY(0, Config.statusbar_visibility, "[.b]Filename:[/b] ", 1);
string filename = s.GetNewName().empty() ? s.GetName() : s.GetNewName();
int dot = filename.find_last_of(".");
string extension = filename.substr(dot);
filename = filename.substr(0, dot);
string new_name = wFooter->GetString(filename);
s.SetNewName(new_name + extension);
mTagEditor->UpdateOption(option, "[.b]Filename:[/b] " + (s.GetNewName().empty() ? s.GetName() : s.GetNewName()));
break;
}
case 9:
{
ShowMessage("Updating tags...");
if (WriteTags(s))
@@ -1038,7 +1050,7 @@ int main(int argc, char *argv[])
}
ShowMessage("Error writing tags!");
}
case 9:
case 10:
{
wCurrent->Clear();
wCurrent = wPrev;

View File

@@ -113,6 +113,8 @@ bool GetSongTags(Song &s)
mTagEditor->AddOption("[.b]Genre:[/b] " + s.GetGenre());
mTagEditor->AddOption("[.b]Comment:[/b] " + s.GetComment());
mTagEditor->AddSeparator();
mTagEditor->AddOption("[.b]Filename:[/b] " + s.GetName());
mTagEditor->AddSeparator();
mTagEditor->AddOption("Save");
mTagEditor->AddOption("Cancel");
return true;