(FJSYS): changed password query.

This commit is contained in:
morkt 2018-02-03 19:53:41 +04:00
parent 0257244a73
commit 73db11a6bc
3 changed files with 10 additions and 13 deletions

View File

@ -120,6 +120,13 @@ namespace GameRes.Formats.NSystem
return new FjsysOptions { MsdPassword = Properties.Settings.Default.FJSYSPassword };
}
public override ResourceOptions GetOptions (object widget)
{
if (widget is GUI.WidgetMSD)
Properties.Settings.Default.FJSYSPassword = ((GUI.WidgetMSD)widget).Password.Text;
return GetDefaultOptions();
}
public override object GetAccessWidget ()
{
return new GUI.WidgetMSD();

View File

@ -3,9 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:p="clr-namespace:GameRes.Formats.Properties">
<ComboBox Name="Title" ItemsSource="{Binding}"
SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=FJSYSPassword, Mode=OneWay}"
SelectedValuePath="Value" DisplayMemberPath="Key" SelectionChanged="Title_SelectionChanged"
SelectedValue="{Binding ElementName=Password, Path=Text, Mode=TwoWay}"
SelectedValuePath="Value" DisplayMemberPath="Key"
Width="250" HorizontalAlignment="Left"/>
<TextBox Name="Password" Text="{Binding Source={x:Static p:Settings.Default}, Path=FJSYSPassword, Mode=TwoWay}"
<TextBox Name="Password" Text="{Binding Source={x:Static p:Settings.Default}, Path=FJSYSPassword, Mode=OneWay}"
Width="250" HorizontalAlignment="Left" Margin="0,5,0,0"/>
</StackPanel>

View File

@ -17,16 +17,6 @@ namespace GameRes.Formats.GUI
InitializeComponent ();
var first = new Dictionary<string, string> { { arcStrings.ArcNoEncryption, "" } };
Title.ItemsSource = first.Concat (FjsysOpener.KnownPasswords.OrderBy (x => x.Key));
Password.Text = Settings.Default.FJSYSPassword;
}
private void Title_SelectionChanged (object sender, SelectionChangedEventArgs e)
{
if (null != this.Title.SelectedItem && null != this.Password)
{
var selected = (KeyValuePair<string, string>)this.Title.SelectedItem;
this.Password.Text = selected.Value;
}
}
}
}