}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Unable to import the selected preset..\r
+ /// </summary>\r
+ public static string Main_PresetImportFailed {\r
+ get {\r
+ return ResourceManager.GetString("Main_PresetImportFailed", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to The preset may be corrupted or from an older version of HandBrake which is not supported. \r
+ ///Presets from older versions must be re-created in the current version..\r
+ /// </summary>\r
+ public static string Main_PresetImportFailedSolution {\r
+ get {\r
+ return ResourceManager.GetString("Main_PresetImportFailedSolution", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to This preset appears to already exist. Would you like to overwrite it?.\r
/// </summary>\r
<data name="Main_UnableToLoadHelpSolution" xml:space="preserve">\r
<value>You can still access the help pages by visiting the website directly at: https://handbrake.fr</value>\r
</data>\r
+ <data name="Main_PresetImportFailed" xml:space="preserve">\r
+ <value>Unable to import the selected preset.</value>\r
+ </data>\r
+ <data name="Main_PresetImportFailedSolution" xml:space="preserve">\r
+ <value>The preset may be corrupted or from an older version of HandBrake which is not supported. \r
+Presets from older versions must be re-created in the current version.</value>\r
+ </data>\r
</root>
\ No newline at end of file
}\r
}\r
\r
- Preset preset = PlistPresetFactory.CreatePreset(plist);\r
+ Preset preset = null;\r
+ try\r
+ {\r
+ preset = PlistPresetFactory.CreatePreset(plist);\r
+ }\r
+ catch (Exception exc)\r
+ {\r
+ this.errorService.ShowError(Resources.Main_PresetImportFailed, Resources.Main_PresetImportFailedSolution, exc);\r
+ }\r
\r
- if (this.presetService.CheckIfPresetExists(preset.Name))\r
+ if (preset != null)\r
{\r
- if (!presetService.CanUpdatePreset(preset.Name))\r
+ if (this.presetService.CheckIfPresetExists(preset.Name))\r
{\r
- MessageBox.Show(Resources.Main_PresetErrorBuiltInName, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
- return;\r
- }\r
+ if (!presetService.CanUpdatePreset(preset.Name))\r
+ {\r
+ MessageBox.Show(Resources.Main_PresetErrorBuiltInName, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
+ return;\r
+ }\r
\r
- MessageBoxResult result =\r
- MessageBox.Show(Resources.Main_PresetOverwriteWarning, Resources.Overwrite, MessageBoxButton.YesNo, MessageBoxImage.Warning);\r
- if (result == MessageBoxResult.Yes)\r
+ MessageBoxResult result = MessageBox.Show(Resources.Main_PresetOverwriteWarning, Resources.Overwrite, MessageBoxButton.YesNo, MessageBoxImage.Warning);\r
+ if (result == MessageBoxResult.Yes)\r
+ {\r
+ presetService.Update(preset);\r
+ }\r
+ }\r
+ else\r
{\r
- presetService.Update(preset);\r
+ presetService.Add(preset);\r
}\r
}\r
- else\r
- {\r
- presetService.Add(preset);\r
- }\r
\r
this.NotifyOfPropertyChange(() => this.Presets);\r
}\r
Style="{StaticResource windowStyle}"\r
FontSize="11"\r
TextOptions.TextFormattingMode="Display"\r
- WindowStartupLocation="CenterScreen">\r
+ WindowStartupLocation="CenterOwner">\r
<Grid>\r
<Grid.RowDefinitions>\r
- <RowDefinition Height="70" />\r
+ <RowDefinition Height="Auto" />\r
<RowDefinition Height="*" />\r
<RowDefinition Height="Auto" />\r
</Grid.RowDefinitions>\r
\r
<Image Width="64"\r
Height="64"\r
- Margin="10,0,0,0"\r
+ Margin="10,4,0,4"\r
Source="Images/ErrorX.png" />\r
- <Grid Height="64" Margin="10,0,0,0">\r
+ <Grid Margin="10,0,0,0">\r
<Grid.RowDefinitions>\r
<RowDefinition Height="Auto" />\r
<RowDefinition Height="Auto" />\r
Text="{Binding ErrorMessage}" />\r
<TextBlock Grid.Row="1"\r
Margin="0,5,0,0"\r
- Text="{Binding Solution}" />\r
+ Text="{Binding Solution}" TextWrapping="Wrap" />\r
\r
<TextBlock Grid.Row="2"\r
Margin="0,0,0,2"\r