mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(WidgetXP3): better remember last used scheme.
This commit is contained in:
@@ -15,11 +15,14 @@ namespace GameRes.Formats.GUI
|
|||||||
{
|
{
|
||||||
public WidgetXP3 ()
|
public WidgetXP3 ()
|
||||||
{
|
{
|
||||||
|
var last_selected = Properties.Settings.Default.XP3Scheme;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
var keys = new[] { new KeyValuePair<string, ICrypt> (arcStrings.ArcNoEncryption, Xp3Opener.NoCryptAlgorithm) };
|
var keys = new[] { new KeyValuePair<string, ICrypt> (arcStrings.ArcNoEncryption, Xp3Opener.NoCryptAlgorithm) };
|
||||||
this.DataContext = keys.Concat (Xp3Opener.KnownSchemes.OrderBy (x => x.Key));
|
this.DataContext = keys.Concat (Xp3Opener.KnownSchemes.OrderBy (x => x.Key));
|
||||||
this.Loaded += (s, e) => {
|
this.Loaded += (s, e) => {
|
||||||
if (-1 == this.Scheme.SelectedIndex)
|
if (!string.IsNullOrEmpty (last_selected))
|
||||||
|
this.Scheme.SelectedValue = last_selected;
|
||||||
|
else
|
||||||
this.Scheme.SelectedIndex = 0;
|
this.Scheme.SelectedIndex = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user