gui: add subscription to Step trait

This commit is contained in:
jp1ac4 2023-08-25 18:50:19 +01:00
parent ae23fbc81d
commit d507d5760a
No known key found for this signature in database
GPG Key ID: A7ACD32423568D7B
2 changed files with 8 additions and 2 deletions

View File

@ -71,7 +71,10 @@ impl Installer {
}
pub fn subscription(&self) -> Subscription<Message> {
Subscription::none()
self.steps
.get(self.current)
.expect("There is always a step")
.subscription()
}
pub fn stop(&mut self) {

View File

@ -14,7 +14,7 @@ pub use mnemonic::{BackupMnemonic, RecoverMnemonic};
use std::path::PathBuf;
use iced::Command;
use iced::{Command, Subscription};
use liana::miniscript::bitcoin::bip32::Fingerprint;
use liana_ui::widget::*;
@ -25,6 +25,9 @@ pub trait Step {
fn update(&mut self, _message: Message) -> Command<Message> {
Command::none()
}
fn subscription(&self) -> Subscription<Message> {
Subscription::none()
}
fn view(&self, progress: (usize, usize)) -> Element<Message>;
fn load_context(&mut self, _ctx: &Context) {}
fn load(&self) -> Command<Message> {