making the feeratedisplay format non volatile
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -51,8 +51,18 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private const string BuildingTransactionButtonTextString = "Sending Transaction...";
private int _caretIndex;
private ObservableCollection<SuggestionViewModel> _suggestions;
+ private FeeDisplayFormat _feeDisplayFormat;
+
private bool IgnoreAmountChanges { get; set; }
- private FeeDisplayFormat FeeDisplayFormat { get; set; }
+ private FeeDisplayFormat FeeDisplayFormat
+ {
+ get => _feeDisplayFormat;
+ set
+ {
+ _feeDisplayFormat = value;
+ Global.UiConfig.FeeDisplayFormat = (int)value;
+ }
+ }
public SendTabViewModel(WalletViewModel walletViewModel)
: base("Send", walletViewModel)
@@ -67,6 +77,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
ResetMax();
SetFeeTargetLimits();
FeeTarget = Global.UiConfig.FeeTarget ?? MinimumFeeTarget;
+ FeeDisplayFormat = (FeeDisplayFormat)(Enum.ToObject(typeof(FeeDisplayFormat), Global.UiConfig.FeeDisplayFormat) ?? FeeDisplayFormat.SatoshiPerByte);
SetFeesAndTexts();
Global.Synchronizer.PropertyChanged += Synchronizer_PropertyChanged;

MODIFY
WalletWasabi.Gui/UiConfig.cs
WalletWasabi.Gui/UiConfig.cs
@@ -6,6 +6,7 @@ using System.IO;
using System.Text;
using System.Threading.Tasks;
using WalletWasabi.Gui.Converters;
+using WalletWasabi.Gui.Models;
using WalletWasabi.Helpers;
using WalletWasabi.Interfaces;
using WalletWasabi.JsonConverters;
@@ -31,6 +32,10 @@ namespace WalletWasabi.Gui
[JsonProperty(PropertyName = "FeeTarget")]
public int? FeeTarget { get; internal set; }
+ [JsonProperty(PropertyName = "FeeDisplayFormat")]
+ public int? FeeDisplayFormat { get; internal set; }
+
+
public UiConfig()
{
}
@@ -40,12 +45,13 @@ namespace WalletWasabi.Gui
SetFilePath(filePath);
}
- public UiConfig(WindowState windowState, double height, double width, int feeTarget)
+ public UiConfig(WindowState windowState, double height, double width, int feeTarget,int feeDisplayFormat)
{
WindowState = Guard.NotNull(nameof(windowState), windowState);
Height = Guard.NotNull(nameof(height), height);
Width = Guard.NotNull(nameof(width), width);
FeeTarget = Guard.NotNull(nameof(feeTarget), feeTarget);
+ FeeDisplayFormat = Guard.NotNull(nameof(feeDisplayFormat), feeDisplayFormat);
}
/// <inheritdoc />
@@ -68,6 +74,7 @@ namespace WalletWasabi.Gui
Height = 530;
Width = 1100;
FeeTarget = 2;
+ FeeDisplayFormat = 0;
if (!File.Exists(FilePath))
{
@@ -90,6 +97,7 @@ namespace WalletWasabi.Gui
Height = config.Height ?? Height;
Width = config.Width ?? Width;
FeeTarget = config.FeeTarget ?? FeeTarget;
+ FeeDisplayFormat = config.FeeDisplayFormat ?? FeeDisplayFormat;
}
/// <inheritdoc />
@@ -125,6 +133,11 @@ namespace WalletWasabi.Gui
return true;
}
+ if (FeeDisplayFormat != config.FeeDisplayFormat)
+ {
+ return true;
+ }
+
return false;
}

- making the feeratedisplay format non volatile