Renaem: use more managable names.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -229,7 +229,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
try
{
IsBusy = true;
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.BuildingTransaction);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.BuildingTransaction);
var label = new SmartLabel(_labelSuggestion.Label);
_labelSuggestion.Label = label;
@@ -291,7 +291,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
var intent = new PaymentIntent(address, moneyRequest, label);
try
{
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.DequeuingSelectedCoins);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.DequeuingSelectedCoins);
TxoRef[] toDequeue = selectedCoinViewModels.Where(x => x.CoinJoinInProgress).Select(x => x.Model.GetTxoRef()).ToArray();
if (toDequeue != null && toDequeue.Any())
{
@@ -305,7 +305,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
finally
{
- MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusBarStatus.DequeuingSelectedCoins);
+ MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusPriority.DequeuingSelectedCoins);
}
if (!KeyManager.IsWatchOnly)
@@ -352,7 +352,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
return;
}
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.SigningTransaction);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.SigningTransaction);
SmartTransaction signedTransaction = result.Transaction;
if (IsHardwareWallet && !result.Signed) // If hardware but still has a privkey then it's password, then meh.
@@ -360,7 +360,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
try
{
IsHardwareBusy = true;
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.AcquiringSignatureFromHardwareWallet);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.AcquiringSignatureFromHardwareWallet);
var client = new HwiClient(Global.Network);
using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
@@ -383,12 +383,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
finally
{
- MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusBarStatus.AcquiringSignatureFromHardwareWallet);
+ MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusPriority.AcquiringSignatureFromHardwareWallet);
IsHardwareBusy = false;
}
}
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.BroadcastingTransaction);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.BroadcastingTransaction);
await Task.Run(async () => await Global.TransactionBroadcaster.SendTransactionAsync(signedTransaction));
ResetUi();
@@ -408,7 +408,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
finally
{
- MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusBarStatus.BuildingTransaction, StatusBarStatus.SigningTransaction, StatusBarStatus.BroadcastingTransaction);
+ MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusPriority.BuildingTransaction, StatusPriority.SigningTransaction, StatusPriority.BroadcastingTransaction);
IsBusy = false;
}
},

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterViewModel.cs
@@ -201,7 +201,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
transaction = new SmartTransaction(Transaction.Parse(TransactionString, Global.Network ?? Network.Main), WalletWasabi.Models.Height.Unknown);
}
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.BroadcastingTransaction);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.BroadcastingTransaction);
await Task.Run(async () => await Global.TransactionBroadcaster.SendTransactionAsync(transaction));
NotificationHelpers.Success("Transaction is successfully sent!");
@@ -213,7 +213,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
finally
{
- MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusBarStatus.BroadcastingTransaction);
+ MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusPriority.BroadcastingTransaction);
IsBusy = false;
ButtonText = "Broadcast Transaction";
}

MODIFY
WalletWasabi.Gui/Converters/StatusBarStatusStringConverter.cs
WalletWasabi.Gui/Converters/StatusBarStatusStringConverter.cs
@@ -12,30 +12,30 @@ namespace WalletWasabi.Gui.Converters
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (value is StatusBarStatus status)
+ if (value is StatusPriority status)
{
return status switch
{
- StatusBarStatus.Ready => "Ready",
- StatusBarStatus.CriticalUpdate => "THE BACKEND WAS UPGRADED WITH BREAKING CHANGES - PLEASE UPDATE YOUR WASABI WALLET!",
- StatusBarStatus.OptionalUpdate => "A new version of Wasabi Wallet is available.",
- StatusBarStatus.Connecting => "Connecting...",
- StatusBarStatus.Synchronizing => "Synchronizing...",
- StatusBarStatus.Loading => "Loading...",
- StatusBarStatus.SettingUpHardwareWallet => "Setting up hardware wallet...",
- StatusBarStatus.ConnectingToHardwareWallet => "Connecting to hardware wallet...",
- StatusBarStatus.AcquiringXpubFromHardwareWallet => "Acquiring xpub from hardware wallet...",
- StatusBarStatus.AcquiringSignatureFromHardwareWallet => "Acquiring signature from hardware wallet...",
- StatusBarStatus.BuildingTransaction => "Building transaction...",
- StatusBarStatus.SigningTransaction => "Signing transaction...",
- StatusBarStatus.BroadcastingTransaction => "Broadcasting transaction...",
- StatusBarStatus.DequeuingSelectedCoins => "Dequeuing selected coins...",
+ StatusPriority.Ready => "Ready",
+ StatusPriority.CriticalUpdate => "THE BACKEND WAS UPGRADED WITH BREAKING CHANGES - PLEASE UPDATE YOUR WASABI WALLET!",
+ StatusPriority.OptionalUpdate => "A new version of Wasabi Wallet is available.",
+ StatusPriority.Connecting => "Connecting...",
+ StatusPriority.Synchronizing => "Synchronizing...",
+ StatusPriority.Loading => "Loading...",
+ StatusPriority.SettingUpHardwareWallet => "Setting up hardware wallet...",
+ StatusPriority.ConnectingToHardwareWallet => "Connecting to hardware wallet...",
+ StatusPriority.AcquiringXpubFromHardwareWallet => "Acquiring xpub from hardware wallet...",
+ StatusPriority.AcquiringSignatureFromHardwareWallet => "Acquiring signature from hardware wallet...",
+ StatusPriority.BuildingTransaction => "Building transaction...",
+ StatusPriority.SigningTransaction => "Signing transaction...",
+ StatusPriority.BroadcastingTransaction => "Broadcasting transaction...",
+ StatusPriority.DequeuingSelectedCoins => "Dequeuing selected coins...",
_ => status.ToString()
};
}
else
{
- throw new TypeArgumentException(value, typeof(StatusBarStatus), nameof(value));
+ throw new TypeArgumentException(value, typeof(StatusPriority), nameof(value));
}
}

RENAME
WalletWasabi.Gui/Models/StatusBarStatuses/StatusBarStatus.cs
WalletWasabi.Gui/Models/StatusBarStatuses/StatusPriority.cs
@@ -5,9 +5,9 @@ using System.Text;
namespace WalletWasabi.Gui.Models.StatusBarStatuses
{
/// <summary>
- /// Order matter: piority the lower.
+ /// Order: piority the lower.
/// </summary>
- public enum StatusBarStatus
+ public enum StatusPriority
{
CriticalUpdate,
OptionalUpdate,

RENAME
WalletWasabi.Gui/Models/StatusBarStatuses/StatusBarStatusSet.cs
WalletWasabi.Gui/Models/StatusBarStatuses/StatusSet.cs
@@ -7,27 +7,27 @@ using System.Text;
namespace WalletWasabi.Gui.Models.StatusBarStatuses
{
- public class StatusBarStatusSet : ReactiveObject
+ public class StatusSet : ReactiveObject
{
- private StatusBarStatus _status;
+ private StatusPriority _status;
- private HashSet<StatusBarStatus> ActiveStatuses { get; }
+ private HashSet<StatusPriority> ActiveStatuses { get; }
private object ActiveStatusesLock { get; }
- public StatusBarStatusSet()
+ public StatusSet()
{
- ActiveStatuses = new HashSet<StatusBarStatus>() { StatusBarStatus.Ready };
+ ActiveStatuses = new HashSet<StatusPriority>() { StatusPriority.Ready };
ActiveStatusesLock = new object();
- CurrentStatus = StatusBarStatus.Loading;
+ CurrentStatus = StatusPriority.Loading;
}
- public StatusBarStatus CurrentStatus
+ public StatusPriority CurrentStatus
{
get => _status;
set => this.RaiseAndSetIfChanged(ref _status, value);
}
- public bool TryAddStatus(StatusBarStatus status)
+ public bool TryAddStatus(StatusPriority status)
{
bool ret;
lock (ActiveStatusesLock)
@@ -42,12 +42,12 @@ namespace WalletWasabi.Gui.Models.StatusBarStatuses
return ret;
}
- public bool TryRemoveStatus(params StatusBarStatus[] statuses)
+ public bool TryRemoveStatus(params StatusPriority[] statuses)
{
bool ret = false;
lock (ActiveStatusesLock)
{
- foreach (StatusBarStatus status in statuses.ToHashSet())
+ foreach (StatusPriority status in statuses.ToHashSet())
{
ret = ActiveStatuses.Remove(status) || ret;
}

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -384,7 +384,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
try
{
IsHardwareBusy = true;
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.SettingUpHardwareWallet);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.SettingUpHardwareWallet);
// Setup may take a while for users to write down stuff.
using (var ctsSetup = new CancellationTokenSource(TimeSpan.FromMinutes(21)))
@@ -401,13 +401,13 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
}
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.ConnectingToHardwareWallet);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.ConnectingToHardwareWallet);
await EnumerateHardwareWalletsAsync();
}
finally
{
IsHardwareBusy = false;
- MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusBarStatus.SettingUpHardwareWallet, StatusBarStatus.ConnectingToHardwareWallet);
+ MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusPriority.SettingUpHardwareWallet, StatusPriority.ConnectingToHardwareWallet);
}
return await LoadKeyManagerAsync(requirePassword, isHardwareWallet);
@@ -447,13 +447,13 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
try
{
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.AcquiringXpubFromHardwareWallet);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.AcquiringXpubFromHardwareWallet);
extPubKey = await client.GetXpubAsync(selectedWallet.HardwareWalletInfo.Model, selectedWallet.HardwareWalletInfo.Path, KeyManager.DefaultAccountKeyPath, cts.Token);
}
finally
{
cts?.Dispose();
- MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusBarStatus.AcquiringXpubFromHardwareWallet);
+ MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusPriority.AcquiringXpubFromHardwareWallet);
}
Logger.LogInfo("Hardware wallet was not used previously on this computer. Creating a new wallet file.");
@@ -609,7 +609,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
try
{
IsBusy = true;
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.Loading);
+ MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusPriority.Loading);
var keyManager = await LoadKeyManagerAsync(IsPasswordRequired, IsHardwareWallet);
if (keyManager is null)
@@ -646,7 +646,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
finally
{
- MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusBarStatus.Loading);
+ MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusPriority.Loading);
IsBusy = false;
}
}

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -48,10 +48,10 @@ namespace WalletWasabi.Gui.ViewModels
private int _peers;
private ObservableAsPropertyHelper<int> _filtersLeft;
private string _btcPrice;
- private ObservableAsPropertyHelper<StatusBarStatus> _status;
+ private ObservableAsPropertyHelper<StatusPriority> _status;
private bool _downloadingBlock;
public Global Global { get; }
- private StatusBarStatusSet ActiveStatuses { get; }
+ private StatusSet ActiveStatuses { get; }
public StatusBarViewModel(Global global)
{
@@ -61,7 +61,7 @@ namespace WalletWasabi.Gui.ViewModels
Tor = TorStatus.NotRunning;
Peers = 0;
BtcPrice = "$0";
- ActiveStatuses = new StatusBarStatusSet();
+ ActiveStatuses = new StatusSet();
}
public void Initialize(NodesCollection nodes, WasabiSynchronizer synchronizer)
@@ -146,11 +146,11 @@ namespace WalletWasabi.Gui.ViewModels
(int filtersLeft, bool downloadingBlock) = tup;
if (filtersLeft == 0 && !downloadingBlock)
{
- TryRemoveStatus(StatusBarStatus.Synchronizing);
+ TryRemoveStatus(StatusPriority.Synchronizing);
}
else
{
- TryAddStatus(StatusBarStatus.Synchronizing);
+ TryAddStatus(StatusPriority.Synchronizing);
}
});
@@ -161,11 +161,11 @@ namespace WalletWasabi.Gui.ViewModels
(TorStatus tor, BackendStatus backend, int peers) = tup;
if (tor == TorStatus.NotRunning || backend != BackendStatus.Connected || peers < 1)
{
- TryAddStatus(StatusBarStatus.Connecting);
+ TryAddStatus(StatusPriority.Connecting);
}
else
{
- TryRemoveStatus(StatusBarStatus.Connecting);
+ TryRemoveStatus(StatusPriority.Connecting);
}
});
@@ -175,20 +175,20 @@ namespace WalletWasabi.Gui.ViewModels
{
if (x.BackendCompatible)
{
- TryRemoveStatus(StatusBarStatus.CriticalUpdate);
+ TryRemoveStatus(StatusPriority.CriticalUpdate);
}
else
{
- TryAddStatus(StatusBarStatus.CriticalUpdate);
+ TryAddStatus(StatusPriority.CriticalUpdate);
}
if (x.ClientUpToDate)
{
- TryRemoveStatus(StatusBarStatus.OptionalUpdate);
+ TryRemoveStatus(StatusPriority.OptionalUpdate);
}
else
{
- TryAddStatus(StatusBarStatus.OptionalUpdate);
+ TryAddStatus(StatusPriority.OptionalUpdate);
}
UpdateAvailable = !x.ClientUpToDate;
@@ -273,7 +273,7 @@ namespace WalletWasabi.Gui.ViewModels
set => this.RaiseAndSetIfChanged(ref _btcPrice, value);
}
- public StatusBarStatus Status => _status?.Value ?? StatusBarStatus.Loading;
+ public StatusPriority Status => _status?.Value ?? StatusPriority.Loading;
public bool DownloadingBlock
{
@@ -323,7 +323,7 @@ namespace WalletWasabi.Gui.ViewModels
}
}
- public void TryAddStatus(StatusBarStatus status)
+ public void TryAddStatus(StatusPriority status)
{
try
{
@@ -335,7 +335,7 @@ namespace WalletWasabi.Gui.ViewModels
}
}
- public void TryRemoveStatus(params StatusBarStatus[] statuses)
+ public void TryRemoveStatus(params StatusPriority[] statuses)
{
try
{

Renaem: use more managable names.