Add Advanced Wallet Info
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
</StackPanel>
</Button>
</TreeDataTemplate>
+
+ <TreeDataTemplate DataType="ViewModels:WalletInfoViewModel">
+ <Button BorderThickness="0" Background="Transparent" Command="{Binding DoItCommand}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left">
+ <StackPanel Orientation="Horizontal" Spacing="6">
+ <DrawingPresenter Width="20" Height="20">
+ <DrawingPresenter.Drawing>
+ <DrawingGroup>
+ <DrawingGroup.Children>
+ <GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
+ <GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M8,0C3.589,0 0,3.589 0,8 0,12.411 3.589,16 8,16 12.411,16 16,12.411 16,8 16,3.589 12.411,0 8,0" />
+ <GeometryDrawing Brush="#FFFFFFFF" Geometry="F1M14,8C14,11.309 11.309,14 8,14 4.691,14 2,11.309 2,8 2,4.691 4.691,2 8,2 11.309,2 14,4.691 14,8" />
+ <GeometryDrawing Brush="#FF1BA1E2" Geometry="F1M7,7.5L9,7.5 9,12 7,12z M7,4L9,4 9,5.5 7,5.5z M8,14C4.691,14 2,11.309 2,8 2,4.691 4.691,2 8,2 11.309,2 14,4.691 14,8 14,11.309 11.309,14 8,14 M8,1C4.14,1 1,4.14 1,8 1,11.859 4.14,15 8,15 11.859,15 15,11.859 15,8 15,4.14 11.859,1 8,1" />
+ </DrawingGroup.Children>
+ </DrawingGroup>
+ </DrawingPresenter.Drawing>
+ </DrawingPresenter>
+ <TextBlock Text="Advanced Info" Height="19" VerticalAlignment="Center" />
+ </StackPanel>
+ </Button>
+ </TreeDataTemplate>
</TreeView.DataTemplates>
</TreeView>
</Grid>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -9,6 +9,8 @@ using ReactiveUI;
using WalletWasabi.Gui.ViewModels;
using System.Linq;
using AvalonStudio.Shell;
+using WalletWasabi.Services;
+using System.IO;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -43,12 +45,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _selectedItem, value);
}
- internal void OpenWallet(string walletName, bool receiveDominant)
+ internal void OpenWallet(WalletService walletService, bool receiveDominant)
{
+ var walletName = Path.GetFileNameWithoutExtension(walletService.KeyManager.FilePath);
if (_wallets.Any(x => x.Title == walletName))
return;
- WalletViewModel walletViewModel = new WalletViewModel(walletName, receiveDominant);
+ WalletViewModel walletViewModel = new WalletViewModel(walletService, receiveDominant);
_wallets.Add(walletViewModel);
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
using System;
using System.Collections.ObjectModel;
using System.Composition;
+using System.IO;
using System.Linq;
using System.Reactive.Linq;
using AvalonStudio.Extensibility;
@@ -9,6 +10,7 @@ using NBitcoin;
using ReactiveUI;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Models;
+using WalletWasabi.Services;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -18,15 +20,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private string _title;
- public override string Title
- {
- get => _title;
- set => this.RaiseAndSetIfChanged(ref _title, value);
- }
-
- public WalletViewModel(string name, bool receiveDominant)
- : base(name)
+ public WalletViewModel(WalletService walletService, bool receiveDominant)
+ : base(Path.GetFileNameWithoutExtension(walletService.KeyManager.FilePath))
{
+ WalletService = walletService;
+ Name = Path.GetFileNameWithoutExtension(WalletService.KeyManager.FilePath);
var coinsChanged = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.CollectionChanged));
var coinSpent = Observable.FromEventPattern(Global.WalletService, nameof(Global.WalletService.CoinSpentOrSpenderConfirmed));
@@ -35,40 +33,45 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(o =>
{
- SetBalance(name);
+ SetBalance(Name);
});
- SetBalance(name);
+ SetBalance(Name);
- if (receiveDominant)
- {
- _actions = new ObservableCollection<WalletActionViewModel>
+ Actions = new ObservableCollection<WalletActionViewModel>
{
new SendTabViewModel(this),
+ new ReceiveTabViewModel(this),
new CoinJoinTabViewModel(this),
new HistoryTabViewModel(this),
- new ReceiveTabViewModel(this)
+ new WalletInfoViewModel(this)
};
- }
- else
- {
- _actions = new ObservableCollection<WalletActionViewModel>
+
+ Actions[0].DisplayActionTab();
+ if (receiveDominant)
{
- new SendTabViewModel(this),
- new ReceiveTabViewModel(this),
- new CoinJoinTabViewModel(this),
- new HistoryTabViewModel(this)
- };
+ Actions[2].DisplayActionTab();
+ Actions[3].DisplayActionTab();
+ Actions[1].DisplayActionTab();
}
-
- foreach (var vm in _actions)
+ else
{
- vm.DisplayActionTab();
+ Actions[1].DisplayActionTab();
+ Actions[2].DisplayActionTab();
+ Actions[3].DisplayActionTab();
}
}
public string Name { get; }
+ public WalletService WalletService { get; }
+
+ public override string Title
+ {
+ get => _title;
+ set => this.RaiseAndSetIfChanged(ref _title, value);
+ }
+
public ObservableCollection<WalletActionViewModel> Actions
{
get => _actions;
@@ -77,7 +80,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private void SetBalance(string walletName)
{
- Money balance = Enumerable.Where(Global.WalletService.Coins, c => c.Unspent).Sum(c => (long?)c.Amount) ?? 0;
+ Money balance = Enumerable.Where(WalletService.Coins, c => c.Unspent).Sum(c => (long?)c.Amount) ?? 0;
Title = $"{walletName} ({balance.ToString(false, true)} BTC)";
}
}

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -203,11 +203,11 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
if (Global.WalletService.Coins.Any())
{
// If already have coins then open with History tab first.
- IoC.Get<WalletExplorerViewModel>().OpenWallet(SelectedWallet, receiveDominant: false);
+ IoC.Get<WalletExplorerViewModel>().OpenWallet(Global.WalletService, receiveDominant: false);
}
else // Else open with Receive tab first.
{
- IoC.Get<WalletExplorerViewModel>().OpenWallet(SelectedWallet, receiveDominant: true);
+ IoC.Get<WalletExplorerViewModel>().OpenWallet(Global.WalletService, receiveDominant: true);
}
}
catch (Exception ex)

MODIFY
WalletWasabi/KeyManagement/KeyManager.cs
WalletWasabi/KeyManagement/KeyManager.cs
@@ -42,7 +42,7 @@ namespace WalletWasabi.KeyManagement
// BIP84-ish derivation scheme
// m / purpose' / coin_type' / account' / change / address_index
// https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki
- private static readonly KeyPath AccountKeyPath = new KeyPath("m/84'/0'/0'");
+ public static readonly KeyPath AccountKeyPath = new KeyPath("m/84'/0'/0'");
public string FilePath { get; private set; }
private object ToFileLock { get; }

Add Advanced Wallet Info