restrict conversions being done in strbuffer

This commit is contained in:
Andrzej Rybczak
2012-08-28 07:12:31 +02:00
parent a20a195225
commit b910ce38be
7 changed files with 139 additions and 88 deletions

View File

@@ -94,23 +94,25 @@ std::string Help::DisplayKeys(const ActionType at)
void Help::Section(const char *type, const char *title)
{
*w << "\n " << fmtBold << type << " - " << title << fmtBoldEnd << "\n\n";
*w << U("\n ") << fmtBold << TO_WSTRING(type) << U(" - ");
*w << TO_WSTRING(title) << fmtBoldEnd << '\n' << '\n';
}
void Help::KeyDesc(const ActionType at, const char *desc)
{
*w << " " << DisplayKeys(at) << " : " << desc << "\n";
*w << U(" ") << DisplayKeys(at) << U(" : ") << TO_WSTRING(desc) << '\n';
}
void Help::MouseDesc(std::string action, const char *desc, bool indent)
{
action.resize(31 - (indent ? 2 : 0), ' ');
*w << " " << (indent ? " " : "") << action << ": " << desc << "\n";
*w << U(" ") << (indent ? U(" ") : U("")) << TO_WSTRING(action);
*w << U(": ") << TO_WSTRING(desc) << '\n';
}
void Help::MouseColumn(const char *column)
{
*w << fmtBold << " " << column << " column:\n" << fmtBoldEnd;
*w << fmtBold << U(" ") << TO_WSTRING(column) << U(" column:\n") << fmtBoldEnd;
}
void Help::GetKeybindings()
@@ -126,7 +128,7 @@ void Help::GetKeybindings()
KeyDesc(aPageDown, "Page down");
KeyDesc(aMoveHome, "Home");
KeyDesc(aMoveEnd, "End");
*w << "\n";
*w << '\n';
if (Config.screen_switcher_previous)
{
KeyDesc(aNextScreen, "Switch between current and last screen");
@@ -155,7 +157,7 @@ void Help::GetKeybindings()
# ifdef ENABLE_CLOCK
KeyDesc(aShowClock, "Show clock");
# endif // ENABLE_CLOCK
*w << "\n";
*w << '\n';
KeyDesc(aShowServerInfo, "Show server info");
KeysSection("Global");
@@ -168,7 +170,7 @@ void Help::GetKeybindings()
KeyDesc(aSeekBackward, "Seek backward in playing song");
KeyDesc(aVolumeDown, "Decrease volume by 2%");
KeyDesc(aVolumeUp, "Increase volume by 2%");
*w << "\n";
*w << '\n';
KeyDesc(aToggleSpaceMode, "Toggle space mode (select/add)");
KeyDesc(aToggleAddMode, "Toggle add mode (add or remove/always add)");
KeyDesc(aToggleMouse, "Toggle mouse support");
@@ -177,7 +179,7 @@ void Help::GetKeybindings()
KeyDesc(aSelectAlbum, "Select songs of album around the cursor");
KeyDesc(aAddSelectedItems, "Add selected items to playlist");
KeyDesc(aAddRandomItems, "Add random items to playlist");
*w << "\n";
*w << '\n';
KeyDesc(aToggleRepeat, "Toggle repeat mode");
KeyDesc(aToggleRandom, "Toggle random mode");
KeyDesc(aToggleSingle, "Toggle single mode");
@@ -188,7 +190,7 @@ void Help::GetKeybindings()
KeyDesc(aToggleCrossfade, "Toggle crossfade mode");
KeyDesc(aSetCrossfade, "Set crossfade");
KeyDesc(aUpdateDatabase, "Start music database update");
*w << "\n";
*w << '\n';
KeyDesc(aApplyFilter, "Apply filter");
KeyDesc(aDisableFilter, "Disable filter");
KeyDesc(aFindItemForward, "Find item forward");
@@ -215,7 +217,7 @@ void Help::GetKeybindings()
KeyDesc(aToggleFetchingLyricsInBackground, "Toggle fetching lyrics for playing songs in background");
# endif // HAVE_CURL_CURL_H
KeyDesc(aShowLyrics, "Show/hide song lyrics");
*w << "\n";
*w << '\n';
KeyDesc(aQuit, "Quit");
KeysSection("Playlist");
@@ -324,7 +326,7 @@ void Help::GetKeybindings()
MouseSection("Global");
MouseDesc("Left click on \"Playing/Paused\"", "Play/pause");
MouseDesc("Left click on progressbar", "Jump to pointed position in playing song");
*w << "\n";
*w << '\n';
MouseDesc("Mouse wheel on \"Volume: xx\"", "Play/pause");
MouseDesc("Mouse wheel on main window", "Scroll");
@@ -335,7 +337,7 @@ void Help::GetKeybindings()
MouseSection("Browser");
MouseDesc("Left click on directory", "Enter pointed directory");
MouseDesc("Right click on directory", "Add pointed directory to playlist");
*w << "\n";
*w << '\n';
MouseDesc("Left click on song/playlist", "Add pointed item to playlist");
MouseDesc("Right click on song/playlist", "Add pointed item to playlist and play it");
@@ -347,7 +349,7 @@ void Help::GetKeybindings()
MouseColumn("Left/middle");
MouseDesc("Left click", "Select pointed item", true);
MouseDesc("Right click", "Add item to playlist", true);
*w << "\n";
*w << '\n';
MouseColumn("Right");
MouseDesc("Left Click", "Add pointed item to playlist", true);
MouseDesc("Right Click", "Add pointed item to playlist and play it", true);
@@ -356,7 +358,7 @@ void Help::GetKeybindings()
MouseColumn("Left");
MouseDesc("Left click", "Select pointed item", true);
MouseDesc("Right click", "Add item to playlist", true);
*w << "\n";
*w << '\n';
MouseColumn("Right");
MouseDesc("Left click", "Add pointed item to playlist", true);
MouseDesc("Right click", "Add pointed item to playlist and play it", true);
@@ -370,11 +372,11 @@ void Help::GetKeybindings()
MouseColumn("Left");
MouseDesc("Left click", "Enter pointed directory/select pointed album", true);
MouseDesc("Right click", "Toggle view (directories/albums)", true);
*w << "\n";
*w << '\n';
MouseColumn("Middle");
MouseDesc("Left click", "Select option", true);
MouseDesc("Right click", "Set value/execute", true);
*w << "\n";
*w << '\n';
MouseColumn("Right");
MouseDesc("Left click", "Select pointed item", true);
MouseDesc("Right click", "Set value", true);