add a few informational messages

This commit is contained in:
Andrzej Rybczak
2012-08-14 19:17:49 +02:00
parent 2096181eb1
commit b7999b499f
4 changed files with 11 additions and 10 deletions

View File

@@ -2058,15 +2058,16 @@ void ToggleFindMode::Run()
ShowMessage("Search mode: %s", Config.wrapped_search ? "Wrapped" : "Normal"); ShowMessage("Search mode: %s", Config.wrapped_search ? "Wrapped" : "Normal");
} }
bool ToggleReplayGainMode::canBeRun() const
{
return Mpd.Version() >= 16;
}
void ToggleReplayGainMode::Run() void ToggleReplayGainMode::Run()
{ {
using Global::wFooter; using Global::wFooter;
if (Mpd.Version() < 16)
{
ShowMessage("Replay gain mode control is supported in MPD >= 0.16.0");
return;
}
LockStatusbar(); LockStatusbar();
Statusbar() << "Replay gain mode? [" << fmtBold << 'o' << fmtBoldEnd << "ff/" << fmtBold << 't' << fmtBoldEnd << "rack/" << fmtBold << 'a' << fmtBoldEnd << "lbum]"; Statusbar() << "Replay gain mode? [" << fmtBold << 'o' << fmtBoldEnd << "ff/" << fmtBold << 't' << fmtBoldEnd << "rack/" << fmtBold << 'a' << fmtBoldEnd << "lbum]";
wFooter->Refresh(); wFooter->Refresh();

View File

@@ -645,7 +645,6 @@ struct ToggleFindMode : public Action
struct ToggleReplayGainMode : public Action struct ToggleReplayGainMode : public Action
{ {
ToggleReplayGainMode() : Action(aToggleReplayGainMode, "toggle_replay_gain_mode") { } ToggleReplayGainMode() : Action(aToggleReplayGainMode, "toggle_replay_gain_mode") { }
virtual bool canBeRun() const;
virtual void Run(); virtual void Run();
}; };

View File

@@ -515,7 +515,10 @@ void Browser::ClearDirectory(const std::string &path) const
void Browser::ChangeBrowseMode() void Browser::ChangeBrowseMode()
{ {
if (Mpd.GetHostname()[0] != '/') if (Mpd.GetHostname()[0] != '/')
{
ShowMessage("For browsing local filesystem connection to MPD via UNIX Socket is required");
return; return;
}
itsBrowseLocally = !itsBrowseLocally; itsBrowseLocally = !itsBrowseLocally;
ShowMessage("Browse mode: %s", itsBrowseLocally ? "Local filesystem" : "MPD database"); ShowMessage("Browse mode: %s", itsBrowseLocally ? "Local filesystem" : "MPD database");

View File

@@ -227,8 +227,7 @@ void Help::GetKeybindings()
KeyDesc(aToggleRandom, "Toggle random mode"); KeyDesc(aToggleRandom, "Toggle random mode");
KeyDesc(aToggleSingle, "Toggle single mode"); KeyDesc(aToggleSingle, "Toggle single mode");
KeyDesc(aToggleConsume, "Toggle consume mode"); KeyDesc(aToggleConsume, "Toggle consume mode");
if (Mpd.Version() >= 16) KeyDesc(aToggleReplayGainMode, "Toggle replay gain mode");
KeyDesc(aToggleReplayGainMode, "Toggle replay gain mode");
KeyDesc(aToggleBitrateVisibility, "Toggle bitrate visibility"); KeyDesc(aToggleBitrateVisibility, "Toggle bitrate visibility");
KeyDesc(aShuffle, "Shuffle playlist"); KeyDesc(aShuffle, "Shuffle playlist");
KeyDesc(aToggleCrossfade, "Toggle crossfade mode"); KeyDesc(aToggleCrossfade, "Toggle crossfade mode");
@@ -291,8 +290,7 @@ void Help::GetKeybindings()
# endif // HAVE_TAGLIB_H # endif // HAVE_TAGLIB_H
KeyDesc(aEditDirectoryName, "Edit directory name"); KeyDesc(aEditDirectoryName, "Edit directory name");
KeyDesc(aEditPlaylistName, "Edit playlist name"); KeyDesc(aEditPlaylistName, "Edit playlist name");
if (Mpd.GetHostname()[0] == '/') // are we connected to unix socket? KeyDesc(aShowBrowser, "Browse MPD database/local filesystem");
KeyDesc(aShowBrowser, "Browse MPD database/local filesystem");
KeyDesc(aToggleBrowserSortMode, "Toggle sort mode"); KeyDesc(aToggleBrowserSortMode, "Toggle sort mode");
KeyDesc(aJumpToPlayingSong, "Locate playing song"); KeyDesc(aJumpToPlayingSong, "Locate playing song");
KeyDesc(aJumpToParentDir, "Go to parent directory"); KeyDesc(aJumpToParentDir, "Go to parent directory");