Add auto coinjoin setting (UI)
MODIFY
WalletWasabi.Fluent/ViewModels/Settings/PrivacySettingsTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/PrivacySettingsTabViewModel.cs
@@ -17,12 +17,14 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
[AutoNotify] private int _minimalPrivacyLevel;
[AutoNotify] private int _mediumPrivacyLevel;
[AutoNotify] private int _strongPrivacyLevel;
+ [AutoNotify] private bool _autoCoinJoin;
public PrivacySettingsTabViewModel()
{
_minimalPrivacyLevel = Services.Config.PrivacyLevelSome;
_mediumPrivacyLevel = Services.Config.PrivacyLevelFine;
_strongPrivacyLevel = Services.Config.PrivacyLevelStrong;
+ _autoCoinJoin = Services.UiConfig.AutoCoinJoin;
this.WhenAnyValue(
x => x.MinimalPrivacyLevel,
@@ -72,6 +74,11 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
MediumPrivacyLevel = x - 1;
}
});
+
+ this.WhenAnyValue(x => x.AutoCoinJoin)
+ .ObserveOn(RxApp.TaskpoolScheduler)
+ .Skip(1)
+ .Subscribe(x => Services.UiConfig.AutoCoinJoin = x);
}
protected override void EditConfigOnSave(Config config)

MODIFY
WalletWasabi.Fluent/Views/Settings/PrivacySettingsTabView.axaml
WalletWasabi.Fluent/Views/Settings/PrivacySettingsTabView.axaml
<Setter Property="TickFrequency" Value="1" />
</Style>
</StackPanel.Styles>
+ <StackPanel.Styles>
+ <Style Selector="DockPanel > ToggleSwitch">
+ <Setter Property="Margin" Value="0 0 -12 0" />
+ <Setter Property="HorizontalAlignment" Value="Right" />
+ <Setter Property="OnContent" Value="{x:Null}" />
+ <Setter Property="OffContent" Value="{x:Null}" />
+ </Style>
+ </StackPanel.Styles>
<StackPanel Spacing="10">
<TextBlock Text="Minimal Anonymity Level" />
<Slider Minimum="4" Value="{Binding StrongPrivacyLevel}" Margin="10 0" />
</DockPanel>
</StackPanel>
+
+ <DockPanel>
+ <TextBlock Text="Auto CoinJoin" />
+ <ToggleSwitch IsChecked="{Binding AutoCoinJoin}" />
+ </DockPanel>
</StackPanel>
</UserControl>

MODIFY
WalletWasabi.Gui/UiConfig.cs
WalletWasabi.Gui/UiConfig.cs
@@ -24,6 +24,7 @@ namespace WalletWasabi.Gui
private bool _darkModeEnabled;
private string? _lastSelectedWallet;
private string _windowState = "Normal";
+ private bool _autoCoinJoin;
public UiConfig() : base()
{
@@ -40,7 +41,8 @@ namespace WalletWasabi.Gui
x => x.FeeDisplayFormat,
x => x.LastSelectedWallet,
x => x.WindowState,
- (_, _, _, _, _, _, _, _) => Unit.Default)
+ x => x.AutoCoinJoin,
+ (_, _, _, _, _, _, _, _, _) => Unit.Default)
.Throttle(TimeSpan.FromMilliseconds(500))
.Skip(1) // Won't save on UiConfig creation.
.ObserveOn(RxApp.TaskpoolScheduler)
@@ -135,6 +137,14 @@ namespace WalletWasabi.Gui
set => RaiseAndSetIfChanged(ref _lastSelectedWallet, value);
}
+ [DefaultValue(true)]
+ [JsonProperty(PropertyName = "AutoCoinJoin", DefaultValueHandling = DefaultValueHandling.Populate)]
+ public bool AutoCoinJoin
+ {
+ get => _autoCoinJoin;
+ set => RaiseAndSetIfChanged(ref _autoCoinJoin, value);
+ }
+
[JsonProperty(PropertyName = "CoinListViewSortingPreference")]
[JsonConverter(typeof(SortingPreferenceJsonConverter))]
public SortingPreference CoinListViewSortingPreference { get; internal set; } = new SortingPreference(SortOrder.Increasing, "Amount");

Add auto coinjoin setting (UI)