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

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