add private mode to the settings
MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
</controls:GroupBox>
<controls:GroupBox Title="UI" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">
+ <StackPanel Spacing="10" Orientation="Vertical">
<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>
+ <StackPanel Margin="0 10" Orientation="Horizontal">
+ <ToggleButton IsChecked="{Binding PrivateMode}" Content="{Binding PrivateModeText}" Margin="0 0 10 0" Command="{Binding PrivateModeCommand}" />
+ <TextBlock VerticalAlignment="Center">Private mode to hide sensitive content.</TextBlock>
+ </StackPanel>
+ </StackPanel>
</controls:GroupBox>
<Button Content="Open Config File" Command="{Binding OpenConfigFileCommand}" />

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -24,9 +24,11 @@ namespace WalletWasabi.Gui.Tabs
private string _autocopyText;
private bool _useTor;
private string _useTorText;
-
private bool _isModified;
+ public ReactiveCommand OpenConfigFileCommand { get; }
+ public ReactiveCommand PrivateModeCommand { get; }
+
public SettingsViewModel() : base("Settings")
{
Disposables = new CompositeDisposable();
@@ -52,6 +54,12 @@ namespace WalletWasabi.Gui.Tabs
UseTorText = x ? "On" : "Off";
}).DisposeWith(Disposables);
+ Global.UiConfig.WhenAnyValue(x => x.PrivateMode).Subscribe(_ =>
+ {
+ this.RaisePropertyChanged(nameof(PrivateMode));
+ this.RaisePropertyChanged(nameof(PrivateModeText));
+ }).DisposeWith(Disposables);
+
Dispatcher.UIThread.PostLogException(async () =>
{
await config.LoadFileAsync();
@@ -65,6 +73,12 @@ namespace WalletWasabi.Gui.Tabs
});
OpenConfigFileCommand = ReactiveCommand.Create(OpenConfigFile).DisposeWith(Disposables);
+
+ PrivateModeCommand = ReactiveCommand.CreateFromTask(async () =>
+ {
+ Global.UiConfig.PrivateMode = !PrivateMode;
+ await Global.UiConfig.ToFileAsync();
+ });
}
public IEnumerable<string> Networks
@@ -129,6 +143,10 @@ namespace WalletWasabi.Gui.Tabs
set => this.RaiseAndSetIfChanged(ref _useTorText, value);
}
+ public bool PrivateMode => Global.UiConfig.PrivateMode == true;
+
+ public string PrivateModeText => Global.UiConfig.PrivateMode == true ? "On" : "Off";
+
private void Save()
{
var isValid = string.IsNullOrEmpty(ValidateTorHost()) &&
@@ -201,8 +219,6 @@ namespace WalletWasabi.Gui.Tabs
return "Invalid port.";
}
- public ReactiveCommand OpenConfigFileCommand { get; }
-
private void OpenConfigFile()
{
IoHelpers.OpenFileInTextEditor(Global.Config.FilePath);

add private mode to the settings