installer: add clipboard
This commit is contained in:
parent
c2ed30961c
commit
6500381059
@ -8,6 +8,7 @@ use crate::hw::HardwareWallet;
|
||||
pub enum Message {
|
||||
Event(iced_native::Event),
|
||||
Exit(PathBuf),
|
||||
Clibpboard(String),
|
||||
Next,
|
||||
Previous,
|
||||
Install,
|
||||
|
||||
@ -4,7 +4,7 @@ mod step;
|
||||
mod view;
|
||||
|
||||
use iced::pure::Element;
|
||||
use iced::{Command, Subscription};
|
||||
use iced::{clipboard, Command, Subscription};
|
||||
use iced_native::{window, Event};
|
||||
use minisafe::miniscript::bitcoin;
|
||||
|
||||
@ -74,6 +74,7 @@ impl Installer {
|
||||
|
||||
pub fn update(&mut self, message: Message) -> Command<Message> {
|
||||
match message {
|
||||
Message::Clibpboard(s) => clipboard::write(s),
|
||||
Message::Next => {
|
||||
let current_step = self
|
||||
.steps
|
||||
|
||||
@ -348,7 +348,7 @@ impl Step for RegisterDescriptor {
|
||||
};
|
||||
Command::none()
|
||||
}
|
||||
fn apply(&mut self, ctx: &mut Context) -> bool {
|
||||
fn apply(&mut self, _ctx: &mut Context) -> bool {
|
||||
true
|
||||
}
|
||||
fn load(&self) -> Command<Message> {
|
||||
|
||||
@ -169,7 +169,16 @@ pub fn register_descriptor<'a>(
|
||||
layout(
|
||||
column()
|
||||
.push(text("Register descriptor").bold().size(50))
|
||||
.push(text(descriptor).small())
|
||||
.push(
|
||||
column()
|
||||
.push(text(descriptor).small())
|
||||
.push(
|
||||
button::transparent_border(Some(icon::clipboard_icon()), "Copy")
|
||||
.on_press(Message::Clibpboard(descriptor.to_string())),
|
||||
)
|
||||
.spacing(10)
|
||||
.align_items(Alignment::Center),
|
||||
)
|
||||
.push_maybe(error.map(|e| card::error("Failed to import xpub", &e.to_string())))
|
||||
.push(if !hws.is_empty() {
|
||||
column()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user