[skip ci] Implement banneduntil tooltip
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
<converters:CoinStatusColorConverter x:Key="CoinStatusColorConverter" />
<converters:CoinStatusBorderBrushConverter x:Key="CoinStatusBorderBrushConverter" />
<converters:CoinStatusForegroundConverter x:Key="CoinStatusForegroundConverter" />
- <converters:CoinStatusToolTipConverter x:Key="CoinStatusToolTipConverter" />
</UserControl.Resources>
<UserControl.Styles>
<Style Selector="TextBlock">
<Path HorizontalAlignment="Left" Data="F1 M 23.7501,33.25L 34.8334,44.3333L 52.2499,22.1668L 56.9999,26.9168L 34.8334,53.8333L 19.0001,38L 23.7501,33.25 Z" Fill="#22B14C" Height="16" Width="16" Stretch="Fill" />
</Border>
- <Border ToolTip.Tip="{Binding Status, Converter={StaticResource CoinStatusToolTipConverter}}" Padding="1" Grid.Column="2" Background="{Binding Status, Converter={StaticResource CoinStatusColorConverter}}" BorderBrush="{Binding Status, Converter={StaticResource CoinStatusBorderBrushConverter}}" HorizontalAlignment="Left" BorderThickness="1" CornerRadius="0,6,6,0">
+ <Border ToolTip.Tip="{Binding ToolTip}" Padding="1" Grid.Column="2" Background="{Binding Status, Converter={StaticResource CoinStatusColorConverter}}" BorderBrush="{Binding Status, Converter={StaticResource CoinStatusBorderBrushConverter}}" HorizontalAlignment="Left" BorderThickness="1" CornerRadius="0,6,6,0">
<TextBlock Text="{Binding Status, Converter={StaticResource CoinStatusStringConverter}, Mode=OneWay}" Background="{Binding Status, Converter={StaticResource CoinStatusColorConverter}}" Foreground="{Binding Status, Converter={StaticResource CoinStatusForegroundConverter}}" />
</Border>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
@@ -9,6 +9,7 @@ using System.Reactive.Linq;
using System.Linq;
using WalletWasabi.Gui.Models;
using WalletWasabi.Models.ChaumianCoinJoin;
+using System.Globalization;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -41,7 +42,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
model.WhenAnyValue(x => x.IsBanned).ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
{
this.RaisePropertyChanged(nameof(Status));
- this.RaisePropertyChanged(nameof(BannedCoinToolTip));
});
model.WhenAnyValue(x => x.SpentAccordingToBackend).ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
@@ -49,11 +49,15 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
this.RaisePropertyChanged(nameof(Status));
});
+ this.WhenAnyValue(x => x.Status).ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
+ {
+ this.RaisePropertyChanged(nameof(ToolTip));
+ });
+
Global.IndexDownloader.WhenAnyValue(x => x.BestHeight).ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
{
this.RaisePropertyChanged(nameof(Confirmations));
this.RaisePropertyChanged(nameof(Status));
- this.RaisePropertyChanged(nameof(BannedCoinToolTip));
});
Global.ChaumianClient.StateUpdated += ChaumianClient_StateUpdated;
@@ -86,7 +90,26 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set { this.RaiseAndSetIfChanged(ref _isSelected, value); }
}
- public string BannedCoinToolTip => Model.IsBanned ? $"Banned until {Model.BannedUntilUtc.Value.ToLocalTime()}." : "This coin is not banned.";
+ public string ToolTip
+ {
+ get
+ {
+ switch (Status)
+ {
+ case SmartCoinStatus.Confirmed: return "This coin is confirmed.";
+ case SmartCoinStatus.Unconfirmed: return "This coin is unconfirmed.";
+ case SmartCoinStatus.MixingOnWaitingList: return "This coin is waiting for its turn to be coinjoined.";
+ case SmartCoinStatus.MixingBanned: return $"The coordinator banned this coin from participation until {Model.BannedUntilUtc.Value.ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture)}.";
+ case SmartCoinStatus.MixingInputRegistration: return "This coin is registered for coinjoin.";
+ case SmartCoinStatus.MixingConnectionConfirmation: return "This coin is currently in Connection Confirmation phase.";
+ case SmartCoinStatus.MixingOutputRegistration: return "This coin is currently in Output Registration phase.";
+ case SmartCoinStatus.MixingSigning: return "This coin is currently in Signing phase.";
+ case SmartCoinStatus.SpentAccordingToBackend: return "According to the Backend, this coin is spent. Wallet state will be corrected after confirmation.";
+ case SmartCoinStatus.MixingWaitingForConfirmation: return "Coinjoining unconfirmed coins is not allowed.";
+ default: return "This is impossible.";
+ }
+ }
+ }
public Money Amount => Model.Amount;

[skip ci] Implement banneduntil tooltip