From 2a9274adba60b9d4f2895f5547aa88c432ac9349 Mon Sep 17 00:00:00 2001 From: jp1ac4 <121959000+jp1ac4@users.noreply.github.com> Date: Tue, 3 Oct 2023 22:02:10 +0100 Subject: [PATCH] gui: show more info on synchronisation screen --- gui/src/loader.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gui/src/loader.rs b/gui/src/loader.rs index b788314f..265f9154 100644 --- a/gui/src/loader.rs +++ b/gui/src/loader.rs @@ -31,6 +31,10 @@ use crate::{ daemon::{client, embedded::EmbeddedDaemon, model::*, Daemon, DaemonError}, }; +const SYNCING_PROGRESS_1: &str = "Bitcoin Core is synchronising the blockchain. A full synchronisation typically take a few days, and is resource intensive. Once the initial synchronisation is done, the next ones will be much faster."; +const SYNCING_PROGRESS_2: &str = "Bitcoin Core is synchronising the blockchain. This will take a while, depending on the last time it was done, your internet connection, and your computer performance."; +const SYNCING_PROGRESS_3: &str = "Bitcoin Core is synchronising the blockchain. This may take a few minutes, depending on the last time it was done, your internet connection, and your computer performance."; + type Lianad = client::Lianad; pub struct Loader { @@ -358,8 +362,16 @@ pub fn view(step: &Step) -> Element { None, Column::new() .width(Length::Fill) + .spacing(5) + .push(text(format!("Progress {:.2}%", 100.0 * *progress))) .push(ProgressBar::new(0.0..=1.0, *progress as f32).width(Length::Fill)) - .push(text("Syncing the wallet with the blockchain...")) + .push(text(if *progress > 0.98 { + SYNCING_PROGRESS_3 + } else if *progress > 0.9 { + SYNCING_PROGRESS_2 + } else { + SYNCING_PROGRESS_1 + })) .push(p2_regular(bitcoind_logs).style(color::GREY_3)), ), Step::Error(error) => cover(