Add some text to explain which keys to press

This commit is contained in:
Laurent Vivier 2007-08-31 23:11:04 +00:00
parent 18f005c3a0
commit 4b4778b1c0

View File

@ -282,6 +282,18 @@ int read_config(emile_l2_header_t* info,
#if defined(USE_CLI) && defined(__LINUX__) #if defined(USE_CLI) && defined(__LINUX__)
state = 0; state = 0;
#define MSG_STATE_0 console_set_cursor_position(5, 1); \
printf(" Press 'b' or [RETURN] to boot or 'e' to edit\n");
#define MSG_STATE_1 console_set_cursor_position(3, 1); \
printf(" Press 'b' to boot, 'e' or [RETURN] to edit \n" \
" Press 'd' to delete, 'n' to create \n" \
" Press [ESC] to go back \n");
#define MSG_CLEAN console_set_cursor_position(3, 1); \
printf(" \n" \
" \n" \
" \n");
MSG_STATE_0
while(state != -1) while(state != -1)
{ {
switch(state) switch(state)
@ -299,11 +311,13 @@ int read_config(emile_l2_header_t* info,
case 'b': case 'b':
case 'B': case 'B':
state = -1; state = -1;
MSG_CLEAN
break; break;
case 'e': case 'e':
case 'E': case 'E':
list.current = 0; list.current = 0;
state = 1; state = 1;
MSG_STATE_1
break; break;
} }
break; break;
@ -329,17 +343,22 @@ int read_config(emile_l2_header_t* info,
list.current = prop_nb[choice]; list.current = prop_nb[choice];
prop_nb[choice]++; prop_nb[choice]++;
state = 2; state = 2;
MSG_CLEAN
break; break;
case '\033': /* ESC */ case '\033': /* ESC */
list.current = choice; list.current = choice;
state = 0; state = 0;
MSG_CLEAN
MSG_STATE_0
break; break;
case 'b': case 'b':
case 'B': case 'B':
MSG_CLEAN
state = -1; state = -1;
break; break;
case '\r': case '\r':
case 'e': case 'e':
MSG_CLEAN
state = 2; state = 2;
break; break;
} }
@ -357,6 +376,7 @@ int read_config(emile_l2_header_t* info,
memset(property, ' ', strlen(property)); memset(property, ' ', strlen(property));
printf("%s", property); printf("%s", property);
state = 1; state = 1;
MSG_STATE_1
break; break;
} }
} }