summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-05-08 11:00:16 +0000
committersr55 <[email protected]>2011-05-08 11:00:16 +0000
commitc2e751e3eb2ed19163c6c2a1318eab28bcbb921b (patch)
tree2a652aefd39b11c7442136052927df1b0e9b6191 /win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
parent3d7392c9e4f114408b2fd16bd848a2e10c36fa32 (diff)
WinGui:
- Add Elapsed Encode Time the main window. - Add Elapsed Queue Time to the queue window. (Note, Pausing the queue resets this currently) - Fixed an issue with disabled controls on the audio panel after removing the last track which was passthru. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3973 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services/PresetService.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/PresetService.cs21
1 files changed, 15 insertions, 6 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
index e4f67b7db..da5f10e94 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
@@ -12,6 +12,7 @@ namespace HandBrake.ApplicationServices.Services
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
+ using System.Windows;
using System.Xml.Serialization;
using HandBrake.ApplicationServices.Model;
@@ -253,6 +254,7 @@ namespace HandBrake.ApplicationServices.Services
Description = string.Empty, // Maybe one day we will populate this.
IsBuildIn = true
};
+
this.presets.Add(newPreset);
}
}
@@ -321,15 +323,22 @@ namespace HandBrake.ApplicationServices.Services
/// </param>
private static void RecoverFromCorruptedPresetFile(string file)
{
- // Recover from Error.
- if (File.Exists(file))
+ try
{
- string disabledFile = file + ".old";
- File.Move(file, disabledFile);
+ // Recover from Error.
if (File.Exists(file))
{
- File.Delete(file);
+ string disabledFile = file + ".old";
+ File.Move(file, disabledFile);
+ if (File.Exists(file))
+ {
+ File.Delete(file);
+ }
}
+ }
+ catch(IOException)
+ {
+ // Give up
}
}
@@ -341,7 +350,7 @@ namespace HandBrake.ApplicationServices.Services
// First clear the Presets arraylists
this.presets.Clear();
- // Load in the users Presets from UserPresets.xml
+ // Load in the Presets from Presets.xml
try
{
if (File.Exists(this.builtInPresetFile))