make displayed messages more consistent
This commit is contained in:
@@ -208,7 +208,7 @@ void Action::Seek()
|
||||
|
||||
if (!Mpd.GetTotalTime())
|
||||
{
|
||||
ShowMessage("Unknown item length!");
|
||||
ShowMessage("Unknown item length");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ void Action::FindItem(const FindDirection fd)
|
||||
return;
|
||||
|
||||
if (success)
|
||||
ShowMessage("Searching finished!");
|
||||
ShowMessage("Searching finished");
|
||||
else
|
||||
ShowMessage("Unable to find \"%s\"", findme.c_str());
|
||||
|
||||
@@ -390,7 +390,7 @@ bool Action::isMPDMusicDirSet()
|
||||
{
|
||||
if (Config.mpd_music_dir.empty())
|
||||
{
|
||||
ShowMessage("mpd_music_dir is not set!");
|
||||
ShowMessage("Proper mpd_music_dir variable has to be set in configuration file");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -722,8 +722,7 @@ void Delete::Run()
|
||||
{
|
||||
for (size_t i = 0; i < myPlaylist->Items->Size(); ++i)
|
||||
myPlaylist->Items->Select(i, 0);
|
||||
myPlaylist->FixPositions(list.front());
|
||||
ShowMessage("Selected items deleted!");
|
||||
ShowMessage("Selected items deleted");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -744,14 +743,14 @@ void Delete::Run()
|
||||
{
|
||||
if (Mpd.DeletePlaylist(locale_to_utf_cpy(name)))
|
||||
{
|
||||
const char msg[] = "Playlist \"%s\" deleted!";
|
||||
const char msg[] = "Playlist \"%s\" deleted";
|
||||
ShowMessage(msg, Shorten(TO_WSTRING(name), COLS-static_strlen(msg)).c_str());
|
||||
if (myBrowser->Main() && !myBrowser->isLocal() && myBrowser->CurrentDir() == "/")
|
||||
myBrowser->GetDirectory("/");
|
||||
}
|
||||
}
|
||||
else
|
||||
ShowMessage("Aborted!");
|
||||
ShowMessage("Aborted");
|
||||
if (myPlaylistEditor->Main()) // check if initialized
|
||||
myPlaylistEditor->Playlists->Clear(); // make playlists list update itself
|
||||
}
|
||||
@@ -802,12 +801,12 @@ void Delete::Run()
|
||||
name = it.type == itSong ? it.song->GetName() : it.name;
|
||||
if (myBrowser->DeleteItem(it))
|
||||
{
|
||||
const char msg[] = "\"%s\" deleted!";
|
||||
const char msg[] = "\"%s\" deleted";
|
||||
ShowMessage(msg, Shorten(TO_WSTRING(name), COLS-static_strlen(msg)).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
const char msg[] = "Couldn't remove \"%s\": %s";
|
||||
const char msg[] = "Couldn't delete \"%s\": %s";
|
||||
ShowMessage(msg, Shorten(TO_WSTRING(name), COLS-static_strlen(msg)-25).c_str(), strerror(errno));
|
||||
success = 0;
|
||||
break;
|
||||
@@ -822,7 +821,7 @@ void Delete::Run()
|
||||
}
|
||||
}
|
||||
else
|
||||
ShowMessage("Aborted!");
|
||||
ShowMessage("Aborted");
|
||||
|
||||
}
|
||||
# endif // !WIN32
|
||||
@@ -841,7 +840,7 @@ void Delete::Run()
|
||||
myPlaylistEditor->Content->DeleteOption(*it);
|
||||
}
|
||||
Mpd.CommitCommandsList();
|
||||
ShowMessage("Selected items deleted from playlist \"%s\"!", myPlaylistEditor->Playlists->Current().c_str());
|
||||
ShowMessage("Selected items deleted from playlist \"%s\"", myPlaylistEditor->Playlists->Current().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -883,7 +882,7 @@ void SavePlaylist::Run()
|
||||
UnlockStatusbar();
|
||||
if (playlist_name.find("/") != std::string::npos)
|
||||
{
|
||||
ShowMessage("Playlist name cannot contain slashes!");
|
||||
ShowMessage("Playlist name must not contain slashes");
|
||||
return;
|
||||
}
|
||||
if (!playlist_name.empty())
|
||||
@@ -902,7 +901,7 @@ void SavePlaylist::Run()
|
||||
int result = Mpd.SavePlaylist(real_playlist_name);
|
||||
if (result == MPD_ERROR_SUCCESS)
|
||||
{
|
||||
ShowMessage("Playlist saved as: %s", playlist_name.c_str());
|
||||
ShowMessage("Playlist saved as \"%s\"", playlist_name.c_str());
|
||||
if (myPlaylistEditor->Main()) // check if initialized
|
||||
myPlaylistEditor->Playlists->Clear(); // make playlist's list update itself
|
||||
}
|
||||
@@ -913,10 +912,10 @@ void SavePlaylist::Run()
|
||||
{
|
||||
Mpd.DeletePlaylist(real_playlist_name);
|
||||
if (Mpd.SavePlaylist(real_playlist_name) == MPD_ERROR_SUCCESS)
|
||||
ShowMessage("Playlist overwritten!");
|
||||
ShowMessage("Playlist overwritten");
|
||||
}
|
||||
else
|
||||
ShowMessage("Aborted!");
|
||||
ShowMessage("Aborted");
|
||||
if (myPlaylistEditor->Main()) // check if initialized
|
||||
myPlaylistEditor->Playlists->Clear(); // make playlist's list update itself
|
||||
if (myScreen == myPlaylist)
|
||||
@@ -992,7 +991,7 @@ void MoveSelectedItemsTo::Run()
|
||||
return;
|
||||
if (!myPlaylist->Items->hasSelected())
|
||||
{
|
||||
ShowMessage("No selected items to move!");
|
||||
ShowMessage("No selected items to move");
|
||||
return;
|
||||
}
|
||||
// remove search results as we may move them to different positions, but
|
||||
@@ -1195,7 +1194,7 @@ void ToggleFetchingLyricsInBackground::Run()
|
||||
{
|
||||
# ifdef HAVE_CURL_CURL_H
|
||||
Config.fetch_lyrics_in_background = !Config.fetch_lyrics_in_background;
|
||||
ShowMessage("Fetching lyrics for currently playing song in background: %s", Config.fetch_lyrics_in_background ? "On" : "Off");
|
||||
ShowMessage("Fetching lyrics for playing songs in background: %s", Config.fetch_lyrics_in_background ? "On" : "Off");
|
||||
# endif // HAVE_CURL_CURL_H
|
||||
}
|
||||
|
||||
@@ -1399,7 +1398,7 @@ void EditLibraryTag::Run()
|
||||
std::string path = Config.mpd_music_dir + (*it)->GetFile();
|
||||
if (!TagEditor::WriteTags(**it))
|
||||
{
|
||||
const char msg[] = "Error while updating tags in \"%s\"!";
|
||||
const char msg[] = "Error while updating tags in \"%s\"";
|
||||
ShowMessage(msg, Shorten(TO_WSTRING((*it)->GetFile()), COLS-static_strlen(msg)).c_str());
|
||||
success = 0;
|
||||
break;
|
||||
@@ -1408,7 +1407,7 @@ void EditLibraryTag::Run()
|
||||
if (success)
|
||||
{
|
||||
Mpd.UpdateDirectory(locale_to_utf_cpy(FindSharedDir(list)));
|
||||
ShowMessage("Tags updated successfully!");
|
||||
ShowMessage("Tags updated successfully");
|
||||
}
|
||||
FreeSongList(list);
|
||||
}
|
||||
@@ -1448,7 +1447,7 @@ void EditLibraryAlbum::Run()
|
||||
TagLib::FileRef f(locale_to_utf_cpy(path).c_str());
|
||||
if (f.isNull())
|
||||
{
|
||||
const char msg[] = "Error while opening file \"%s\"!";
|
||||
const char msg[] = "Error while opening file \"%s\"";
|
||||
ShowMessage(msg, Shorten(TO_WSTRING((*myLibrary->Songs)[i].GetFile()), COLS-static_strlen(msg)).c_str());
|
||||
success = 0;
|
||||
break;
|
||||
@@ -1456,7 +1455,7 @@ void EditLibraryAlbum::Run()
|
||||
f.tag()->setAlbum(ToWString(new_album));
|
||||
if (!f.save())
|
||||
{
|
||||
const char msg[] = "Error while writing tags in \"%s\"!";
|
||||
const char msg[] = "Error while writing tags in \"%s\"";
|
||||
ShowMessage(msg, Shorten(TO_WSTRING((*myLibrary->Songs)[i].GetFile()), COLS-static_strlen(msg)).c_str());
|
||||
success = 0;
|
||||
break;
|
||||
@@ -1465,7 +1464,7 @@ void EditLibraryAlbum::Run()
|
||||
if (success)
|
||||
{
|
||||
Mpd.UpdateDirectory(locale_to_utf_cpy(FindSharedDir(myLibrary->Songs)));
|
||||
ShowMessage("Tags updated successfully!");
|
||||
ShowMessage("Tags updated successfully");
|
||||
}
|
||||
}
|
||||
# endif // HAVE_TAGLIB_H
|
||||
@@ -1658,14 +1657,14 @@ void ToggleScreenLock::Run()
|
||||
}
|
||||
if (part < 20 || part > 80)
|
||||
{
|
||||
ShowMessage("Invalid number (%d)!", part);
|
||||
ShowMessage("Number is out of range");
|
||||
return;
|
||||
}
|
||||
Config.locked_screen_width_part = part/100.0;
|
||||
if (myScreen->Lock())
|
||||
ShowMessage("Screen locked (with %d%% width)", part);
|
||||
else
|
||||
ShowMessage("Screen cannot be locked");
|
||||
ShowMessage("Current screen can't be locked");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1700,7 +1699,7 @@ void JumpToPositionInSong::Run()
|
||||
|
||||
if (!Mpd.GetTotalTime())
|
||||
{
|
||||
ShowMessage("Unknown item length!");
|
||||
ShowMessage("Unknown item length");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1722,7 +1721,7 @@ void JumpToPositionInSong::Run()
|
||||
if (newpos >= 0 && newpos <= Mpd.GetTotalTime())
|
||||
Mpd.Seek(newpos);
|
||||
else
|
||||
ShowMessage("Out of bounds, 0:00-%s possible for mm:ss, %s given.", s->GetLength().c_str(), MPD::Song::ShowTime(newpos).c_str());
|
||||
ShowMessage("Out of bounds, 0:00-%s possible for mm:ss, %s given", s->GetLength().c_str(), MPD::Song::ShowTime(newpos).c_str());
|
||||
}
|
||||
else if (position.find('s') != std::string::npos) // probably position in seconds
|
||||
{
|
||||
@@ -1730,7 +1729,7 @@ void JumpToPositionInSong::Run()
|
||||
if (newpos >= 0 && newpos <= Mpd.GetTotalTime())
|
||||
Mpd.Seek(newpos);
|
||||
else
|
||||
ShowMessage("Out of bounds, 0-%d possible for seconds, %d given.", s->GetTotalLength(), newpos);
|
||||
ShowMessage("Out of bounds, 0-%d possible for seconds, %d given", s->GetTotalLength(), newpos);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1738,7 +1737,7 @@ void JumpToPositionInSong::Run()
|
||||
if (newpos >= 0 && newpos <= 100)
|
||||
Mpd.Seek(Mpd.GetTotalTime()*newpos/100.0);
|
||||
else
|
||||
ShowMessage("Out of bounds, 0-100 possible for %%, %d given.", newpos);
|
||||
ShowMessage("Out of bounds, 0-100 possible for %%, %d given", newpos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1750,7 +1749,7 @@ bool ReverseSelection::canBeRun() const
|
||||
void ReverseSelection::Run()
|
||||
{
|
||||
myScreen->ReverseSelection();
|
||||
ShowMessage("Selection reversed!");
|
||||
ShowMessage("Selection reversed");
|
||||
}
|
||||
|
||||
bool DeselectItems::canBeRun() const
|
||||
@@ -1765,7 +1764,7 @@ void DeselectItems::Run()
|
||||
return;
|
||||
for (size_t i = 0; i < mList->Size(); ++i)
|
||||
mList->Select(i, 0);
|
||||
ShowMessage("Items deselected!");
|
||||
ShowMessage("Items deselected");
|
||||
}
|
||||
|
||||
bool SelectAlbum::canBeRun() const
|
||||
@@ -1804,7 +1803,7 @@ void SelectAlbum::Run()
|
||||
else
|
||||
mList->Select(pos, 1);
|
||||
}
|
||||
ShowMessage("Album around cursor position selected.");
|
||||
ShowMessage("Album around cursor position selected");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1836,9 +1835,9 @@ void CropMainPlaylist::Run()
|
||||
|| (!delete_all_but_current && !myPlaylist->Items->isSelected(myPlaylist->NowPlaying));
|
||||
if (myPlaylist->isPlaying() && delete_np)
|
||||
Mpd.DeleteID(myPlaylist->NowPlayingSong()->GetID());
|
||||
ShowMessage("Deleting all items but selected...");
|
||||
ShowMessage("Cropping playlist...");
|
||||
if (Mpd.CommitCommandsList())
|
||||
ShowMessage("Items deleted!");
|
||||
ShowMessage("Playlist cropped");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1868,10 +1867,10 @@ void CropPlaylist::Run()
|
||||
if (delete_i)
|
||||
Mpd.Delete(playlist, i);
|
||||
}
|
||||
ShowMessage("Deleting all items but selected...");
|
||||
ShowMessage("Cropping playlist \"%s\"...", myPlaylistEditor->Playlists->Current().c_str());
|
||||
if (Mpd.CommitCommandsList())
|
||||
{
|
||||
ShowMessage("Items deleted!");
|
||||
ShowMessage("Playlist \"%s\" cropped", myPlaylistEditor->Playlists->Current().c_str());
|
||||
// enforce content update
|
||||
myPlaylistEditor->Content->Clear();
|
||||
}
|
||||
@@ -1892,12 +1891,13 @@ void ClearMainPlaylist::Run()
|
||||
for (int i = myPlaylist->Items->Size()-1; i >= 0; --i)
|
||||
Mpd.Delete((*myPlaylist->Items)[i].GetPosition());
|
||||
if (Mpd.CommitCommandsList())
|
||||
ShowMessage("Filtered items deleted!");
|
||||
ShowMessage("Filtered items deleted");
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowMessage("Clearing playlist...");
|
||||
Mpd.ClearPlaylist();
|
||||
if (Mpd.ClearPlaylist())
|
||||
ShowMessage("Playlist cleared");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1911,20 +1911,21 @@ void ClearPlaylist::Run()
|
||||
{
|
||||
if (myPlaylistEditor->Playlists->Empty())
|
||||
return;
|
||||
|
||||
// OMGPLZ
|
||||
bool yes = true;
|
||||
if (Config.ask_before_clearing_main_playlist)
|
||||
yes = AskYesNoQuestion("Do you really want to clear playlist \"" + myPlaylistEditor->Playlists->Current() + "\"?", TraceMpdStatus);
|
||||
if (yes)
|
||||
{
|
||||
if (myPlaylist->Items->isFiltered())
|
||||
if (myPlaylistEditor->Content->isFiltered())
|
||||
{
|
||||
ShowMessage("Deleting filtered items...");
|
||||
std::string playlist = locale_to_utf_cpy(myPlaylistEditor->Playlists->Current());
|
||||
ShowMessage("Deleting filtered items from playlist \"%s\"...", myPlaylistEditor->Playlists->Current().c_str());
|
||||
Mpd.StartCommandsList();
|
||||
for (int i = myPlaylistEditor->Content->Size()-1; i >= 0; --i)
|
||||
Mpd.Delete((*myPlaylistEditor->Content)[i].GetPosition());
|
||||
Mpd.Delete(playlist, (*myPlaylistEditor->Content)[i].GetPosition());
|
||||
if (Mpd.CommitCommandsList())
|
||||
ShowMessage("Filtered items deleted!");
|
||||
ShowMessage("Filtered items deleted from playlist \"%s\"", myPlaylistEditor->Playlists->Current().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2095,7 +2096,7 @@ void ToggleReplayGainMode::Run()
|
||||
void ToggleSpaceMode::Run()
|
||||
{
|
||||
Config.space_selects = !Config.space_selects;
|
||||
ShowMessage("Space mode: %s item", Config.space_selects ? "Select/deselect" : "Add");
|
||||
ShowMessage("Space mode: %s item", Config.space_selects ? "Select" : "Add");
|
||||
}
|
||||
|
||||
void ToggleAddMode::Run()
|
||||
@@ -2142,7 +2143,7 @@ void AddRandomItems::Run()
|
||||
size_t number = StrToLong(wFooter->GetString());
|
||||
UnlockStatusbar();
|
||||
if (number && (answer == 's' ? Mpd.AddRandomSongs(number) : Mpd.AddRandomTag(tag_type, number)))
|
||||
ShowMessage("%zu random %s%s added to playlist!", number, tag_type_str.c_str(), number == 1 ? "" : "s");
|
||||
ShowMessage("%zu random %s%s added to playlist", number, tag_type_str.c_str(), number == 1 ? "" : "s");
|
||||
}
|
||||
|
||||
bool ToggleBrowserSortMode::canBeRun() const
|
||||
@@ -2278,7 +2279,7 @@ void SetSelectedItemsPriority::Run()
|
||||
int prio = atoi(strprio.c_str());
|
||||
if (prio < 0 || prio > 255)
|
||||
{
|
||||
ShowMessage("Entered number is out of range");
|
||||
ShowMessage("Number is out of range");
|
||||
return;
|
||||
}
|
||||
myPlaylist->SetSelectedItemsPriority(prio);
|
||||
|
||||
@@ -140,11 +140,11 @@ void Browser::EnterPressed()
|
||||
}
|
||||
case itPlaylist:
|
||||
{
|
||||
ShowMessage("Loading and playing playlist \"%s\"...", item.name.c_str());
|
||||
if (Mpd.LoadPlaylist(locale_to_utf_cpy(item.name)))
|
||||
{
|
||||
ShowMessage("Playlist \"%s\" loaded", item.name.c_str());
|
||||
else
|
||||
myPlaylist->PlayNewlyAddedSongs();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ void Browser::SpacePressed()
|
||||
{
|
||||
MPD::SongList list;
|
||||
MPD::ItemList items;
|
||||
ShowMessage("Scanning \"%s\"...", item.name.c_str());
|
||||
ShowMessage("Scanning directory \"%s\"...", item.name.c_str());
|
||||
myBrowser->GetLocalDirectory(items, item.name, 1);
|
||||
list.reserve(items.size());
|
||||
for (MPD::ItemList::const_iterator it = items.begin(); it != items.end(); ++it)
|
||||
@@ -190,7 +190,7 @@ void Browser::SpacePressed()
|
||||
# endif // !WIN32
|
||||
result = Mpd.Add(locale_to_utf_cpy(item.name));
|
||||
if (result)
|
||||
ShowMessage("Added folder: %s", item.name.c_str());
|
||||
ShowMessage("Directory \"%s\" added", item.name.c_str());
|
||||
break;
|
||||
}
|
||||
case itSong:
|
||||
@@ -201,7 +201,6 @@ void Browser::SpacePressed()
|
||||
}
|
||||
case itPlaylist:
|
||||
{
|
||||
ShowMessage("Loading playlist \"%s\"...", item.name.c_str());
|
||||
if (Mpd.LoadPlaylist(locale_to_utf_cpy(item.name)))
|
||||
ShowMessage("Playlist \"%s\" loaded", item.name.c_str());
|
||||
break;
|
||||
@@ -519,7 +518,7 @@ void Browser::ChangeBrowseMode()
|
||||
return;
|
||||
|
||||
itsBrowseLocally = !itsBrowseLocally;
|
||||
ShowMessage("Browse mode: %s", itsBrowseLocally ? "Local filesystem" : "MPD music dir");
|
||||
ShowMessage("Browse mode: %s", itsBrowseLocally ? "Local filesystem" : "MPD database");
|
||||
itsBrowsedDir = itsBrowseLocally ? Config.GetHomeDirectory() : "/";
|
||||
if (itsBrowseLocally && *itsBrowsedDir.rbegin() == '/')
|
||||
itsBrowsedDir.resize(itsBrowsedDir.length()-1);
|
||||
|
||||
@@ -90,7 +90,7 @@ void Clock::SwitchTo()
|
||||
GetWindowResizeParams(x_offset, width, false);
|
||||
if (Width > width || Height > MainHeight)
|
||||
{
|
||||
ShowMessage("Screen is too small to display clock!");
|
||||
ShowMessage("Screen is too small to display clock");
|
||||
if (myLockedScreen)
|
||||
UpdateInactiveScreen(myLockedScreen);
|
||||
return;
|
||||
|
||||
@@ -129,7 +129,7 @@ void Lyrics::SwitchTo()
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowMessage("Song must have both artist and title tag set!");
|
||||
ShowMessage("Song must have both artist and title tag set");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ void Lyrics::DownloadInBackground(const MPD::Song *s)
|
||||
f.close();
|
||||
return;
|
||||
}
|
||||
ShowMessage("Fetching lyrics for %s...", s->toString(Config.song_status_format_no_colors).c_str());
|
||||
ShowMessage("Fetching lyrics for \"%s\"...", s->toString(Config.song_status_format_no_colors).c_str());
|
||||
|
||||
MPD::Song *s_copy = new MPD::Song(*s);
|
||||
pthread_mutex_lock(&itsDIBLock);
|
||||
@@ -369,7 +369,7 @@ void Lyrics::Edit()
|
||||
|
||||
if (Config.external_editor.empty())
|
||||
{
|
||||
ShowMessage("External editor is not set!");
|
||||
ShowMessage("Proper external_editor variable has to be set in configuration file");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -629,7 +629,7 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
|
||||
// <mpd-0.14.* has no ability to search for empty tags, which sometimes
|
||||
// leaves albums column empty. since this function relies on this column
|
||||
// being non-empty, it has to be disabled for these versions.
|
||||
ShowMessage("Your MPD version is too old to handle this function properly, please upgrade.");
|
||||
ShowMessage("This function is supported in MPD >= 0.14.0");
|
||||
return;
|
||||
}
|
||||
std::string primary_tag;
|
||||
@@ -650,15 +650,15 @@ void MediaLibrary::LocateSong(const MPD::Song &s)
|
||||
case MPD_TAG_PERFORMER:
|
||||
primary_tag = s.GetPerformer();
|
||||
break;
|
||||
default:
|
||||
ShowMessage("Invalid tag type in left column of the media library");
|
||||
default: // shouldn't happen
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
if (primary_tag.empty())
|
||||
{
|
||||
std::string item_type = IntoStr(Config.media_lib_primary_tag);
|
||||
ToLower(item_type);
|
||||
ShowMessage("Can't jump to media library because the song has no %s tag set.", item_type.c_str());
|
||||
ShowMessage("Can't use this function because the song has no %s tag set", item_type.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -749,10 +749,10 @@ void MediaLibrary::AddToPlaylist(bool add_n_play)
|
||||
{
|
||||
std::string tag_type = IntoStr(Config.media_lib_primary_tag);
|
||||
ToLower(tag_type);
|
||||
ShowMessage("Adding songs of %s \"%s\"", tag_type.c_str(), Artists->Current().c_str());
|
||||
ShowMessage("Songs with %s = \"%s\" added", tag_type.c_str(), Artists->Current().c_str());
|
||||
}
|
||||
else if (w == Albums)
|
||||
ShowMessage("Adding songs from album \"%s\"", Albums->Current().Album.c_str());
|
||||
ShowMessage("Songs from album \"%s\" added", Albums->Current().Album.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -535,19 +535,19 @@ void MPD::Connection::Shuffle()
|
||||
}
|
||||
}
|
||||
|
||||
void MPD::Connection::ClearPlaylist()
|
||||
bool MPD::Connection::ClearPlaylist()
|
||||
{
|
||||
if (!itsConnection)
|
||||
return;
|
||||
return false;
|
||||
if (!isCommandsListEnabled)
|
||||
{
|
||||
GoBusy();
|
||||
mpd_run_clear(itsConnection);
|
||||
return mpd_run_clear(itsConnection);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(!isIdle);
|
||||
mpd_send_clear(itsConnection);
|
||||
return mpd_send_clear(itsConnection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace MPD
|
||||
void Swap(unsigned, unsigned);
|
||||
void Seek(unsigned);
|
||||
void Shuffle();
|
||||
void ClearPlaylist();
|
||||
bool ClearPlaylist();
|
||||
|
||||
bool isPlaying() const { return GetState() > psStop; }
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace
|
||||
{
|
||||
if (signal == SIGPIPE)
|
||||
{
|
||||
ShowMessage("Broken pipe signal caught!");
|
||||
ShowMessage("SIGPIPE (broken pipe signal) received");
|
||||
}
|
||||
else if (signal == SIGWINCH)
|
||||
{
|
||||
@@ -206,7 +206,7 @@ int main(int argc, char **argv)
|
||||
ShowMessage("Attempting to reconnect...");
|
||||
if (Mpd.Connect())
|
||||
{
|
||||
ShowMessage("Connected to %s!", Mpd.GetHostname().c_str());
|
||||
ShowMessage("Connected to %s", Mpd.GetHostname().c_str());
|
||||
if (Mpd.SupportsIdle())
|
||||
{
|
||||
wFooter->AddFDCallback(Mpd.GetFD(), StatusbarMPDCallback);
|
||||
|
||||
@@ -216,7 +216,7 @@ void Playlist::EnterPressed()
|
||||
}
|
||||
while (playlist != cmp);
|
||||
if (Mpd.CommitCommandsList())
|
||||
ShowMessage("Playlist sorted!");
|
||||
ShowMessage("Playlist sorted");
|
||||
w = Items;
|
||||
}
|
||||
}
|
||||
@@ -377,7 +377,7 @@ void Playlist::Sort()
|
||||
if (isFiltered())
|
||||
return;
|
||||
if (Items->GetWidth() < SortDialogWidth || MainHeight < 5)
|
||||
ShowMessage("Screen is too small to display dialog window!");
|
||||
ShowMessage("Screen is too small to display dialog window");
|
||||
else
|
||||
{
|
||||
SortDialog->Reset();
|
||||
@@ -409,7 +409,7 @@ void Playlist::Reverse()
|
||||
for (size_t i = beginning, j = end-1; i < (beginning+end)/2; ++i, --j)
|
||||
Mpd.Swap(i, j);
|
||||
if (Mpd.CommitCommandsList())
|
||||
ShowMessage("Playlist reversed!");
|
||||
ShowMessage("Playlist reversed");
|
||||
}
|
||||
|
||||
void Playlist::AdjustSortOrder(Movement where)
|
||||
@@ -439,16 +439,6 @@ void Playlist::AdjustSortOrder(Movement where)
|
||||
}
|
||||
}
|
||||
|
||||
void Playlist::FixPositions(size_t beginning)
|
||||
{
|
||||
bool was_filtered = Items->isFiltered();
|
||||
Items->ShowAll();
|
||||
for (size_t i = beginning; i < Items->Size(); ++i)
|
||||
(*Items)[i].SetPosition(i);
|
||||
if (was_filtered)
|
||||
Items->ShowFiltered();
|
||||
}
|
||||
|
||||
void Playlist::EnableHighlighting()
|
||||
{
|
||||
Items->Highlighting(1);
|
||||
|
||||
@@ -69,7 +69,6 @@ class Playlist : public Screen<Window>
|
||||
void Reverse();
|
||||
void AdjustSortOrder(Movement where);
|
||||
bool SortingInProgress() { return w == SortDialog; }
|
||||
void FixPositions(size_t = 0);
|
||||
|
||||
void EnableHighlighting();
|
||||
void UpdateTimer() { time(&itsTimer); }
|
||||
|
||||
@@ -325,12 +325,6 @@ void PlaylistEditor::AddToPlaylist(bool add_n_play)
|
||||
|
||||
if (w == Playlists && !Playlists->Empty())
|
||||
{
|
||||
const char *msg;
|
||||
if (add_n_play)
|
||||
msg = "Loading and playing playlist \"%s\"...";
|
||||
else
|
||||
msg = "Loading playlist \"%s\"...";
|
||||
ShowMessage(msg, Playlists->Current().c_str());
|
||||
if (Mpd.LoadPlaylist(utf_to_locale_cpy(Playlists->Current())))
|
||||
{
|
||||
ShowMessage("Playlist \"%s\" loaded", Playlists->Current().c_str());
|
||||
|
||||
@@ -172,7 +172,7 @@ void SearchEngine::EnterPressed()
|
||||
*w->at(ResetButton+2).first << Config.color1 << "Search results: " << Config.color2 << "Found " << found << (found > 1 ? " songs" : " song") << clDefault;
|
||||
w->InsertSeparator(ResetButton+3);
|
||||
UpdateFoundList();
|
||||
ShowMessage("Searching finished!");
|
||||
ShowMessage("Searching finished");
|
||||
if (Config.block_search_constraints_change)
|
||||
for (size_t i = 0; i < StaticOptions-4; ++i)
|
||||
w->Static(i, 1);
|
||||
|
||||
@@ -72,7 +72,7 @@ void SelectedItemsAdder::SwitchTo()
|
||||
|
||||
if (MainHeight < 5)
|
||||
{
|
||||
ShowMessage("Screen is too small to display this window!");
|
||||
ShowMessage("Screen is too small to display this window");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ void SelectedItemsAdder::SwitchTo()
|
||||
|
||||
bool playlists_not_active = myScreen == myBrowser && myBrowser->isLocal();
|
||||
if (playlists_not_active)
|
||||
ShowMessage("Local items cannot be added to m3u playlist!");
|
||||
ShowMessage("Local items can't be added to stored playlists");
|
||||
|
||||
w->Clear();
|
||||
w->Reset();
|
||||
@@ -182,7 +182,7 @@ void SelectedItemsAdder::EnterPressed()
|
||||
for (MPD::SongList::const_iterator it = list.begin(); it != list.end(); ++it)
|
||||
Mpd.AddToPlaylist(utf_playlist, **it);
|
||||
if (Mpd.CommitCommandsList())
|
||||
ShowMessage("Selected item(s) added to playlist \"%s\"!", playlist.c_str());
|
||||
ShowMessage("Selected item(s) added to playlist \"%s\"", playlist.c_str());
|
||||
}
|
||||
}
|
||||
else if (pos > 1 && pos < w->Size()-1) // add items to existing playlist
|
||||
@@ -192,7 +192,7 @@ void SelectedItemsAdder::EnterPressed()
|
||||
for (MPD::SongList::const_iterator it = list.begin(); it != list.end(); ++it)
|
||||
Mpd.AddToPlaylist(playlist, **it);
|
||||
if (Mpd.CommitCommandsList())
|
||||
ShowMessage("Selected item(s) added to playlist \"%s\"!", w->Current().c_str());
|
||||
ShowMessage("Selected item(s) added to playlist \"%s\"", w->Current().c_str());
|
||||
}
|
||||
if (pos != w->Size()-1)
|
||||
{
|
||||
@@ -208,7 +208,7 @@ void SelectedItemsAdder::EnterPressed()
|
||||
// disable adding after current track/album when stopped
|
||||
if (pos > 1 && pos < 4 && !Mpd.isPlaying())
|
||||
{
|
||||
ShowMessage("Player is stopped!");
|
||||
ShowMessage("Player is stopped");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ void SelectedItemsAdder::EnterPressed()
|
||||
}
|
||||
|
||||
if (successful_operation)
|
||||
ShowMessage("Selected item(s) added!");
|
||||
ShowMessage("Selected item(s) added");
|
||||
}
|
||||
MPD::FreeSongList(list);
|
||||
SwitchTo();
|
||||
|
||||
@@ -52,7 +52,7 @@ void ServerInfo::SwitchTo()
|
||||
}
|
||||
if (MainHeight < 5)
|
||||
{
|
||||
ShowMessage("Screen is too small to display this window!");
|
||||
ShowMessage("Screen is too small to display this window");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ void NcmpcppErrorCallback(MPD::Connection *, int errorid, const char *msg, void
|
||||
Statusbar() << "Password: ";
|
||||
Mpd.SetPassword(wFooter->GetString(-1, 0, 1));
|
||||
if (Mpd.SendPassword())
|
||||
ShowMessage("Password accepted!");
|
||||
ShowMessage("Password accepted");
|
||||
wFooter->SetGetStringHelper(StatusbarGetStringHelper);
|
||||
}
|
||||
else if ((errorid >> 8) == MPD_SERVER_ERROR_NO_EXIST && myScreen == myBrowser)
|
||||
@@ -207,7 +207,7 @@ void NcmpcppErrorCallback(MPD::Connection *, int errorid, const char *msg, void
|
||||
myBrowser->Refresh();
|
||||
}
|
||||
else
|
||||
ShowMessage("%s", msg);
|
||||
ShowMessage("MPD: %s", msg);
|
||||
}
|
||||
|
||||
void NcmpcppStatusChanged(MPD::Connection *, MPD::StatusChanges changed, void *)
|
||||
@@ -269,7 +269,6 @@ void NcmpcppStatusChanged(MPD::Connection *, MPD::StatusChanges changed, void *)
|
||||
{
|
||||
myPlaylist->Items->Reset();
|
||||
myPlaylist->Items->Window::Clear();
|
||||
ShowMessage("Cleared playlist!");
|
||||
}
|
||||
|
||||
if (isVisible(myBrowser))
|
||||
@@ -550,7 +549,7 @@ void NcmpcppStatusChanged(MPD::Connection *, MPD::StatusChanges changed, void *)
|
||||
if (changed.Database && myScreen == mySelectedItemsAdder)
|
||||
{
|
||||
myScreen->SwitchTo(); // switch to previous screen
|
||||
ShowMessage("Database has changed, you need to select your item(s) once again!");
|
||||
ShowMessage("Database has changed, you need to select your item(s) once again");
|
||||
}
|
||||
}
|
||||
if (changed.StatusFlags && (Config.header_visibility || Config.new_design))
|
||||
|
||||
@@ -456,7 +456,7 @@ void TagEditor::EnterPressed()
|
||||
std::string new_file = GenerateFilename(s, "{" + Config.pattern + "}");
|
||||
if (new_file.empty() && !FParserUsePreview)
|
||||
{
|
||||
ShowMessage("File \"%s\" would have an empty name!", s.GetName().c_str());
|
||||
ShowMessage("File \"%s\" would have an empty name", s.GetName().c_str());
|
||||
FParserUsePreview = 1;
|
||||
success = 0;
|
||||
}
|
||||
@@ -485,7 +485,7 @@ void TagEditor::EnterPressed()
|
||||
quit = 1;
|
||||
}
|
||||
if (pos != 3 || success)
|
||||
ShowMessage("Operation finished!");
|
||||
ShowMessage("Operation finished");
|
||||
}
|
||||
else if (pos == 2) // show legend
|
||||
{
|
||||
@@ -541,10 +541,10 @@ void TagEditor::EnterPressed()
|
||||
else
|
||||
(*it)->SetTrack(i);
|
||||
}
|
||||
ShowMessage("Tracks numbered!");
|
||||
ShowMessage("Tracks numbered");
|
||||
}
|
||||
else
|
||||
ShowMessage("Aborted!");
|
||||
ShowMessage("Aborted");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ void TagEditor::EnterPressed()
|
||||
{
|
||||
if (size_t(COLS) < FParserDialogWidth || MainHeight < FParserDialogHeight)
|
||||
{
|
||||
ShowMessage("Screen is too small to display additional windows!");
|
||||
ShowMessage("Screen is too small to display additional windows");
|
||||
return;
|
||||
}
|
||||
FParserDialog->Reset();
|
||||
@@ -607,14 +607,14 @@ void TagEditor::EnterPressed()
|
||||
ShowMessage("Processing...");
|
||||
for (MPD::SongList::iterator it = EditedSongs.begin(); it != EditedSongs.end(); ++it)
|
||||
CapitalizeFirstLetters(**it);
|
||||
ShowMessage("Done!");
|
||||
ShowMessage("Done");
|
||||
}
|
||||
else if (id == 13) // lower all letters
|
||||
{
|
||||
ShowMessage("Processing...");
|
||||
for (MPD::SongList::iterator it = EditedSongs.begin(); it != EditedSongs.end(); ++it)
|
||||
LowerAllLetters(**it);
|
||||
ShowMessage("Done!");
|
||||
ShowMessage("Done");
|
||||
}
|
||||
else if (id == 14) // reset
|
||||
{
|
||||
@@ -630,7 +630,7 @@ void TagEditor::EnterPressed()
|
||||
ShowMessage("Writing tags in \"%s\"...", (*it)->GetName().c_str());
|
||||
if (!WriteTags(**it))
|
||||
{
|
||||
const char msg[] = "Error while writing tags in \"%s\"!";
|
||||
const char msg[] = "Error while writing tags in \"%s\"";
|
||||
ShowMessage(msg, Shorten(TO_WSTRING((*it)->GetFile()), COLS-static_strlen(msg)).c_str());
|
||||
success = 0;
|
||||
break;
|
||||
@@ -638,7 +638,7 @@ void TagEditor::EnterPressed()
|
||||
}
|
||||
if (success)
|
||||
{
|
||||
ShowMessage("Tags updated!");
|
||||
ShowMessage("Tags updated");
|
||||
TagTypes->HighlightColor(Config.main_highlight_color);
|
||||
TagTypes->Reset();
|
||||
w->Refresh();
|
||||
|
||||
@@ -68,7 +68,7 @@ void TinyTagEditor::SwitchTo()
|
||||
|
||||
if (itsEdited.isStream())
|
||||
{
|
||||
ShowMessage("Streams cannot be edited!");
|
||||
ShowMessage("Streams can't be edited");
|
||||
}
|
||||
else if (GetTags())
|
||||
{
|
||||
@@ -135,7 +135,7 @@ void TinyTagEditor::EnterPressed()
|
||||
ShowMessage("Updating tags...");
|
||||
if (TagEditor::WriteTags(s))
|
||||
{
|
||||
ShowMessage("Tags updated!");
|
||||
ShowMessage("Tags updated");
|
||||
if (s.isFromDB())
|
||||
{
|
||||
Mpd.UpdateDirectory(locale_to_utf_cpy(s.GetDirectory()));
|
||||
@@ -151,7 +151,7 @@ void TinyTagEditor::EnterPressed()
|
||||
}
|
||||
}
|
||||
else
|
||||
ShowMessage("Error while writing tags!");
|
||||
ShowMessage("Error while writing tags");
|
||||
}
|
||||
if (option > 21)
|
||||
myOldScreen->SwitchTo();
|
||||
|
||||
@@ -242,7 +242,7 @@ void Visualizer::FindOutputID()
|
||||
if (outputs[i].first == Config.visualizer_output_name)
|
||||
itsOutputID = i;
|
||||
if (itsOutputID == -1)
|
||||
ShowMessage("There is no output named \"%s\"!", Config.visualizer_output_name.c_str());
|
||||
ShowMessage("There is no output named \"%s\"", Config.visualizer_output_name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user