diff options
author | sr55 <[email protected]> | 2009-12-05 17:01:08 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-12-05 17:01:08 +0000 |
commit | 8209d6c285d54482da16aa5eb7b5dfe96c2b3264 (patch) | |
tree | 046dea4474aa3ec66913845e626becd0b5dc9906 /win/C#/Presets | |
parent | 1afb478f0ef8645737284981bd1427f41389b742 (diff) |
WinGui:
- Some improvements to error messages, about window, minor code style fixes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3006 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Presets')
-rw-r--r-- | win/C#/Presets/Import.cs | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/win/C#/Presets/Import.cs b/win/C#/Presets/Import.cs index 4d6b1b43a..03f192ea1 100644 --- a/win/C#/Presets/Import.cs +++ b/win/C#/Presets/Import.cs @@ -11,25 +11,34 @@ namespace Handbrake.Presets {
public QueryParser importMacPreset(string filename)
{
- if (!File.Exists(filename))
- return null;
+ try
+ {
+ if (!File.Exists(filename))
+ return null;
- StreamReader sr = File.OpenText(filename);
- string fromfile = string.Empty;
- int fileChar;
- while ((fileChar = sr.Read()) != -1)
- fromfile += Convert.ToChar(fileChar);
+ StreamReader sr = File.OpenText(filename);
+ string fromfile = string.Empty;
+ int fileChar;
+ while ((fileChar = sr.Read()) != -1)
+ fromfile += Convert.ToChar(fileChar);
- XmlDocument doc = new XmlDocument();
- doc.LoadXml(fromfile);
+ XmlDocument doc = new XmlDocument();
+ doc.LoadXml(fromfile);
- XmlNode root = doc;
- if (!root.HasChildNodes)
+ XmlNode root = doc;
+ if (!root.HasChildNodes)
+ {
+ MessageBox.Show(
+ "The Preset file you selected appears to be invlaid or from an older version of HandBrake", "Error",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return null;
+ }
+ }
+ catch (Exception)
{
MessageBox.Show(
- "The Preset file you selected appears to be invlaid or from an older version of HandBrake", "Error",
- MessageBoxButtons.OK, MessageBoxIcon.Error);
- return null;
+ "The Preset file you selected appears to be invlaid or from an older version of HandBrake.\n\n Please note, if you are exporting from the MacGui you may need to rebuild your preset so that it uses the current preset plist format.\n The MacGui does not currently update user presets automatically.", "Error",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
}
// We'll query a query parser object and use it's public var structures to store all the data.
@@ -71,7 +80,7 @@ namespace Handbrake.Presets break;
}
}
- AudioInfo.Add(track);
+ AudioInfo.Add(track);
}
queryParsed.AudioInformation = AudioInfo;
|