summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f53dec9)
raw | patch | inline | side by side (parent: f53dec9)
author | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 20:09:39 +0000 (21:09 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 20:09:39 +0000 (21:09 +0100) |
src/screen_file.c | patch | blob | history | |
src/screen_lyrics.c | patch | blob | history | |
src/screen_queue.c | patch | blob | history | |
src/screen_utils.c | patch | blob | history |
diff --git a/src/screen_file.c b/src/screen_file.c
index 06cb5ea6124a1d1878ce2fa86ef6346dfe3e5e31..2af1655d3b3eca3e89c425c831ce3d7182a77865 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
const struct mpd_playlist *playlist = mpd_entity_get_playlist(entity);
char *str = utf8_to_locale(g_basename(mpd_playlist_get_path(playlist)));
- char *buf = g_strdup_printf(_("Delete playlist %s [%s/%s] ? "), str, YES, NO);
+ char *buf = g_strdup_printf(_("Delete playlist %s?"), str);
g_free(str);
bool delete = screen_get_yesno(buf, false);
g_free(buf);
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 0bce7c4c54bdd702afcbc74a435c37f546c34824..11786c1a9e778ee503983645e468a8b63760a4fd 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
}
if (options.text_editor_ask) {
- char *buf = g_strdup_printf(
- _("Do you really want to start an editor and edit these lyrics [%s/%s]? "),
- YES, NO);
- bool really = screen_get_yesno(buf, false);
- g_free(buf);
+ const char *prompt =
+ _("Do you really want to start an editor and edit these lyrics?");
+ bool really = screen_get_yesno(prompt, false);
if (!really) {
screen_status_message(_("Aborted"));
return;
diff --git a/src/screen_queue.c b/src/screen_queue.c
index d364c910a5c0ae8e0c91f8ff707e1414361e305d..45505eee015fd51252eb4e29c2200269bc099dd4 100644 (file)
--- a/src/screen_queue.c
+++ b/src/screen_queue.c
if (mpd_connection_get_error(connection) == MPD_ERROR_SERVER &&
mpd_connection_get_server_error(connection) == MPD_SERVER_ERROR_EXIST &&
mpd_connection_clear_error(connection)) {
- char *buf = g_strdup_printf(_("Replace %s [%s/%s] ? "),
- filename, YES, NO);
+ char *buf = g_strdup_printf(_("Replace %s?"), filename);
bool replace = screen_get_yesno(buf, false);
g_free(buf);
diff --git a/src/screen_utils.c b/src/screen_utils.c
index 8f69930d64126752b048164fcd1a8d7e9d0df379..6c5ce43368c5310058534d9df608b613a1736ac6 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
}
bool
-screen_get_yesno(const char *prompt, bool def)
+screen_get_yesno(const char *_prompt, bool def)
{
/* NOTE: if one day a translator decides to use a multi-byte character
for one of the yes/no keys, we'll have to parse it properly */
+ char *prompt = g_strdup_printf(_("%s [%s/%s] "), _prompt, YES, NO);
int key = tolower(screen_getch(prompt));
+ g_free(prompt);
+
if (key == YES[0])
return true;
else if (key == NO[0])