accept extract dialog on enter key press.

This commit is contained in:
morkt 2014-07-30 13:59:23 +04:00
parent 9dd07eea06
commit 0003be4a4c
3 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,7 @@ namespace GARbro.GUI
InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractAllTo, filename);
Destination = destination;
DestinationDir.EnterKeyDown += acb_OnEnterKeyDown;
ExtractImages.IsChecked = Settings.Default.appExtractImages;
ExtractText.IsChecked = Settings.Default.appExtractText;

View File

@ -97,6 +97,13 @@ namespace GARbro.GUI
return null;
}
protected void acb_OnEnterKeyDown (object sender, KeyEventArgs e)
{
string path = (sender as AutoCompleteBox).Text;
if (!string.IsNullOrEmpty (path))
this.DialogResult = true;
}
public void CanExecuteAlways (object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;

View File

@ -45,6 +45,7 @@ namespace GARbro.GUI
InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractFileTo, entry.Name);
Destination = destination;
DestinationDir.EnterKeyDown += acb_OnEnterKeyDown;
if ("image" == entry.Type)
{
ImageConversionOptions.Visibility = Visibility.Visible;