diff --git a/src/screen_utils.c b/src/screen_utils.c
index 39b11622aeba0a35848f4b17981200204a89d0aa..8889ac13277b8b8cb0b2edf53609847bc469ae80 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
/* ncmpc (Ncurses MPD Client)
- * (c) 2004-2009 The Music Player Daemon Project
+ * (c) 2004-2010 The Music Player Daemon Project
* Project homepage: http://musicpd.org
-
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
+ */
#include "screen_utils.h"
#include "screen.h"
#include "wreadln.h"
#include <mpd/client.h>
+#include <ctype.h>
void
screen_bell(void)
return key;
}
+bool
+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 */
+
+ int key = tolower(screen_getch(prompt));
+ if (key == YES[0])
+ return true;
+ else if (key == NO[0])
+ return false;
+ else
+ return def;
+}
+
char *
screen_readln(const char *prompt,
const char *value,