added "ignore errors" option to media conversion.

This commit is contained in:
morkt 2015-06-14 13:54:03 +04:00
parent 9d88975f13
commit 30e7a470d3
9 changed files with 42 additions and 7 deletions

View File

@ -85,6 +85,9 @@
<setting name="appExtractAudio" serializeAs="String"> <setting name="appExtractAudio" serializeAs="String">
<value>True</value> <value>True</value>
</setting> </setting>
<setting name="appIgnoreConversionErrors" serializeAs="String">
<value>False</value>
</setting>
</GARbro.GUI.Properties.Settings> </GARbro.GUI.Properties.Settings>
</userSettings> </userSettings>
</configuration> </configuration>

View File

@ -14,7 +14,9 @@
ItemsSource="{Binding Source={x:Static g:FormatCatalog.Instance}, Path=ImageFormats, Mode=OneWay}" SelectedValuePath="Tag" ItemsSource="{Binding Source={x:Static g:FormatCatalog.Instance}, Path=ImageFormats, Mode=OneWay}" SelectedValuePath="Tag"
SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=appLastImageFormat, Mode=TwoWay}"/> SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=appLastImageFormat, Mode=TwoWay}"/>
</StackPanel> </StackPanel>
<TextBlock Text="{x:Static s:guiStrings.TextAudioConversion}" Margin="20,10"/> <TextBlock Text="{x:Static s:guiStrings.TextAudioConversion}" Margin="20,10,20,0"/>
<CheckBox Name="IgnoreErrors" Content="{x:Static s:guiStrings.LabelSkipFailures}" Margin="20,10"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appIgnoreConversionErrors, Mode=TwoWay}"/>
<Separator/> <Separator/>
<StackPanel Orientation="Horizontal" Margin="10,0,10,10" HorizontalAlignment="Right"> <StackPanel Orientation="Horizontal" Margin="10,0,10,10" HorizontalAlignment="Right">
<Button Content="{x:Static s:guiStrings.ButtonOK}" Click="ConvertButton_Click" Margin="10" Width="75" IsDefault="True" Height="25"/> <Button Content="{x:Static s:guiStrings.ButtonOK}" Click="ConvertButton_Click" Margin="10" Width="75" IsDefault="True" Height="25"/>

View File

@ -61,7 +61,6 @@ namespace GARbro.GUI
if (!result) if (!result)
return; return;
var format = convert_dialog.ImageConversionFormat.SelectedItem as ImageFormat; var format = convert_dialog.ImageConversionFormat.SelectedItem as ImageFormat;
// var format = FormatCatalog.Instance.ImageFormats.FirstOrDefault (f => f.Tag == selected);
if (null == format) if (null == format)
{ {
Trace.WriteLine ("Format is not selected", "ConvertMediaExec"); Trace.WriteLine ("Format is not selected", "ConvertMediaExec");
@ -71,6 +70,7 @@ namespace GARbro.GUI
{ {
Directory.SetCurrentDirectory (ViewModel.Path); Directory.SetCurrentDirectory (ViewModel.Path);
var converter = new GarConvertMedia (this); var converter = new GarConvertMedia (this);
converter.IgnoreErrors = convert_dialog.IgnoreErrors.IsChecked ?? false;
converter.Convert (source, format); converter.Convert (source, format);
} }
catch (Exception X) catch (Exception X)

View File

@ -51,5 +51,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion ("1.1.2.20")] [assembly: AssemblyVersion ("1.1.2.21")]
[assembly: AssemblyFileVersion ("1.1.2.20")] [assembly: AssemblyFileVersion ("1.1.2.21")]

View File

@ -333,5 +333,17 @@ namespace GARbro.GUI.Properties {
this["appExtractAudio"] = value; this["appExtractAudio"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool appIgnoreConversionErrors {
get {
return ((bool)(this["appIgnoreConversionErrors"]));
}
set {
this["appIgnoreConversionErrors"] = value;
}
}
} }
} }

View File

@ -80,5 +80,8 @@
<Setting Name="appExtractAudio" Type="System.Boolean" Scope="User"> <Setting Name="appExtractAudio" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<Setting Name="appIgnoreConversionErrors" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -339,6 +339,15 @@ namespace GARbro.GUI.Strings {
} }
} }
/// <summary>
/// Looks up a localized string similar to Skip incovertible files..
/// </summary>
public static string LabelSkipFailures {
get {
return ResourceManager.GetString("LabelSkipFailures", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to About Game Resource browser. /// Looks up a localized string similar to About Game Resource browser.
/// </summary> /// </summary>
@ -811,7 +820,7 @@ namespace GARbro.GUI.Strings {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Convert media. /// Looks up a localized string similar to Media conversion.
/// </summary> /// </summary>
public static string TextConvertMedia { public static string TextConvertMedia {
get { get {

View File

@ -388,7 +388,7 @@ Overwrite?</value>
<value>Choose destination format for images</value> <value>Choose destination format for images</value>
</data> </data>
<data name="TextConvertMedia" xml:space="preserve"> <data name="TextConvertMedia" xml:space="preserve">
<value>Convert media</value> <value>Media conversion</value>
</data> </data>
<data name="MsgConvertingFile" xml:space="preserve"> <data name="MsgConvertingFile" xml:space="preserve">
<value>Converting file {0}</value> <value>Converting file {0}</value>
@ -423,4 +423,7 @@ Overwrite?</value>
<data name="TextAudioConversion" xml:space="preserve"> <data name="TextAudioConversion" xml:space="preserve">
<value>Audio will be converted to either WAV, MP3 or OGG.</value> <value>Audio will be converted to either WAV, MP3 or OGG.</value>
</data> </data>
<data name="LabelSkipFailures" xml:space="preserve">
<value>Skip incovertible files.</value>
</data>
</root> </root>

View File

@ -403,7 +403,7 @@
<value>Формат преобразования изображений</value> <value>Формат преобразования изображений</value>
</data> </data>
<data name="TextConvertMedia" xml:space="preserve"> <data name="TextConvertMedia" xml:space="preserve">
<value>Преобразовать мультимедиа</value> <value>Преобразование мультимедиа</value>
</data> </data>
<data name="MsgConvertingFile" xml:space="preserve"> <data name="MsgConvertingFile" xml:space="preserve">
<value>Преобразование файла {0}</value> <value>Преобразование файла {0}</value>
@ -435,6 +435,9 @@
<data name="MsgUnableInterpretAudio" xml:space="preserve"> <data name="MsgUnableInterpretAudio" xml:space="preserve">
<value>не удалось интерпретировать формат аудио</value> <value>не удалось интерпретировать формат аудио</value>
</data> </data>
<data name="LabelSkipFailures" xml:space="preserve">
<value>Пропускать файлы, не поддавшиеся конверсии.</value>
</data>
<data name="MsgNoMediaFiles" xml:space="preserve"> <data name="MsgNoMediaFiles" xml:space="preserve">
<value>Среди выбранных файлов нет мультиемедиа.</value> <value>Среди выбранных файлов нет мультиемедиа.</value>
</data> </data>