plymouth/SOURCES/0002-throbgress-update-for-...

143 lines
5.1 KiB
Diff

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