installer: minor UI fixes
This commit is contained in:
parent
2291138fb6
commit
cac7bce60a
@ -104,15 +104,15 @@ impl ExportModal {
|
||||
}
|
||||
Progress::Finished | Progress::Ended => self.state = ImportExportState::Ended,
|
||||
Progress::KeyAliasesConflict(ref sender) => {
|
||||
if let ImportExportType::ImportBackup(_, aliases) = &self.import_export_type {
|
||||
if let ImportExportType::ImportBackup(_, None) = &self.import_export_type {
|
||||
self.import_export_type =
|
||||
ImportExportType::ImportBackup(Some(sender.clone()), aliases.clone());
|
||||
ImportExportType::ImportBackup(None, Some(sender.clone()));
|
||||
}
|
||||
}
|
||||
Progress::LabelsConflict(ref sender) => {
|
||||
if let ImportExportType::ImportBackup(labels, _) = &self.import_export_type {
|
||||
if let ImportExportType::ImportBackup(None, _) = &self.import_export_type {
|
||||
self.import_export_type =
|
||||
ImportExportType::ImportBackup(labels.clone(), Some(sender.clone()));
|
||||
ImportExportType::ImportBackup(Some(sender.clone()), None);
|
||||
}
|
||||
}
|
||||
Progress::Error(e) => {
|
||||
|
||||
@ -92,7 +92,7 @@ pub fn export_modal<'a, Message: From<ImportExportMessage> + Clone + 'a>(
|
||||
.width(Length::Fill)
|
||||
});
|
||||
|
||||
let p = match state {
|
||||
let mut p = match state {
|
||||
ImportExportState::Init => 0.0,
|
||||
ImportExportState::ChoosePath | ImportExportState::Path(_) | ImportExportState::Started => {
|
||||
5.0
|
||||
@ -103,6 +103,10 @@ pub fn export_modal<'a, Message: From<ImportExportMessage> + Clone + 'a>(
|
||||
| ImportExportState::Ended
|
||||
| ImportExportState::Closed => 100.0,
|
||||
};
|
||||
// keep progress bar visible
|
||||
if p == 0.0 {
|
||||
p += 2.5;
|
||||
}
|
||||
let progress_bar_row = Row::new()
|
||||
.push(Space::with_width(30))
|
||||
.push(progress_bar(0.0..=100.0, p))
|
||||
@ -120,6 +124,6 @@ pub fn export_modal<'a, Message: From<ImportExportMessage> + Clone + 'a>(
|
||||
.push(Space::with_height(5)),
|
||||
)
|
||||
.width(Length::Fixed(500.0))
|
||||
.height(Length::Fixed(220.0))
|
||||
.height(Length::Fixed(250.0))
|
||||
.into()
|
||||
}
|
||||
|
||||
@ -167,35 +167,35 @@ pub fn import_export<'a>(cache: &'a Cache, warning: Option<&Error>) -> Element<'
|
||||
let export_descriptor = settings_section(
|
||||
"Export descriptor",
|
||||
None,
|
||||
icon::wallet_icon(),
|
||||
icon::backup_icon(),
|
||||
Message::Settings(SettingsMessage::ExportDescriptor),
|
||||
);
|
||||
|
||||
let export_transactions = settings_section(
|
||||
"Export transactions",
|
||||
None,
|
||||
icon::wallet_icon(),
|
||||
icon::backup_icon(),
|
||||
Message::Settings(SettingsMessage::ExportTransactions),
|
||||
);
|
||||
|
||||
let export_labels = settings_section(
|
||||
"Export labels",
|
||||
None,
|
||||
icon::wallet_icon(),
|
||||
icon::backup_icon(),
|
||||
Message::Settings(SettingsMessage::ExportLabels),
|
||||
);
|
||||
|
||||
let export_wallet = settings_section(
|
||||
"Back Up Wallet",
|
||||
None,
|
||||
icon::wallet_icon(),
|
||||
icon::backup_icon(),
|
||||
Message::Settings(SettingsMessage::ExportWallet),
|
||||
);
|
||||
|
||||
let import_wallet = settings_section(
|
||||
"Restore wallet",
|
||||
None,
|
||||
icon::wallet_icon(),
|
||||
icon::restore_icon(),
|
||||
Message::Settings(SettingsMessage::ImportWallet),
|
||||
);
|
||||
|
||||
@ -920,12 +920,12 @@ pub fn wallet_settings<'a>(
|
||||
|
||||
let import_export = Row::new()
|
||||
.push(
|
||||
button::secondary(Some(icon::wallet_icon()), "Backup")
|
||||
button::secondary(Some(icon::backup_icon()), "Backup")
|
||||
.on_press(Message::Settings(SettingsMessage::ExportWallet)),
|
||||
)
|
||||
.push(Space::with_width(10))
|
||||
.push(
|
||||
button::secondary(Some(icon::wallet_icon()), "Restore")
|
||||
button::secondary(Some(icon::restore_icon()), "Restore")
|
||||
.on_press(Message::Settings(SettingsMessage::ImportWallet)),
|
||||
)
|
||||
.push(Space::with_width(Length::Fill));
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
pub const BACKUP_DESCRIPTOR_MESSAGE: &str = "The descriptor is necessary to recover your funds. The backup of your key (via mnemonics, sometimes called 'seed words') is not enough. Please make sure you have backed up both your private key and your descriptor.";
|
||||
pub const BACKUP_DESCRIPTOR_HELP: &str = "In Bitcoin, the coins are locked using a Script (related to the 'address'). In order to recover your funds you need to know both the Scripts you have participated in (your 'addresses'), and be able to sign a transaction that spends from those. For the ability to sign, you back up your private key, this is your mnemonic ('seed words'). For finding the coins that belong to you, you back up a template of your Script (your 'addresses'), this is your descriptor. However, note the descriptor need not be stored as securely as the private key. A thief who steals your descriptor but not your private key cannot steal your funds.";
|
||||
pub const BACKUP_DESCRIPTOR_MESSAGE: &str = "A backup of your wallet configuration is necessary to recover your funds. Please make sure to store your Wallet backup file (or alternatively to copy and paste the descriptor string) in one or more secure and accessible locations. You still need to back up your seed phrases too, since they are not included in the file.";
|
||||
pub const BACKUP_DESCRIPTOR_HELP: &str = "In Bitcoin, the coins are locked using a Script (related to the 'address'). In order to recover your funds you need to know both the Scripts you have participated in (your 'addresses'), and be able to sign a transaction that spends from those. For the ability to sign, you back up your private key, this is your mnemonic ('seed words'). For finding the coins that belong to you, you back up a template of your Script (your 'addresses'), this is your descriptor, included in your wallet backup file. However, note the descriptor need not be stored as securely as the private key. A thief who steals your descriptor but not your private key cannot steal your funds.";
|
||||
pub const DEFINE_DESCRIPTOR_FINGERPRINT_TOOLTIP: &str =
|
||||
"The alias is applied on all the keys derived from the same seed";
|
||||
pub const REGISTER_DESCRIPTOR_HELP: &str = "To be used with the wallet, a signing device needs the descriptor. If the descriptor contains one or more keys imported from an external signing device, the descriptor must be registered on it. Registration confirms that the device is able to handle the policy. Registration on a device is not a substitute for backing up the descriptor.";
|
||||
|
||||
@ -740,10 +740,17 @@ pub fn backup_descriptor<'a>(
|
||||
error: Option<&Error>,
|
||||
done: bool,
|
||||
) -> Element<'a, Message> {
|
||||
let backup_button = if done {
|
||||
button::secondary(Some(icon::backup_icon()), "Back Up Wallet")
|
||||
.on_press(Message::BackupWallet)
|
||||
} else {
|
||||
button::primary(Some(icon::backup_icon()), "Back Up Wallet").on_press(Message::BackupWallet)
|
||||
};
|
||||
|
||||
layout(
|
||||
progress,
|
||||
email,
|
||||
"Backup your wallet descriptor",
|
||||
"Back Up your wallet",
|
||||
Column::new()
|
||||
.push(
|
||||
Column::new()
|
||||
@ -793,10 +800,7 @@ pub fn backup_descriptor<'a>(
|
||||
.push(
|
||||
Row::new()
|
||||
.push(Space::with_width(Length::Fill))
|
||||
.push(
|
||||
button::secondary(Some(icon::wallet_icon()), "Backup")
|
||||
.on_press(Message::BackupWallet),
|
||||
)
|
||||
.push(backup_button)
|
||||
.push(Space::with_width(10))
|
||||
.push(
|
||||
button::secondary(Some(icon::clipboard_icon()), "Copy")
|
||||
@ -813,10 +817,11 @@ pub fn backup_descriptor<'a>(
|
||||
.max_width(1500),
|
||||
)
|
||||
.push(
|
||||
checkbox("I have backed up my descriptor", done).on_toggle(Message::UserActionDone),
|
||||
checkbox("I have backed up my wallet/descriptor", done)
|
||||
.on_toggle(Message::UserActionDone),
|
||||
)
|
||||
.push(if done {
|
||||
button::secondary(None, "Next")
|
||||
button::primary(None, "Next")
|
||||
.on_press(Message::Next)
|
||||
.width(Length::Fixed(200.0))
|
||||
} else {
|
||||
|
||||
@ -123,6 +123,14 @@ pub fn round_key_icon() -> Text<'static> {
|
||||
bootstrap_icon('\u{F44E}')
|
||||
}
|
||||
|
||||
pub fn backup_icon() -> Text<'static> {
|
||||
bootstrap_icon('\u{F356}')
|
||||
}
|
||||
|
||||
pub fn restore_icon() -> Text<'static> {
|
||||
bootstrap_icon('\u{F358}')
|
||||
}
|
||||
|
||||
const ICONEX_ICONS: Font = Font::with_name("Untitled1");
|
||||
|
||||
fn iconex_icon(unicode: char) -> Text<'static> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user