Enumerate connected hardware wallets
MODIFY
WalletWasabi.Gui/MainWindow.xaml.cs
WalletWasabi.Gui/MainWindow.xaml.cs
@@ -16,6 +16,7 @@ using System.Threading.Tasks;
using WalletWasabi.Gui.Dialogs;
using WalletWasabi.Gui.Tabs.WalletManager;
using WalletWasabi.Gui.ViewModels;
+using WalletWasabi.Hwi;
namespace WalletWasabi.Gui
{
@@ -158,7 +159,7 @@ namespace WalletWasabi.Gui
{
MainWindowViewModel.Instance.WindowState = WindowState.Maximized;
}
- DisplayWalletManager();
+ await DisplayWalletManagerAsync();
}
catch (Exception ex)
{
@@ -166,14 +167,22 @@ namespace WalletWasabi.Gui
}
}
- private void DisplayWalletManager()
+ private async Task DisplayWalletManagerAsync()
{
- var isAnyWalletAvailable = Directory.Exists(Global.WalletsDir) && Directory.EnumerateFiles(Global.WalletsDir).Any();
-
var walletManagerViewModel = new WalletManagerViewModel();
IoC.Get<IShell>().AddDocument(walletManagerViewModel);
- if (isAnyWalletAvailable)
+ var res = await HwiProcessManager.EnumerateAsync();
+ var isAnyHardwareWalletAvailable = res.Any();
+ if (isAnyHardwareWalletAvailable)
+ {
+ walletManagerViewModel.SelectHardwareWallet();
+ }
+ else
+ {
+ var isAnyDesktopWalletAvailable = Directory.Exists(Global.WalletsDir) && Directory.EnumerateFiles(Global.WalletsDir).Any();
+
+ if (isAnyDesktopWalletAvailable)
{
walletManagerViewModel.SelectLoadWallet();
}
@@ -184,3 +193,4 @@ namespace WalletWasabi.Gui
}
}
}
+}

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletView.xaml
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletView.xaml
xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui">
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Bottom" Spacing="10">
- <controls:GroupBox IsVisible="{Binding RequirePassword}" TextBlock.FontSize="30" Padding="30" Margin="20 0">
+ <controls:GroupBox IsVisible="{Binding !IsDesktopWallet}" TextBlock.FontSize="30" Padding="30" Margin="20 0">
<Grid Classes="content">
- <StackPanel Spacing="8">
+ <StackPanel IsVisible="{Binding IsPasswordRequired}" Spacing="8">
<StackPanel>
<TextBlock Text="Select a wallet to test its password!" FontWeight="Bold" />
</StackPanel>
<TextBlock Text="We received numerous reports on losing or mistyping passwords. This experiment aims to disrupt users' typical workflow at wallet generation, forcing them to pay more attention than otherwise would." TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
+ <StackPanel IsVisible="{Binding IsHardwareWallet}" Spacing="8">
+ <StackPanel>
+ <TextBlock Text="Hardware Wallets + CoinJoins?" FontWeight="Bold" />
+ <TextBlock Text="Currently all hardware wallets on the market are incompatible with coinjoins." />
+ </StackPanel>
+ <StackPanel>
+ <TextBlock Text="Which hardware wallets are supported by Wasabi?" FontWeight="Bold" />
+ <TextBlock Text="- ColdCard" TextWrapping="Wrap" />
+ </StackPanel>
+ </StackPanel>
</Grid>
</controls:GroupBox>
<StackPanel DockPanel.Dock="Bottom" Margin="20 10">
<DockPanel LastChildFill="True">
- <Button IsVisible="{Binding RequirePassword}" Content="Test Password" Command="{Binding TestPasswordCommand}" DockPanel.Dock="Right" Margin="10 0 0 0" />
+ <Button IsVisible="{Binding IsPasswordRequired}" Content="Test Password" Command="{Binding TestPasswordCommand}" DockPanel.Dock="Right" Margin="10 0 0 0" />
<Button Command="{Binding LoadCommand}" DockPanel.Dock="Right">
<StackPanel Orientation="Horizontal">
<controls:Spinner Height="20" Width="20" IsVisible="{Binding IsBusy}" Margin="0 0 8 0" />
<TextBlock Text="{Binding LoadButtonText}" />
</StackPanel>
</Button>
- <Button IsVisible="{Binding !RequirePassword}" Command="{Binding OpenFolderCommand}" DockPanel.Dock="Right" Margin="0 0 10 0">
+ <Button IsVisible="{Binding IsDesktopWallet}" Command="{Binding OpenFolderCommand}" DockPanel.Dock="Right" Margin="0 0 10 0">
<StackPanel Orientation="Horizontal" Spacing="8">
<DrawingPresenter Width="28">
<DrawingPresenter.Drawing>

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/WalletManagerViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/WalletManagerViewModel.cs
@@ -18,8 +18,9 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
{
new GenerateWalletViewModel(this),
new RecoverWalletViewModel(this),
- new LoadWalletViewModel(this, false),
- new LoadWalletViewModel(this, true)
+ new LoadWalletViewModel(this, LoadWalletType.Desktop),
+ new LoadWalletViewModel(this, LoadWalletType.Password),
+ new LoadWalletViewModel(this, LoadWalletType.Hardware)
};
SelectedCategory = Categories.FirstOrDefault();
@@ -56,12 +57,17 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
public void SelectLoadWallet()
{
- SelectedCategory = Categories.First(x => x is LoadWalletViewModel && !((LoadWalletViewModel)x).RequirePassword);
+ SelectedCategory = Categories.First(x => x is LoadWalletViewModel && (((LoadWalletViewModel)x).LoadWalletType == LoadWalletType.Desktop));
}
public void SelectTestPassword()
{
- SelectedCategory = Categories.First(x => x is LoadWalletViewModel && ((LoadWalletViewModel)x).RequirePassword);
+ SelectedCategory = Categories.First(x => x is LoadWalletViewModel && (((LoadWalletViewModel)x).LoadWalletType == LoadWalletType.Password));
+ }
+
+ public void SelectHardwareWallet()
+ {
+ SelectedCategory = Categories.First(x => x is LoadWalletViewModel && (((LoadWalletViewModel)x).LoadWalletType == LoadWalletType.Hardware));
}
public ViewModelBase CurrentView

Enumerate connected hardware wallets