Add necessary UiConfig fields.
ADD
WalletWasabi.Gui/Models/LockScreenType.cs
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WalletWasabi.Gui.Models
+{
+ /// <summary>
+ /// Order matter: piority the lower.
+ /// </summary>
+ public enum LockScreenType
+ {
+ SlideLock,
+ PINLock
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Gui/UiConfig.cs
WalletWasabi.Gui/UiConfig.cs
@@ -20,6 +20,8 @@ namespace WalletWasabi.Gui
public class UiConfig : ReactiveObject, IConfig
{
private bool? _lurkingWifeMode;
+ private bool? _lockScreenActive;
+ private LockScreenType _lockScreenType;
/// <inheritdoc />
public string FilePath { get; private set; }
@@ -50,6 +52,23 @@ namespace WalletWasabi.Gui
set => this.RaiseAndSetIfChanged(ref _lurkingWifeMode, value);
}
+ [JsonProperty(PropertyName = "LockScreenActive")]
+ public bool? LockScreenActive
+ {
+ get => _lockScreenActive;
+ set => this.RaiseAndSetIfChanged(ref _lockScreenActive, value);
+ }
+
+ [JsonProperty(PropertyName = "LockScreenType")]
+ public LockScreenType LockScreenType
+ {
+ get => _lockScreenType;
+ set => this.RaiseAndSetIfChanged(ref _lockScreenType, value);
+ }
+
+ [JsonProperty(PropertyName = "LockScreenPinHash")]
+ public string LockScreenPinHash { get; internal set; }
+
public UiConfig()
{
}
@@ -59,7 +78,9 @@ namespace WalletWasabi.Gui
SetFilePath(filePath);
}
- public UiConfig(WindowState windowState, double height, double width, int feeTarget, int feeDisplayFormat, bool autocopy, bool lurkingWifeMode)
+ public UiConfig(WindowState windowState, double height, double width, int feeTarget,
+ int feeDisplayFormat, bool autocopy, bool lurkingWifeMode,
+ bool LockScreenActive, string lockScreenPinHash, LockScreenType lockScreenType)
{
WindowState = Guard.NotNull(nameof(windowState), windowState);
Height = Guard.NotNull(nameof(height), height);
@@ -68,6 +89,9 @@ namespace WalletWasabi.Gui
FeeDisplayFormat = Guard.NotNull(nameof(feeDisplayFormat), feeDisplayFormat);
Autocopy = Guard.NotNull(nameof(autocopy), autocopy);
LurkingWifeMode = Guard.NotNull(nameof(lurkingWifeMode), lurkingWifeMode);
+ LockScreenActive = Guard.NotNull(nameof(LockScreenActive), LockScreenActive);
+ LockScreenType = Guard.NotNull(nameof(LockScreenType), lockScreenType);
+ LockScreenPinHash = Guard.NotNull(nameof(LockScreenPinHash), lockScreenPinHash);
}
/// <inheritdoc />
@@ -93,6 +117,9 @@ namespace WalletWasabi.Gui
FeeDisplayFormat = 0;
Autocopy = true;
LurkingWifeMode = false;
+ LockScreenActive = false;
+ LockScreenPinHash = "";
+ LockScreenType = LockScreenType.SlideLock;
if (!File.Exists(FilePath))
{
@@ -168,6 +195,21 @@ namespace WalletWasabi.Gui
return true;
}
+ if (LockScreenActive != config.LockScreenActive)
+ {
+ return true;
+ }
+
+ if (LockScreenType != config.LockScreenType)
+ {
+ return true;
+ }
+
+ if (LockScreenPinHash != config.LockScreenPinHash)
+ {
+ return true;
+ }
+
return false;
}

Add necessary UiConfig fields.