2016-10-11 04:05:22 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Windows;
|
2016-04-19 16:33:36 +08:00
|
|
|
|
using System.Windows.Input;
|
2016-10-11 04:05:22 +08:00
|
|
|
|
using GameRes;
|
2016-04-19 16:33:36 +08:00
|
|
|
|
using GARbro.GUI.Strings;
|
|
|
|
|
using Microsoft.WindowsAPICodePack.Dialogs;
|
2014-08-22 14:16:11 +08:00
|
|
|
|
|
|
|
|
|
namespace GARbro.GUI
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2015-06-14 13:05:09 +08:00
|
|
|
|
/// Interaction logic for ConvertMedia.xaml
|
2014-08-22 14:16:11 +08:00
|
|
|
|
/// </summary>
|
2015-06-14 13:05:09 +08:00
|
|
|
|
public partial class ConvertMedia : Window
|
2014-08-22 14:16:11 +08:00
|
|
|
|
{
|
2015-06-14 13:05:09 +08:00
|
|
|
|
public ConvertMedia ()
|
2014-08-22 14:16:11 +08:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent ();
|
2016-10-11 04:05:22 +08:00
|
|
|
|
ImageConversionFormat.ItemsSource = FormatCatalog.Instance.ImageFormats.Where (f => f.CanWrite);
|
2014-08-22 14:16:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-19 16:33:36 +08:00
|
|
|
|
private void BrowseExec (object sender, ExecutedRoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var dlg = new CommonOpenFileDialog
|
|
|
|
|
{
|
|
|
|
|
Title = guiStrings.TextChooseDestDir,
|
|
|
|
|
IsFolderPicker = true,
|
|
|
|
|
InitialDirectory = DestinationDir.Text,
|
|
|
|
|
|
|
|
|
|
AddToMostRecentlyUsedList = false,
|
|
|
|
|
AllowNonFileSystemItems = false,
|
|
|
|
|
EnsureFileExists = true,
|
|
|
|
|
EnsurePathExists = true,
|
|
|
|
|
EnsureReadOnly = false,
|
|
|
|
|
EnsureValidNames = true,
|
|
|
|
|
Multiselect = false,
|
|
|
|
|
ShowPlacesList = true,
|
|
|
|
|
};
|
|
|
|
|
if (dlg.ShowDialog (this) == CommonFileDialogResult.Ok)
|
|
|
|
|
DestinationDir.Text = dlg.FileName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void CanExecuteAlways (object sender, CanExecuteRoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
e.CanExecute = true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-22 14:16:11 +08:00
|
|
|
|
private void ConvertButton_Click (object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.DialogResult = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|