Skip to content

Commit 500461e

Browse files
Add PassRecoveryMode
1 parent 9fe16c3 commit 500461e

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

Src/FinderOuter/ViewModels/MissingMnemonicPassViewModel.cs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@
1010
using ReactiveUI;
1111
using System;
1212
using System.Collections.Generic;
13+
using System.ComponentModel;
1314
using System.Diagnostics;
1415
using System.Linq;
1516

1617
namespace FinderOuter.ViewModels
1718
{
19+
public enum PassRecoveryMode
20+
{
21+
[Description("A password consisting of random characters")]
22+
Alphanumeric
23+
}
24+
1825
public class MissingMnemonicPassViewModel : OptionVmBase
1926
{
2027
public MissingMnemonicPassViewModel()
@@ -24,6 +31,8 @@ public MissingMnemonicPassViewModel()
2431
InputTypeList = ListHelper.GetEnumDescItems<InputType>().ToArray();
2532
SelectedInputType = InputTypeList.First();
2633
MnService = new MnemonicExtensionService(Result);
34+
PassRecoveryModeList = ListHelper.GetEnumDescItems<PassRecoveryMode>().ToArray();
35+
SelectedPassRecoveryMode = PassRecoveryModeList.First();
2736

2837
IObservable<bool> isFindEnabled = this.WhenAnyValue(
2938
x => x.Mnemonic,
@@ -51,17 +60,17 @@ public MissingMnemonicPassViewModel()
5160

5261
public override string OptionName => "Missing Mnemonic Pass";
5362
public override string Description => "This option can recover missing mnemonic passphrases also known as extra " +
54-
"or extension words. Enter the full mnemonic, a child key for comparisson and the full path of that key. " +
63+
"or extension words. Enter the mnemonic, a child key or address for comparisson and the full path of that key. " +
5564
"The path is the full BIP-32 defined path of the child key including the key's index (eg. m/44'/0'/0'/0)." +
5665
$"{Environment.NewLine}" +
57-
$"the only available case for now is when you don't know any characters of the passphrase. Enter its exact " +
58-
$"length and select the type of characters that were used in the passphrase. And finally click Find.";
66+
$"Choose a recovery mode and enter the required information. Finally click Find button.";
5967

6068

6169
public MnemonicExtensionService MnService { get; }
6270
public IEnumerable<BIP0039.WordLists> WordListsList { get; }
6371
public IEnumerable<MnemonicTypes> MnemonicTypesList { get; }
6472
public IEnumerable<DescriptiveItem<InputType>> InputTypeList { get; }
73+
public IEnumerable<DescriptiveItem<PassRecoveryMode>> PassRecoveryModeList { get; }
6574

6675
private MnemonicTypes _selMnT;
6776
public MnemonicTypes SelectedMnemonicType
@@ -84,6 +93,13 @@ public DescriptiveItem<InputType> SelectedInputType
8493
set => this.RaiseAndSetIfChanged(ref _inT, value);
8594
}
8695

96+
private DescriptiveItem<PassRecoveryMode> _recMode;
97+
public DescriptiveItem<PassRecoveryMode> SelectedPassRecoveryMode
98+
{
99+
get => _recMode;
100+
set => this.RaiseAndSetIfChanged(ref _recMode, value);
101+
}
102+
87103
private string _mnemonic;
88104
public string Mnemonic
89105
{
@@ -98,9 +114,7 @@ public int PassLength
98114
set
99115
{
100116
if (value < 1)
101-
{
102117
value = 1;
103-
}
104118

105119
this.RaiseAndSetIfChanged(ref _passLen, value);
106120
}
@@ -148,7 +162,7 @@ public bool IsSymbol
148162
set => this.RaiseAndSetIfChanged(ref _isSymbol, value);
149163
}
150164

151-
public string AllSymbols => $"Symbols ({ConstantsFO.AllSymbols})";
165+
public static string AllSymbols => $"Symbols ({ConstantsFO.AllSymbols})";
152166

153167

154168
public PasswordType PassType

Src/FinderOuter/Views/MissingMnemonicPassView.axaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,17 @@
7171
Grid.Row="1"/>
7272
</Grid>
7373

74+
<ComboBox Items="{Binding PassRecoveryModeList}"
75+
SelectedItem="{Binding SelectedPassRecoveryMode}"
76+
Grid.Column="1"
77+
Grid.Row="3">
78+
<ComboBox.ItemTemplate>
79+
<DataTemplate>
80+
<TextBlock Text="{Binding Value}"
81+
ToolTip.Tip="{Binding Description}"/>
82+
</DataTemplate>
83+
</ComboBox.ItemTemplate>
84+
</ComboBox>
85+
7486
</Grid>
7587
</UserControl>

0 commit comments

Comments
 (0)