deqeue dialog wip
MODIFY
WalletWasabi.Gui/Dialogs/CannotCloseDialogView.xaml
WalletWasabi.Gui/Dialogs/CannotCloseDialogView.xaml
<UserControl xmlns="https://github.com/avaloniaui" xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui" Design.Width="800" Design.Height="400">
<controls:GroupBox Title="Unable to Close Application" Background="{DynamicResource ThemeControlBackgroundBrush}" TextBlock.FontSize="30" BorderThickness="0" Margin="0 80">
<Grid Classes="content">
- <Panel Margin="10">
+ <Grid.RowDefinitions>
+ <RowDefinition />
+ <RowDefinition />
+ </Grid.RowDefinitions>
+ <Panel Grid.Row="0" Margin="10">
<TextBlock FontSize="15" Text="You have coins registered for CoinJoin. Please dequeue your coins and try again. DON'T WORRY, your coins are safe in case of lost internet or Tor connection, or a computer crash. The worst thing that can happen is that your coins get banned from participatin for a few hours or days if a round would progress from Registration phase before your registered coins would time out." TextWrapping="Wrap" />
</Panel>
+ <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10">
+ <controls:Spinner Height="20" Width="20" IsVisible="{Binding IsBusy}" Margin="0 0 8 0" />
+ <TextBlock Text="Dequeuing coins" />
+ </StackPanel>
</Grid>
</controls:GroupBox>
</UserControl>

MODIFY
WalletWasabi.Gui/Dialogs/CannotCloseDialogViewModel.cs
WalletWasabi.Gui/Dialogs/CannotCloseDialogViewModel.cs
@@ -3,18 +3,50 @@ using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Text;
+using System.Threading.Tasks;
namespace WalletWasabi.Gui.Dialogs
{
- internal class CannotCloseDialogViewModel : ModalDialogViewModelBase
+ internal class CannotCloseDialogViewModel : ModalDialogViewModelBase, IAsyncInitialization
{
- public CannotCloseDialogViewModel() : base("", true, false)
+ private bool _isBusy;
+
+ public bool IsBusy
+ {
+ get => _isBusy;
+ set => this.RaiseAndSetIfChanged(ref _isBusy, value);
+ }
+
+ //http://blog.stephencleary.com/2013/01/async-oop-2-constructors.html
+ public Task Initialization { get; private set; }
+
+ public CannotCloseDialogViewModel() : base("", true, true)
{
OKCommand = ReactiveCommand.Create(() =>
{
// OK pressed.
Close(true);
});
+
+ IsBusy = true;
+
+ Initialization = StartDequeueAsync();
+ }
+
+ private async Task StartDequeueAsync()
+ {
+ try
+ {
+ await Global.TryDesperateDequeueAllCoinsAsync();
+ }
+ catch (Exception ex)
+ {
+ Logger.LogWarning(ex, nameof(Global));
+ }
+ finally
+ {
+ IsBusy = false;
+ }
}
}
}

MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -86,7 +86,7 @@ namespace WalletWasabi.Gui
private static long _triedDesperateDequeuing = 0;
- private static async Task TryDesperateDequeueAllCoinsAsync()
+ public static async Task TryDesperateDequeueAllCoinsAsync()
{
try
{

deqeue dialog wip