get autopcopy from uiconfig
MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -276,7 +276,7 @@ namespace WalletWasabi.Fluent.ViewModels
actions.Add(new SendViewModel(walletViewModel, _transactionBroadcaster, _config, _uiConfig, _externalHttpClientFactory));
}
- actions.Add(new ReceiveViewModel(walletViewModel, WalletManager, BitcoinStore));
+ actions.Add(new ReceiveViewModel(walletViewModel, WalletManager, BitcoinStore, _uiConfig));
if (!wallet.KeyManager.IsWatchOnly)
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/AddressViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/AddressViewModel.cs
@@ -5,6 +5,7 @@ using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Keys;
+using WalletWasabi.Gui;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
{
@@ -13,7 +14,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
[AutoNotify] private SmartLabel _label;
[AutoNotify] private string _address;
- public AddressViewModel(ReceiveAddressesViewModel parent, HdPubKey model, Network network)
+ public AddressViewModel(ReceiveAddressesViewModel parent, HdPubKey model, Network network, UiConfig uiConfig)
{
_address = model.GetP2wpkhAddress(network).ToString();
_label = model.Label;
@@ -30,7 +31,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
model,
network,
parent.Wallet.KeyManager.MasterFingerprint,
- parent.Wallet.KeyManager.IsHardwareWallet));
+ parent.Wallet.KeyManager.IsHardwareWallet,
+ uiConfig));
});
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressViewModel.cs
@@ -11,6 +11,7 @@ using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Gui;
using WalletWasabi.Hwi;
using WalletWasabi.Logging;
@@ -19,11 +20,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
[NavigationMetaData(Title = "Receive Address")]
public partial class ReceiveAddressViewModel : RoutableViewModel
{
- public ReceiveAddressViewModel(HdPubKey model, Network network, HDFingerprint? masterFingerprint, bool isHardwareWallet)
+ public ReceiveAddressViewModel(HdPubKey model, Network network, HDFingerprint? masterFingerprint, bool isHardwareWallet, UiConfig uiConfig)
{
Address = model.GetP2wpkhAddress(network).ToString();
Labels = model.Label;
IsHardwareWallet = isHardwareWallet;
+ IsAutoCopyEnabled = uiConfig.Autocopy;
GenerateQrCode();
@@ -97,6 +99,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
public bool IsHardwareWallet { get; }
+ public bool IsAutoCopyEnabled { get; }
+
private void GenerateQrCode()
{
try

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressesViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressesViewModel.cs
@@ -11,6 +11,7 @@ using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.ViewModels.Dialogs;
using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Gui;
using WalletWasabi.Logging;
using WalletWasabi.Wallets;
@@ -19,11 +20,13 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
[NavigationMetaData(Title = "Receive Addresses")]
public partial class ReceiveAddressesViewModel : RoutableViewModel
{
+ private readonly UiConfig _uiConfig;
[AutoNotify] private ObservableCollection<AddressViewModel> _addresses;
[AutoNotify] private AddressViewModel? _selectedAddress;
- public ReceiveAddressesViewModel(Wallet wallet)
+ public ReceiveAddressesViewModel(Wallet wallet, UiConfig uiConfig)
{
+ _uiConfig = uiConfig;
Wallet = wallet;
Network = wallet.Network;
_addresses = new ObservableCollection<AddressViewModel>();
@@ -60,7 +63,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
foreach (HdPubKey key in keys)
{
- Addresses.Add(new AddressViewModel(this, key, Network));
+ Addresses.Add(new AddressViewModel(this, key, Network, _uiConfig));
}
}
catch (Exception ex)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveViewModel.cs
@@ -10,6 +10,7 @@ using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Gui;
using WalletWasabi.Stores;
using WalletWasabi.Wallets;
@@ -24,12 +25,15 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
NavigationTarget = NavigationTarget.DialogScreen)]
public partial class ReceiveViewModel : NavBarItemViewModel
{
+ private readonly UiConfig _uiConfig;
+
[AutoNotify] private ObservableCollection<string> _labels;
[AutoNotify] private HashSet<string> _suggestions;
[AutoNotify] private bool _isExistingAddressesButtonVisible;
- public ReceiveViewModel(WalletViewModelBase wallet, WalletManager walletManager, BitcoinStore bitcoinStore) : base(NavigationMode.Normal)
+ public ReceiveViewModel(WalletViewModelBase wallet, WalletManager walletManager, BitcoinStore bitcoinStore, UiConfig uiConfig) : base(NavigationMode.Normal)
{
+ _uiConfig = uiConfig;
WasabiWallet = wallet.Wallet;
_labels = new ObservableCollection<string>();
_suggestions = GetLabels(walletManager, bitcoinStore);
@@ -61,12 +65,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
Labels.Clear();
Navigate().To(new ReceiveAddressViewModel(newKey, WasabiWallet.Network, WasabiWallet.KeyManager.MasterFingerprint,
- WasabiWallet.KeyManager.IsHardwareWallet));
+ WasabiWallet.KeyManager.IsHardwareWallet, _uiConfig));
}
private void OnShowExistingAddresses()
{
- Navigate().To(new ReceiveAddressesViewModel(WasabiWallet));
+ Navigate().To(new ReceiveAddressesViewModel(WasabiWallet, _uiConfig));
}
public Wallet WasabiWallet { get; }

MODIFY
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressView.axaml
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressView.axaml
<c:AnimatedButton ToolTip.Tip="Copy"
Command="{Binding CopyAddressCommand}"
NormalIcon="{StaticResource copy_regular}"
- ClickIcon="{StaticResource copy_confirmed}"/>
+ ClickIcon="{StaticResource copy_confirmed}"
+ ExecuteOnOpen="{Binding IsAutoCopyEnabled}"/>
</StackPanel>
<TextBox Classes="selectableTextBlock" TextWrapping="Wrap" Text="{Binding Address}" FontWeight="Normal" FontSize="{StaticResource FontSizeH5}" />
</DockPanel>

get autopcopy from uiconfig