From da587f1423529e6daae07bc4ff604ab5d6132942 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 5 May 2011 17:21:56 +0200 Subject: Replace generic "search for artist/title" message Closes #115 --- src/ui.c | 4 ++-- src/ui.h | 2 +- src/ui_act.c | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui.c b/src/ui.c index 94e559e..fd2302d 100644 --- a/src/ui.c +++ b/src/ui.c @@ -473,14 +473,14 @@ PianoArtist_t *BarUiSelectArtist (PianoArtist_t *startArtist, * @param allow seed suggestions if != NULL * @return musicId or NULL on abort/error */ -char *BarUiSelectMusicId (BarApp_t *app, char *similarToId) { +char *BarUiSelectMusicId (BarApp_t *app, char *similarToId, const char *msg) { char *musicId = NULL; char lineBuf[100], selectBuf[2]; PianoSearchResult_t searchResult; PianoArtist_t *tmpArtist; PianoSong_t *tmpSong; - BarUiMsg (MSG_QUESTION, "Search for artist/title: "); + BarUiMsg (MSG_QUESTION, msg); if (BarReadlineStr (lineBuf, sizeof (lineBuf), &app->input, BAR_RL_DEFAULT) > 0) { if (strcmp ("?", lineBuf) == 0 && similarToId != NULL) { diff --git a/src/ui.h b/src/ui.h index 4489c71..32f075a 100644 --- a/src/ui.h +++ b/src/ui.h @@ -42,7 +42,7 @@ PianoStation_t *BarUiSelectStation (PianoHandle_t *, const char *, PianoSong_t *BarUiSelectSong (const BarSettings_t *, PianoSong_t *, BarReadlineFds_t *); PianoArtist_t *BarUiSelectArtist (PianoArtist_t *, BarReadlineFds_t *); -char *BarUiSelectMusicId (BarApp_t *, char *); +char *BarUiSelectMusicId (BarApp_t *, char *, const char *); void BarStationFromGenre (BarApp_t *); void BarUiPrintStation (PianoStation_t *); void BarUiPrintSong (const BarSettings_t *, const PianoSong_t *, diff --git a/src/ui_act.c b/src/ui_act.c index 9a8f67b..3785f46 100644 --- a/src/ui_act.c +++ b/src/ui_act.c @@ -98,7 +98,8 @@ BarUiActCallback(BarUiActAddMusic) { assert (selStation != NULL); - reqData.musicId = BarUiSelectMusicId (app, app->playlist->musicId); + reqData.musicId = BarUiSelectMusicId (app, app->playlist->musicId, + "Add artist or title to station: "); if (reqData.musicId != NULL) { if (!BarTransformIfShared (app, selStation)) { return; @@ -146,7 +147,8 @@ BarUiActCallback(BarUiActCreateStation) { WaitressReturn_t wRet; PianoRequestDataCreateStation_t reqData; - reqData.id = BarUiSelectMusicId (app, NULL); + reqData.id = BarUiSelectMusicId (app, NULL, + "Create station from artist or title: "); if (reqData.id != NULL) { reqData.type = "mi"; BarUiMsg (MSG_INFO, "Creating station... "); -- cgit v1.2.3