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(); InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractAllTo, filename); ExtractLabel.Text = string.Format (guiStrings.LabelExtractAllTo, filename);
Destination = destination; Destination = destination;
DestinationDir.EnterKeyDown += acb_OnEnterKeyDown;
ExtractImages.IsChecked = Settings.Default.appExtractImages; ExtractImages.IsChecked = Settings.Default.appExtractImages;
ExtractText.IsChecked = Settings.Default.appExtractText; ExtractText.IsChecked = Settings.Default.appExtractText;

View File

@ -97,6 +97,13 @@ namespace GARbro.GUI
return null; 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) public void CanExecuteAlways (object sender, CanExecuteRoutedEventArgs e)
{ {
e.CanExecute = true; e.CanExecute = true;

View File

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