Blame SOURCES/0002-throbgress-update-for-api-change.patch

b71634
From b9faf90fe5939fedfd710e1e8385f4d5c12e1df7 Mon Sep 17 00:00:00 2001
b71634
From: Ray Strode <rstrode@redhat.com>
b71634
Date: Mon, 15 Jun 2020 10:35:45 -0400
b71634
Subject: [PATCH 2/2] throbgress: update for api change
b71634
b71634
---
b71634
 src/plugins/splash/throbgress/plugin.c | 4 ++--
b71634
 1 file changed, 2 insertions(+), 2 deletions(-)
b71634
b71634
diff --git a/src/plugins/splash/throbgress/plugin.c b/src/plugins/splash/throbgress/plugin.c
b71634
index 86be064..68cca70 100644
b71634
--- a/src/plugins/splash/throbgress/plugin.c
b71634
+++ b/src/plugins/splash/throbgress/plugin.c
b71634
@@ -715,61 +715,61 @@ update_status (ply_boot_splash_plugin_t *plugin,
b71634
 }
b71634
 
b71634
 static void
b71634
 on_boot_progress (ply_boot_splash_plugin_t *plugin,
b71634
                   double                    duration,
b71634
                   double                    percent_done)
b71634
 {
b71634
         ply_list_node_t *node;
b71634
         double total_duration;
b71634
 
b71634
         if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES ||
b71634
             plugin->mode == PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE ||
b71634
             plugin->mode == PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE)
b71634
                 return;
b71634
 
b71634
         total_duration = duration / percent_done;
b71634
 
b71634
         /* Fun made-up smoothing function to make the growth asymptotic:
b71634
          * fraction(time,estimate)=1-2^(-(time^1.45)/estimate) */
b71634
         percent_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - percent_done);
b71634
 
b71634
         node = ply_list_get_first_node (plugin->views);
b71634
 
b71634
         while (node != NULL) {
b71634
                 ply_list_node_t *next_node;
b71634
                 view_t *view;
b71634
 
b71634
                 view = ply_list_node_get_data (node);
b71634
                 next_node = ply_list_get_next_node (plugin->views, node);
b71634
 
b71634
-                ply_progress_bar_set_percent_done (view->progress_bar, percent_done);
b71634
+                ply_progress_bar_set_fraction_done (view->progress_bar, percent_done);
b71634
 
b71634
                 node = next_node;
b71634
         }
b71634
 }
b71634
 
b71634
 static void
b71634
 hide_splash_screen (ply_boot_splash_plugin_t *plugin,
b71634
                     ply_event_loop_t         *loop)
b71634
 {
b71634
         assert (plugin != NULL);
b71634
 
b71634
         ply_trace ("hiding splash");
b71634
         if (plugin->loop != NULL) {
b71634
                 stop_animation (plugin, NULL);
b71634
 
b71634
                 ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
b71634
                                                        detach_from_event_loop,
b71634
                                                        plugin);
b71634
                 detach_from_event_loop (plugin);
b71634
         }
b71634
 
b71634
         plugin->is_visible = false;
b71634
 }
b71634
 
b71634
 static void
b71634
 show_password_prompt (ply_boot_splash_plugin_t *plugin,
b71634
                       const char               *text,
b71634
                       int                       number_of_bullets)
b71634
 {
b71634
         ply_list_node_t *node;
b71634
@@ -920,61 +920,61 @@ display_question (ply_boot_splash_plugin_t *plugin,
b71634
         show_prompt (plugin, prompt, entry_text);
b71634
         redraw_views (plugin);
b71634
         unpause_views (plugin);
b71634
 }
b71634
 
b71634
 static void
b71634
 display_message (ply_boot_splash_plugin_t *plugin,
b71634
                  const char               *message)
b71634
 {
b71634
         show_message (plugin, message);
b71634
 }
b71634
 
b71634
 static void
b71634
 system_update (ply_boot_splash_plugin_t *plugin,
b71634
                int                       progress)
b71634
 {
b71634
         ply_list_node_t *node;
b71634
 
b71634
         if (plugin->mode != PLY_BOOT_SPLASH_MODE_UPDATES &&
b71634
             plugin->mode != PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE &&
b71634
             plugin->mode != PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE)
b71634
                 return;
b71634
 
b71634
         node = ply_list_get_first_node (plugin->views);
b71634
         while (node != NULL) {
b71634
                 ply_list_node_t *next_node;
b71634
                 view_t *view;
b71634
 
b71634
                 view = ply_list_node_get_data (node);
b71634
                 next_node = ply_list_get_next_node (plugin->views, node);
b71634
-                ply_progress_bar_set_percent_done (view->progress_bar, (double) progress / 100.f);
b71634
+                ply_progress_bar_set_fraction_done (view->progress_bar, (double) progress / 100.f);
b71634
                 node = next_node;
b71634
         }
b71634
 }
b71634
 
b71634
 ply_boot_splash_plugin_interface_t *
b71634
 ply_boot_splash_plugin_get_interface (void)
b71634
 {
b71634
         static ply_boot_splash_plugin_interface_t plugin_interface =
b71634
         {
b71634
                 .create_plugin        = create_plugin,
b71634
                 .destroy_plugin       = destroy_plugin,
b71634
                 .add_pixel_display    = add_pixel_display,
b71634
                 .remove_pixel_display = remove_pixel_display,
b71634
                 .show_splash_screen   = show_splash_screen,
b71634
                 .update_status        = update_status,
b71634
                 .on_boot_progress     = on_boot_progress,
b71634
                 .hide_splash_screen   = hide_splash_screen,
b71634
                 .on_root_mounted      = on_root_mounted,
b71634
                 .become_idle          = become_idle,
b71634
                 .display_normal       = display_normal,
b71634
                 .display_password     = display_password,
b71634
                 .display_question     = display_question,
b71634
                 .display_message      = display_message,
b71634
                 .system_update        = system_update,
b71634
         };
b71634
 
b71634
         return &plugin_interface;
b71634
 }
b71634
 
b71634
 /* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */
b71634
-- 
b71634
2.21.0
b71634