]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
two-step: Add a per mode setting to suppress messages
authorHans de Goede <hdegoede@redhat.com>
Tue, 12 Feb 2019 14:15:26 +0000 (15:15 +0100)
committerHans de Goede <hdegoede@redhat.com>
Sat, 23 Feb 2019 13:56:54 +0000 (14:56 +0100)
The messages passed to plymouth display-message can be quite verbose, esp.
in the offline-updates case. Combined with some themes now showing their
own prominent title message explaining what is going on this leads to
undesirable repetitive text being shown.

This commit adds support for a per mode SuppressMessages setting which
allows themes to suppress messages passed to plymouth display-message
on a per mode basis.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/plugins/splash/two-step/plugin.c

index 32e4294080092bd4e3bd8736e3cb5c415ac8922e..9b6abba39339e82c21fb155258e028ccbd33337c 100644 (file)
@@ -106,6 +106,7 @@ typedef struct
 
 typedef struct
 {
+        bool                      suppress_messages;
         bool                      use_progress_bar;
         bool                      use_firmware_background;
         char                     *title;
@@ -820,6 +821,8 @@ load_mode_settings (ply_boot_splash_plugin_t *plugin,
 {
         mode_settings_t *settings = &plugin->mode_settings[mode];
 
+        settings->suppress_messages =
+                ply_key_file_get_bool (key_file, group_name, "SuppressMessages");
         settings->use_progress_bar =
                 ply_key_file_get_bool (key_file, group_name, "UseProgressBar");
         settings->use_firmware_background =
@@ -1758,6 +1761,10 @@ static void
 show_message (ply_boot_splash_plugin_t *plugin,
               const char               *message)
 {
+        if (plugin->mode_settings[plugin->mode].suppress_messages) {
+                ply_trace ("Suppressing message '%s'", message);
+                return;
+        }
         ply_trace ("Showing message '%s'", message);
         ply_list_node_t *node;
         node = ply_list_get_first_node (plugin->views);