Code

use screen_get_yesno
[ncmpc.git] / src / screen_queue.c
index 335bb17265f27a636eb93be976cd29d660d5fa13..7fb3aeadf8a4097ce058e859d72d822b3b1ba541 100644 (file)
@@ -20,7 +20,7 @@
 #include "screen_queue.h"
 #include "screen_interface.h"
 #include "screen_file.h"
-#include "screen_message.h"
+#include "screen_status.h"
 #include "screen_find.h"
 #include "config.h"
 #include "i18n.h"
@@ -287,14 +287,14 @@ playlist_save(struct mpdclient *c, char *name, char *defaultname)
                    mpd_connection_get_server_error(connection) == MPD_SERVER_ERROR_EXIST &&
                    mpd_connection_clear_error(connection)) {
                        char *buf;
-                       int key;
+                       bool replace;
 
                        buf = g_strdup_printf(_("Replace %s [%s/%s] ? "),
                                              filename, YES, NO);
-                       key = tolower(screen_getch(buf));
+                       replace = screen_get_yesno(buf, false);
                        g_free(buf);
 
-                       if (key != YES[0]) {
+                       if (!replace) {
                                g_free(filename_utf8);
                                g_free(filename);
                                screen_status_printf(_("Aborted"));
@@ -554,7 +554,7 @@ screen_queue_update(struct mpdclient *c)
                screen_queue_restore_selection();
        else
                /* the queue size may have changed, even if we havn't
-                  revceived the QUEUE idle event yet */
+                  received the QUEUE idle event yet */
                list_window_set_length(lw, playlist_length(playlist));
 
        if (((c->events & MPD_IDLE_PLAYER) != 0 &&