summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-03-09 10:13:01 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-03-09 10:13:01 +0100
commit9d753bf7f9ee0e2b56be5b13b7e6f26f11938235 (patch)
treeaaa580f6b010d88ab1f03ac03a488b3af956f317
parent0c6860fdf282e871a11f7a859e672231455dd94c (diff)
downloadpianobar-9d753bf7f9ee0e2b56be5b13b7e6f26f11938235.tar.gz
pianobar-9d753bf7f9ee0e2b56be5b13b7e6f26f11938235.tar.bz2
pianobar-9d753bf7f9ee0e2b56be5b13b7e6f26f11938235.zip
Use icon for questions too
-rw-r--r--src/main.c6
-rw-r--r--src/ui.c10
-rw-r--r--src/ui_act.c8
3 files changed, 15 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index d7589ed..c1d904b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -80,11 +80,13 @@ int main (int argc, char **argv) {
BarSettingsRead (&settings);
if (settings.username == NULL) {
- settings.username = readline ("Username: ");
+ BarUiMsg (MSG_QUESTION, "Username: ");
+ settings.username = readline (NULL);
}
if (settings.password == NULL) {
BarTermSetEcho (0);
- settings.password = readline ("Password: ");
+ BarUiMsg (MSG_QUESTION, "Password: ");
+ settings.password = readline (NULL);
BarTermSetEcho (1);
BarUiMsg (MSG_NONE, "\n");
}
diff --git a/src/ui.c b/src/ui.c
index 6c82606..2b03edb 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -108,7 +108,8 @@ char BarReadlineInt (const char *prompt, int *retVal) {
char *buf;
char ret = 0;
- if ((buf = readline (prompt)) != NULL && strlen (buf) > 0 &&
+ BarUiMsg (MSG_QUESTION, prompt);
+ if ((buf = readline (NULL)) != NULL && strlen (buf) > 0 &&
BarIsNumericStr (buf)) {
*retVal = atoi (buf);
ret = 1;
@@ -272,7 +273,8 @@ char *BarUiSelectMusicId (const PianoHandle_t *ph) {
PianoArtist_t *tmpArtist;
PianoSong_t *tmpSong;
- lineBuf = readline ("Search for artist/title: ");
+ BarUiMsg (MSG_QUESTION, "Search for artist/title: ");
+ lineBuf = readline (NULL);
if (lineBuf != NULL && strlen (lineBuf) > 0) {
BarUiMsg (MSG_INFO, "Searching... ");
if (BarUiPrintPianoStatus (PianoSearchMusic (ph, lineBuf,
@@ -283,8 +285,8 @@ char *BarUiSelectMusicId (const PianoHandle_t *ph) {
BarUiMsg (MSG_NONE, "\r");
if (searchResult.songs != NULL && searchResult.artists != NULL) {
/* songs and artists found */
- BarUiMsg (MSG_QUESTION,
- "Is this an [a]rtist or [t]rack name? Press c to abort.\n");
+ BarUiMsg (MSG_QUESTION, "Is this an [a]rtist or [t]rack name? "
+ "Press c to abort. ");
read (fileno (stdin), &yesnoBuf, sizeof (yesnoBuf));
if (yesnoBuf == 'a') {
tmpArtist = BarUiSelectArtist (searchResult.artists);
diff --git a/src/ui_act.c b/src/ui_act.c
index 9e227c1..2a2e041 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -132,7 +132,8 @@ void BarUiActCreateStation (BAR_KS_ARGS) {
void BarUiActAddSharedStation (BAR_KS_ARGS) {
char *stationId = NULL;
- if ((stationId = readline ("Station id: ")) != NULL &&
+ BarUiMsg (MSG_QUESTION, "Station id: ");
+ if ((stationId = readline (NULL)) != NULL &&
strlen (stationId) > 0) {
BarUiMsg (MSG_INFO, "Adding shared station... ");
BarUiPrintPianoStatus (PianoCreateStation (ph, "sh", stationId));
@@ -147,7 +148,7 @@ void BarUiActDeleteStation (BAR_KS_ARGS) {
RETURN_IF_NO_STATION;
- BarUiMsg (MSG_QUESTION, "Really delete \"%s\"? [yn] ",
+ BarUiMsg (MSG_QUESTION, "Really delete \"%s\"? [yN] ",
(*curStation)->name);
read (fileno (stdin), &yesNoBuf, sizeof (yesNoBuf));
BarUiMsg (MSG_NONE, "\n");
@@ -283,7 +284,8 @@ void BarUiActRenameStation (BAR_KS_ARGS) {
RETURN_IF_NO_STATION;
- lineBuf = readline ("New name: ");
+ BarUiMsg (MSG_QUESTION, "New name: ");
+ lineBuf = readline (NULL);
if (lineBuf != NULL && strlen (lineBuf) > 0) {
if (!BarTransformIfShared (ph, *curStation)) {
return;