Add config to the GUI
MODIFY
WalletWasabi.Gui/Config.cs
WalletWasabi.Gui/Config.cs
@@ -70,6 +70,10 @@ namespace WalletWasabi.Gui
[JsonProperty(PropertyName = "UseTor", DefaultValueHandling = DefaultValueHandling.Populate)]
public bool UseTor { get; internal set; }
+ [DefaultValue(false)]
+ [JsonProperty(PropertyName = "CloseTor", DefaultValueHandling = DefaultValueHandling.Populate)]
+ public bool CloseTor { get; internal set; }
+
[DefaultValue(false)]
[JsonProperty(PropertyName = "StartLocalBitcoinCoreOnStartup", DefaultValueHandling = DefaultValueHandling.Populate)]
public bool StartLocalBitcoinCoreOnStartup { get; internal set; }

MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
</i:Interaction.Behaviors>
</TextBox>
</StackPanel>
+ <StackPanel Margin="0 10" Orientation="Horizontal" Spacing="5">
+ <ToggleButton IsChecked="{Binding CloseTor}" Content="{Binding CloseTor, Converter={StaticResource BooleanStringConverter}, ConverterParameter=On:Off}" Margin="0 0 10 0" />
+ <TextBlock VerticalAlignment="Center">Close Tor instance after quit.</TextBlock>
+ </StackPanel>
</StackPanel>
</controls:GroupBox>
<controls:GroupBox Title="UI" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -35,6 +35,7 @@ namespace WalletWasabi.Gui.Tabs
private bool _startLocalBitcoinCoreOnStartup;
private bool _stopLocalBitcoinCoreOnShutdown;
private bool _isModified;
+ private bool _closeTor;
private string _somePrivacyLevel;
private string _finePrivacyLevel;
private string _strongPrivacyLevel;
@@ -64,6 +65,7 @@ namespace WalletWasabi.Gui.Tabs
Network = config.Network;
TorSocks5EndPoint = config.TorSocks5EndPoint.ToString(-1);
UseTor = config.UseTor;
+ CloseTor = config.CloseTor;
StartLocalBitcoinCoreOnStartup = config.StartLocalBitcoinCoreOnStartup;
StopLocalBitcoinCoreOnShutdown = config.StopLocalBitcoinCoreOnShutdown;
@@ -81,6 +83,7 @@ namespace WalletWasabi.Gui.Tabs
this.WhenAnyValue(
x => x.Network,
x => x.UseTor,
+ x => x.CloseTor,
x => x.StartLocalBitcoinCoreOnStartup,
x => x.StopLocalBitcoinCoreOnShutdown)
.ObserveOn(RxApp.TaskpoolScheduler)
@@ -251,6 +254,12 @@ namespace WalletWasabi.Gui.Tabs
set => this.RaiseAndSetIfChanged(ref _useTor, value);
}
+ public bool CloseTor
+ {
+ get => _closeTor;
+ set => this.RaiseAndSetIfChanged(ref _closeTor, value);
+ }
+
public string SomePrivacyLevel
{
get => _somePrivacyLevel;
@@ -363,6 +372,7 @@ namespace WalletWasabi.Gui.Tabs
config.SetP2PEndpoint(p2pEp);
}
config.UseTor = UseTor;
+ config.CloseTor = CloseTor;
config.StartLocalBitcoinCoreOnStartup = StartLocalBitcoinCoreOnStartup;
config.StopLocalBitcoinCoreOnShutdown = StopLocalBitcoinCoreOnShutdown;
config.LocalBitcoinCoreDataDir = Guard.Correct(LocalBitcoinCoreDataDir);

Add config to the GUI