Remove autocopy, add txid context menu copy
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabView.xaml
<controls:SortingArrow Grid.Column="3" Command="{Binding SortCommand}" Text="Transaction ID" SortDirection="{Binding TransactionSortDirection}" />
</Grid>
<controls:ExtendedListBox Items="{Binding Transactions}" SelectedItem="{Binding SelectedTransaction, Mode=TwoWay}">
+ <controls:ExtendedListBox.ContextMenu>
+ <ContextMenu>
+ <MenuItem Header="Copy transaction ID" Command="{Binding CopyTransactionId}">
+ <MenuItem.Icon>
+ <DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource ReceiveTabView_CopyIcon}" />
+ </MenuItem.Icon>
+ </MenuItem>
+ </ContextMenu>
+ </controls:ExtendedListBox.ContextMenu>
<controls:ExtendedListBox.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="40, 160, 150, *">

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -9,6 +9,7 @@ using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using WalletWasabi.Blockchain.Transactions;
+using WalletWasabi.Gui.Helpers;
using WalletWasabi.Logging;
using WalletWasabi.Models;
@@ -23,6 +24,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private SortOrder _dateSortDirection;
private SortOrder _amountSortDirection;
private SortOrder _transactionSortDirection;
+ public ReactiveCommand<Unit, Unit> CopyTransactionId { get; }
public ReactiveCommand<Unit, Unit> SortCommand { get; }
public HistoryTabViewModel(WalletViewModel walletViewModel)
@@ -30,22 +32,31 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
Transactions = new ObservableCollection<TransactionViewModel>();
- this.WhenAnyValue(x => x.SelectedTransaction).Subscribe(async transaction =>
+ SortCommand = ReactiveCommand.Create(RefreshOrdering);
+ DateSortDirection = SortOrder.Decreasing;
+
+ var isCoinListItemSelected = this.WhenAnyValue(x => x.SelectedTransaction).Select(tx => tx is { });
+
+ CopyTransactionId = ReactiveCommand.CreateFromTask(async () =>
{
- if (Global.UiConfig?.Autocopy is false || transaction is null)
+ if (SelectedTransaction is null)
{
return;
}
- await transaction.TryCopyTxIdToClipboardAsync();
- });
+ await SelectedTransaction.TryCopyTxIdToClipboardAsync();
+ },
+ isCoinListItemSelected);
- SortCommand = ReactiveCommand.Create(RefreshOrdering);
- SortCommand.ThrownExceptions
+ Observable
+ .Merge(SortCommand.ThrownExceptions)
+ .Merge(CopyTransactionId.ThrownExceptions)
.ObserveOn(RxApp.TaskpoolScheduler)
- .Subscribe(ex => Logger.LogError(ex));
-
- DateSortDirection = SortOrder.Decreasing;
+ .Subscribe(ex =>
+ {
+ NotificationHelpers.Error(ex.ToTypeMessageString());
+ Logger.LogWarning(ex);
+ });
_ = TryRewriteTableAsync();
}

MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
<StackPanel Orientation="Vertical" Spacing="5">
<StackPanel Margin="0 10" Orientation="Horizontal" Spacing="5">
<ToggleButton IsChecked="{Binding Autocopy}" Content="{Binding Autocopy, Converter={StaticResource BooleanStringConverter}, ConverterParameter=On:Off}" Margin="0 0 10 0" />
- <TextBlock VerticalAlignment="Center">Auto Copy/Paste bitcoin addresses, bitcoin urls, transaction ids, etc...</TextBlock>
+ <TextBlock VerticalAlignment="Center">Auto Copy/Paste bitcoin addresses, bitcoin urls, etc...</TextBlock>
</StackPanel>
<StackPanel Margin="0 10" Orientation="Horizontal" Spacing="5">
<ToggleButton IsChecked="{Binding CustomFee}" Content="{Binding CustomFee, Converter={StaticResource BooleanStringConverter}, ConverterParameter=On:Off}" Margin="0 0 10 0" />

Remove autocopy, add txid context menu copy