gui: show more info on synchronisation screen
This commit is contained in:
parent
ab5afcf75a
commit
2a9274adba
@ -31,6 +31,10 @@ use crate::{
|
|||||||
daemon::{client, embedded::EmbeddedDaemon, model::*, Daemon, DaemonError},
|
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<client::jsonrpc::JsonRPCClient>;
|
type Lianad = client::Lianad<client::jsonrpc::JsonRPCClient>;
|
||||||
|
|
||||||
pub struct Loader {
|
pub struct Loader {
|
||||||
@ -358,8 +362,16 @@ pub fn view(step: &Step) -> Element<ViewMessage> {
|
|||||||
None,
|
None,
|
||||||
Column::new()
|
Column::new()
|
||||||
.width(Length::Fill)
|
.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(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)),
|
.push(p2_regular(bitcoind_logs).style(color::GREY_3)),
|
||||||
),
|
),
|
||||||
Step::Error(error) => cover(
|
Step::Error(error) => cover(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user