notificate recover wallet
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletView.xaml
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletView.xaml
<Button Content="Recover" Command="{Binding RecoverCommand}" DockPanel.Dock="Right" />
<Grid></Grid>
</DockPanel>
- <TextBlock Text="{Binding ValidationMessage}" Classes="errorMessage" />
</StackPanel>
</UserControl>

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
@@ -9,6 +9,7 @@ using System.IO;
using System.Linq;
using System.Reactive;
using WalletWasabi.Blockchain.Keys;
+using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Gui.ViewModels.Validation;
using WalletWasabi.Helpers;
@@ -23,7 +24,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
private string _password;
private string _mnemonicWords;
private string _walletName;
- private string _validationMessage;
private bool _showAdvancedOptions;
private string _accountKeyPath;
private int _minGapLimit;
@@ -45,31 +45,31 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
if (string.IsNullOrWhiteSpace(WalletName))
{
- ValidationMessage = $"The name {WalletName} is not valid.";
+ NotificationHelpers.Error("Invalid wallet name.");
}
else if (File.Exists(walletFilePath))
{
- ValidationMessage = $"The name {WalletName} is already taken.";
+ NotificationHelpers.Error("Wallet name is already taken.");
}
else if (string.IsNullOrWhiteSpace(MnemonicWords))
{
- ValidationMessage = "Recovery Words were not supplied.";
+ NotificationHelpers.Error("Recovery Words were not supplied.");
}
else if (string.IsNullOrWhiteSpace(AccountKeyPath))
{
- ValidationMessage = "The account key path is not valid.";
+ NotificationHelpers.Error("The account key path is not valid.");
}
else if (MinGapLimit < KeyManager.AbsoluteMinGapLimit)
{
- ValidationMessage = $"Min Gap Limit cannot be smaller than {KeyManager.AbsoluteMinGapLimit}.";
+ NotificationHelpers.Error($"Min Gap Limit cannot be smaller than {KeyManager.AbsoluteMinGapLimit}.");
}
else if (MinGapLimit > 1_000_000)
{
- ValidationMessage = $"Min Gap Limit cannot be larger than {1_000_000}.";
+ NotificationHelpers.Error($"Min Gap Limit cannot be larger than {1_000_000}.");
}
else if (!KeyPath.TryParse(AccountKeyPath, out KeyPath keyPath))
{
- ValidationMessage = "The account key path is not a valid derivation path.";
+ NotificationHelpers.Error("The account key path is not a valid derivation path.");
}
else
{
@@ -78,11 +78,13 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
var mnemonic = new Mnemonic(MnemonicWords);
KeyManager.Recover(mnemonic, Password, walletFilePath, keyPath, MinGapLimit);
+ NotificationHelpers.Success("Wallet is successfully recovered!");
+
owner.SelectLoadWallet();
}
catch (Exception ex)
{
- ValidationMessage = ex.ToTypeMessageString();
+ NotificationHelpers.Error(ex.ToTypeMessageString());
Logger.LogError(ex);
}
}
@@ -120,12 +122,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
set => this.RaiseAndSetIfChanged(ref _walletName, value);
}
- public string ValidationMessage
- {
- get => _validationMessage;
- set => this.RaiseAndSetIfChanged(ref _validationMessage, value);
- }
-
public int CaretIndex
{
get => _caretIndex;
@@ -176,7 +172,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
WalletName = Global.GetNextWalletName();
- ValidationMessage = null;
ShowAdvancedOptions = false;
AccountKeyPath = $"m/{KeyManager.DefaultAccountKeyPath}";
MinGapLimit = KeyManager.AbsoluteMinGapLimit * 3;

notificate recover wallet