From: Steve Langasek Date: Tue, 20 Apr 2010 11:02:24 +0000 (+0100) Subject: [main] Create a list of messages and when showing splash display them X-Git-Tag: 0.8.3~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5de9b303bb6df6b67cb63af6c38da6872089ccb9;p=thirdparty%2Fplymouth.git [main] Create a list of messages and when showing splash display them The system now keeps a list of messages so they can be shown again when the user flips themes or if the messages were passed before the splash was shown. This also enables the splashes to show multiple messages (should they choose to do so). There will later be a way of undisplaying a message. --- diff --git a/src/main.c b/src/main.c index 40fff0f5..0ae6500d 100644 --- a/src/main.c +++ b/src/main.c @@ -91,6 +91,7 @@ typedef struct ply_list_t *keystroke_triggers; ply_list_t *entry_triggers; ply_buffer_t *entry_buffer; + ply_list_t *messages; ply_command_parser_t *command_parser; ply_mode_t mode; ply_renderer_t *renderer; @@ -171,6 +172,23 @@ on_update (state_t *state, status); } +static void +show_messages (state_t *state) +{ + ply_list_node_t *node = ply_list_get_first_node (state->messages); + while (node != NULL) + { + ply_list_node_t *next_node; + char *message = ply_list_node_get_data (node); + + ply_trace ("displaying messages"); + + ply_boot_splash_display_message (state->boot_splash, message); + next_node = ply_list_get_next_node (state->messages, node); + node = next_node; + } +} + static void show_detailed_splash (state_t *state) { @@ -374,6 +392,7 @@ on_display_message (state_t *state, ply_trace ("displaying message %s", message); if (state->boot_splash != NULL) ply_boot_splash_display_message (state->boot_splash, message); + ply_list_append_data (state->messages, strdup(message)); } static void @@ -719,6 +738,7 @@ on_show_splash (state_t *state) show_detailed_splash (state); state->showing_details = true; } + show_messages (state); } static void @@ -1123,6 +1143,7 @@ toggle_between_splash_and_details (state_t *state) state->showing_details = false; } update_display (state); + show_messages (state); } static void @@ -1680,6 +1701,7 @@ initialize_environment (state_t *state) state->entry_buffer = ply_buffer_new(); state->pixel_displays = ply_list_new (); state->text_displays = ply_list_new (); + state->messages = ply_list_new (); state->keyboard = NULL; if (!state->default_tty)