Make autocopy turnoffable
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -56,7 +56,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
}).DisposeWith(Disposables);
- this.WhenAnyValue(x => x.SelectedTransaction).Subscribe(transaction => transaction?.CopyToClipboard()).DisposeWith(Disposables);
+ this.WhenAnyValue(x => x.SelectedTransaction).Subscribe(transaction =>
+ {
+ if (Global.UiConfig.Autocopy is true)
+ {
+ transaction?.CopyToClipboard();
+ }
+ }).DisposeWith(Disposables);
SortCommand = ReactiveCommand.Create(() => RefreshOrdering()).DisposeWith(Disposables);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -82,7 +82,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
this.WhenAnyValue(x => x.Label).Subscribe(x => UpdateSuggestions(x)).DisposeWith(Disposables);
- this.WhenAnyValue(x => x.SelectedAddress).Subscribe(address => address?.CopyToClipboard()).DisposeWith(Disposables);
+ this.WhenAnyValue(x => x.SelectedAddress).Subscribe(address =>
+ {
+ if (Global.UiConfig.Autocopy is true)
+ {
+ address?.CopyToClipboard();
+ }
+ }).DisposeWith(Disposables);
this.WhenAnyValue(x => x.CaretIndex).Subscribe(_ =>
{

MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
<StackPanel Margin="30" Spacing="10">
<Grid Classes="content">
<StackPanel Orientation="Vertical" Spacing="30">
+ <StackPanel IsVisible="{Binding IsModified}" Orientation="Horizontal" HorizontalAlignment="Center">
+ <TextBlock Text="Heads Up!" FontWeight="Bold" Classes="warningMessage" Margin="0 0 3 0" />
+ <TextBlock Classes="warningMessage">Changes will be applied after restarting the application.</TextBlock>
+ </StackPanel>
+
<controls:GroupBox Title="Bitcoin" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">
<StackPanel Margin="0 10">
<TextBlock>Network</TextBlock>
</StackPanel>
</StackPanel>
</controls:GroupBox>
- <Button Content="Open Config File" Command="{Binding OpenConfigFileCommand}" />
- <StackPanel IsVisible="{Binding IsModified}">
- <TextBlock Text="Heads Up!" FontWeight="Bold" Classes="warningMessage" />
- <TextBlock Classes="warningMessage">Changes will be applied after restarting the application.</TextBlock>
+
+ <controls:GroupBox Title="UI" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">
+ <StackPanel Margin="0 10" Orientation="Horizontal">
+ <ToggleButton IsChecked="{Binding Autocopy}" Content="{Binding AutocopyText}" Margin="0 0 10 0" />
+ <TextBlock VerticalAlignment="Center">Autocopy on Receive and History wallet tabs.</TextBlock>
</StackPanel>
+ </controls:GroupBox>
+
+ <Button Content="Open Config File" Command="{Binding OpenConfigFileCommand}" />
</StackPanel>
</Grid>
</StackPanel>

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -17,14 +17,29 @@ namespace WalletWasabi.Gui.Tabs
private string _network;
private string _torHost;
private string _torPort;
+ private bool _autocopy;
+ private string _autocopyText;
+
private bool _isModified;
public SettingsViewModel() : base("Settings")
{
var config = new Config(Global.Config.FilePath);
+ Autocopy = (bool)Global.UiConfig.Autocopy;
this.WhenAnyValue(x => x.Network, x => x.TorHost, x => x.TorPort).Subscribe(x => Save());
+ this.WhenAnyValue(x => x.Autocopy).Subscribe(x =>
+ {
+ Dispatcher.UIThread.PostLogException(async () =>
+ {
+ Global.UiConfig.Autocopy = x;
+ await Global.UiConfig.ToFileAsync();
+
+ AutocopyText = x ? "On" : "Off";
+ });
+ });
+
Dispatcher.UIThread.PostLogException(async () =>
{
await config.LoadFileAsync();
@@ -77,6 +92,18 @@ namespace WalletWasabi.Gui.Tabs
set => this.RaiseAndSetIfChanged(ref _isModified, value);
}
+ public bool Autocopy
+ {
+ get => _autocopy;
+ set => this.RaiseAndSetIfChanged(ref _autocopy, value);
+ }
+
+ public string AutocopyText
+ {
+ get => _autocopyText;
+ set => this.RaiseAndSetIfChanged(ref _autocopyText, value);
+ }
+
private void Save()
{
var isValid = string.IsNullOrEmpty(ValidateTorHost()) &&

MODIFY
WalletWasabi.Gui/UiConfig.cs
WalletWasabi.Gui/UiConfig.cs
@@ -35,6 +35,9 @@ namespace WalletWasabi.Gui
[JsonProperty(PropertyName = "FeeDisplayFormat")]
public int? FeeDisplayFormat { get; internal set; }
+ [JsonProperty(PropertyName = "Autocopy")]
+ public bool? Autocopy { get; internal set; }
+
public UiConfig()
{
}
@@ -44,13 +47,14 @@ namespace WalletWasabi.Gui
SetFilePath(filePath);
}
- public UiConfig(WindowState windowState, double height, double width, int feeTarget,int feeDisplayFormat)
+ public UiConfig(WindowState windowState, double height, double width, int feeTarget, int feeDisplayFormat, bool autocopy)
{
WindowState = Guard.NotNull(nameof(windowState), windowState);
Height = Guard.NotNull(nameof(height), height);
Width = Guard.NotNull(nameof(width), width);
FeeTarget = Guard.NotNull(nameof(feeTarget), feeTarget);
FeeDisplayFormat = Guard.NotNull(nameof(feeDisplayFormat), feeDisplayFormat);
+ Autocopy = Guard.NotNull(nameof(autocopy), autocopy);
}
/// <inheritdoc />
@@ -74,6 +78,7 @@ namespace WalletWasabi.Gui
Width = 1100;
FeeTarget = 2;
FeeDisplayFormat = 0;
+ Autocopy = true;
if (!File.Exists(FilePath))
{
@@ -97,6 +102,7 @@ namespace WalletWasabi.Gui
Width = config.Width ?? Width;
FeeTarget = config.FeeTarget ?? FeeTarget;
FeeDisplayFormat = config.FeeDisplayFormat ?? FeeDisplayFormat;
+ Autocopy = config.Autocopy ?? Autocopy;
}
/// <inheritdoc />
@@ -137,6 +143,11 @@ namespace WalletWasabi.Gui
return true;
}
+ if (Autocopy != config.Autocopy)
+ {
+ return true;
+ }
+
return false;
}

Make autocopy turnoffable