More work on screen lock settings.
MODIFY
WalletWasabi.Gui/Models/LockScreenType.cs
WalletWasabi.Gui/Models/LockScreenType.cs
@@ -4,9 +4,6 @@ using System.Text;
namespace WalletWasabi.Gui.Models
{
- /// <summary>
- /// Order matter: piority the lower.
- /// </summary>
public enum LockScreenType
{
SlideLock,

MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
<controls:GroupBox Title="Screen Lock" TextBlock.FontSize="16" Padding="10" Margin="0 5 10 5">
<StackPanel Orientation="Vertical" Spacing="5">
<StackPanel Margin="0 10" Orientation="Horizontal" Spacing="5">
- <ToggleButton/>
+ <ToggleButton IsChecked="{Binding EnablePINLock, Mode=OneWay}" Content="{Binding EnablePINLock, Converter={StaticResource BooleanOnOffConverter}}}" Margin="0 0 10 0" Command="{Binding EnablePINLockCommand}" />
<TextBlock VerticalAlignment="Center">Use PIN to unlock the screen.</TextBlock>
</StackPanel>
+ <StackPanel Orientation="Vertical" Spacing="5" IsVisible="{Binding EnablePINLock, Mode=OneWay}">
<controls:NoparaPasswordBox Watermark="Enter Old PIN Here."/>
<controls:NoparaPasswordBox Watermark="Enter New PIN Here."/>
<Button Content="Confirm"/>
</StackPanel>
+ </StackPanel>
</controls:GroupBox>
</StackPanel>
</controls:GroupBox>

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -27,6 +27,7 @@ namespace WalletWasabi.Gui.Tabs
private bool _autocopy;
private bool _useTor;
private bool _isModified;
+ private bool _enablePINLock;
private string _somePrivacyLevel;
private string _finePrivacyLevel;
private string _strongPrivacyLevel;
@@ -35,6 +36,8 @@ namespace WalletWasabi.Gui.Tabs
public ReactiveCommand<Unit, Unit> OpenConfigFileCommand { get; }
public ReactiveCommand<Unit, Unit> LurkingWifeModeCommand { get; }
+ public ReactiveCommand<Unit, Unit> EnablePINLockCommand { get; }
+ public ReactiveCommand<Unit, Unit> SetPINLockCommand { get; }
public SettingsViewModel(Global global) : base(global, "Settings")
{
@@ -93,6 +96,8 @@ namespace WalletWasabi.Gui.Tabs
DustThreshold = config.DustThreshold.ToString();
IsModified = await Global.Config.CheckFileChangeAsync();
+
+ EnablePINLock = Global.UiConfig.LockScreenPinHash != string.Empty;
});
OpenConfigFileCommand = ReactiveCommand.Create(OpenConfigFile);
@@ -100,6 +105,15 @@ namespace WalletWasabi.Gui.Tabs
LurkingWifeModeCommand = ReactiveCommand.CreateFromTask(async () =>
{
Global.UiConfig.LurkingWifeMode = !LurkingWifeMode;
+ await Global.UiConfig.ToFileAsync();
+ });
+
+ EnablePINLockCommand = ReactiveCommand.CreateFromTask(async () =>
+ {
+ EnablePINLock = !EnablePINLock;
+
+
+
await Global.UiConfig.ToFileAsync();
});
}
@@ -218,6 +232,14 @@ namespace WalletWasabi.Gui.Tabs
public bool LurkingWifeMode => Global.UiConfig.LurkingWifeMode is true;
+
+ public bool EnablePINLock
+ {
+ get => _enablePINLock;
+ set => this.RaiseAndSetIfChanged(ref _enablePINLock, value);
+ }
+
+
private void Save()
{
var isValid = string.IsNullOrEmpty(ValidateTorHost())

More work on screen lock settings.