Rename Transaction Builder
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -58,9 +58,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private bool _isHardwareBusy;
private string _warningMessage;
private string _successMessage;
- private const string BuildTransactionButtonTextString = "Send Transaction";
+ private const string SendTransactionButtonTextString = "Send Transaction";
private const string WaitingForHardwareWalletButtonTextString = "Waiting for Hardware Wallet...";
- private const string BuildingTransactionButtonTextString = "Sending Transaction...";
+ private const string SendingTransactionButtonTextString = "Sending Transaction...";
+ private const string BuildTransactionButtonTextString = "Build Transaction";
+ private const string BuildingTransactionButtonTextString = "Building Transaction...";
+
private int _caretIndex;
private ObservableCollection<SuggestionViewModel> _suggestions;
private FeeDisplayFormat _feeDisplayFormat;
@@ -77,20 +80,21 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
}
- public SendTabViewModel(WalletViewModel walletViewModel)
- : base("Send", walletViewModel)
+ public SendTabViewModel(WalletViewModel walletViewModel, bool isTransactionBuilder = false)
+ : base(isTransactionBuilder ? "Transaction Builder" : "Send", walletViewModel)
{
_suggestions = new ObservableCollection<SuggestionViewModel>();
Label = "";
AllSelectedAmount = Money.Zero;
UsdExchangeRate = Global.Synchronizer.UsdExchangeRate;
+ IsTransactionBuilder = isTransactionBuilder;
SetAmountWatermarkAndToolTip(Money.Zero);
CoinList = new CoinListViewModel();
Observable.FromEventPattern(CoinList, nameof(CoinList.SelectionChanged)).Subscribe(_ => SetFeesAndTexts());
Observable.FromEventPattern(CoinList, nameof(CoinList.DequeueCoinsPressed)).Subscribe(_ => OnCoinsListDequeueCoinsPressedAsync());
- BuildTransactionButtonText = BuildTransactionButtonTextString;
+ BuildTransactionButtonText = IsTransactionBuilder ? BuildTransactionButtonTextString : SendTransactionButtonTextString;
ResetMax();
SetFeeTargetLimits();
@@ -275,15 +279,17 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
if (!IsWatchOnly)
result = await Task.Run(() => Global.WalletService.BuildTransaction(Password, new[] { operation }, FeeTarget, allowUnconfirmed: true, allowedInputs: selectedCoinReferences));
- if (IsWatchOnly)
+ if (IsTransactionBuilder)
{
// Generate the PSBT
- IoC.Get<IShell>().AddOrSelectDocument(() => new TransactionBuilderViewModel(null));
-
- var txviewer = IoC.Get<IShell>().Documents.OfType<TransactionBuilderViewModel>().FirstOrDefault();
+ var txviewer = IoC.Get<IShell>().Documents.OfType<TransactionViewerViewModel>().FirstOrDefault();
if (txviewer is null)
- throw new InvalidOperationException("Just added ViewModel and it is missing.");
+ {
+ txviewer = new TransactionViewerViewModel(null);
+ IoC.Get<IShell>().AddDocument(txviewer);
+ }
+ IoC.Get<IShell>().Select(txviewer);
// Generate Test PSBT.
PSBT psbt = PSBT.Parse("70736274ff01009a020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c8757924f545887bb2abdd750000000000ffffffff838d0427d0ec650a68aa46bb0b098aea4422c071b2ca78352a077959d07cea1d0100000000ffffffff0270aaf00800000000160014d85c2b71d0060b09c9886aeb815e50991dda124d00e1f5050000000016001400aea9a2e5f0f876a588df5546e8742d1d87008f00000000000100bb0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f6187650000000104475221029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f2102dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d752ae2206029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f10d90c6a4f000000800000008000000080220602dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d710d90c6a4f0000008000000080010000800001012000c2eb0b0000000017a914b7f5faf40e3d40a5a459b1db3535f2b72fa921e88701042200208c2353173743b595dfb4a07b72ba8e42e3797da74e87fe7d9d7497e3b2028903010547522103089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc21023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7352ae2206023add904f3d6dcf59ddb906b0dee23529b7ffb9ed50e5e86151926860221f0e7310d90c6a4f000000800000008003000080220603089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc10d90c6a4f00000080000000800200008000220203a9a4c37f5996d3aa25dbac6b570af0650394492942460b354753ed9eeca5877110d90c6a4f000000800000008004000080002202027f6399757d2eff55a136ad02c684b1838b6556e5f1b6b34282a94b6b5005109610d90c6a4f00000080000000800500008000", Network.Main);
@@ -379,17 +385,23 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private void SetSendText()
{
+ if (IsTransactionBuilder)
+ {
+ BuildTransactionButtonText = IsBusy ? BuildingTransactionButtonTextString : BuildTransactionButtonTextString;
+ return;
+ }
+
if (IsHardwareBusy)
{
BuildTransactionButtonText = WaitingForHardwareWalletButtonTextString;
}
else if (IsBusy)
{
- BuildTransactionButtonText = BuildingTransactionButtonTextString;
+ BuildTransactionButtonText = SendingTransactionButtonTextString;
}
else
{
- BuildTransactionButtonText = BuildTransactionButtonTextString;
+ BuildTransactionButtonText = SendTransactionButtonTextString;
}
}
@@ -972,6 +984,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public ReactiveCommand<Unit, Unit> MaxCommand { get; }
public ReactiveCommand<Unit, Unit> FeeRateCommand { get; }
+ public bool IsTransactionBuilder { get; }
public override void OnOpen()
{

RENAME
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBuilderView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerView.xaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui"
- xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:iac="clr-namespace:Avalonia.Xaml.Interactions.Custom;assembly=Avalonia.Xaml.Interactions.Custom"
xmlns:converters="clr-namespace:WalletWasabi.Gui.Converters;assembly=WalletWasabi.Gui"
- xmlns:behaviors="clr-namespace:WalletWasabi.Gui.Behaviors;assembly=WalletWasabi.Gui"
xmlns:local="clr-namespace:WalletWasabi.Gui.Controls.WalletExplorer;assembly=WalletWasabi.Gui"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450">
<controls:GroupBox Title="{Binding Title}" TextBlock.FontSize="30" Padding="20" Margin="10">

RENAME
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBuilderView.xaml.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerView.xaml.cs
@@ -4,9 +4,9 @@ using Avalonia.Markup.Xaml;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
- public class TransactionBuilderView : UserControl
+ public class TransactionViewerView : UserControl
{
- public TransactionBuilderView()
+ public TransactionViewerView()
{
InitializeComponent();
}

RENAME
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBuilderViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
@@ -10,7 +10,7 @@ using WalletWasabi.Models;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
- public class TransactionBuilderViewModel : WalletActionViewModel
+ public class TransactionViewerViewModel : WalletActionViewModel
{
private string _errorMessage;
private string _successMessage;
@@ -50,7 +50,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _successMessage, value);
}
- public TransactionBuilderViewModel(WalletViewModel walletViewModel) : base("Transaction Builder", walletViewModel)
+ public TransactionViewerViewModel(WalletViewModel walletViewModel) : base("Transaction", walletViewModel)
{
}
@@ -63,7 +63,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
if (Disposables != null)
{
- throw new Exception("Transaction Builder was opened before it was closed.");
+ throw new Exception("Transaction Viewer was opened before it was closed.");
}
Disposables = new CompositeDisposable();

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
</Button>
</TreeDataTemplate>
- <TreeDataTemplate DataType="ViewModels:TransactionBuilderViewModel">
+ <TreeDataTemplate DataType="ViewModels:TransactionViewerViewModel">
<Button BorderThickness="0" Background="Transparent" Command="{Binding DoItCommand}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal" Spacing="6">
<DrawingPresenter Width="20" Height="20">
</DrawingGroup>
</DrawingPresenter.Drawing>
</DrawingPresenter>
- <TextBlock Text="Advanced: Transaction Builder" Height="19" VerticalAlignment="Center" />
+ <TextBlock Text="Advanced: Transaction" Height="19" VerticalAlignment="Center" />
</StackPanel>
</Button>
</TreeDataTemplate>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -31,20 +31,15 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Actions = new ObservableCollection<WalletActionViewModel>
{
- // Send will be added later.
+ new SendTabViewModel(this, walletService.KeyManager.IsWatchOnly),
new ReceiveTabViewModel(this),
new CoinJoinTabViewModel(this),
new HistoryTabViewModel(this),
new WalletInfoViewModel(this),
- new TransactionBuilderViewModel(this),
+ new TransactionViewerViewModel(this),
new TransactionBroadcasterViewModel(this),
};
- //if (!walletService.KeyManager.IsWatchOnly)
- {
- Actions.Insert(0, new SendTabViewModel(this));
- }
-
Actions[0].DisplayActionTab();
if (receiveDominant)
{

MODIFY
WalletWasabi.Gui/WalletWasabi.Gui.csproj
WalletWasabi.Gui/WalletWasabi.Gui.csproj
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
</ItemGroup>
+ <ItemGroup>
+ <Compile Update="Controls\WalletExplorer\TransactionViewerView.xaml.cs">
+ <DependentUpon>TransactionViewerView.xaml</DependentUpon>
+ </Compile>
+ </ItemGroup>
+
</Project>

Rename Transaction Builder