diff options
author | sr55 <[email protected]> | 2011-09-26 20:57:50 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-09-26 20:57:50 +0000 |
commit | 93c56509e64cf7ac43036260037966433a65f553 (patch) | |
tree | b0ab935bd127761c09205adfd812aef1b8511f98 /win/CS/Functions | |
parent | 4c69e1c1f7afd0be88d70caedd25290422d09775 (diff) |
WinGui: Some refactoring of code that throws exceptions.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4256 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/Functions')
-rw-r--r-- | win/CS/Functions/Main.cs | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/win/CS/Functions/Main.cs b/win/CS/Functions/Main.cs index f80233066..8d88871c2 100644 --- a/win/CS/Functions/Main.cs +++ b/win/CS/Functions/Main.cs @@ -16,6 +16,7 @@ namespace Handbrake.Functions using System.Xml.Serialization;
using HandBrake.ApplicationServices;
+ using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Extensions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
@@ -135,7 +136,7 @@ namespace Handbrake.Functions /// <param name="mainWindow">Main Window</param>
/// <param name="filePathName">Path to save the csv file</param>
/// <returns>True if successful </returns>
- public static bool SaveChapterMarkersToCsv(frmMain mainWindow, string filePathName)
+ public static void SaveChapterMarkersToCsv(frmMain mainWindow, string filePathName)
{
try
{
@@ -152,12 +153,10 @@ namespace Handbrake.Functions file.Write(csv);
file.Close();
file.Dispose();
- return true;
}
catch (Exception exc)
{
- ShowExceptiowWindow("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode", exc.ToString());
- return false;
+ throw new GeneralApplicationException("Unable to save Chapter Makrers file! ", "Chapter marker names will NOT be saved in your encode.", exc);
}
}
@@ -371,7 +370,10 @@ namespace Handbrake.Functions UserSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeVersion, string.Empty);
UserSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeExeHash, string.Empty);
- ShowExceptiowWindow("Unable to retrieve version information from the CLI.", e.ToString());
+ ExceptionWindow window = new ExceptionWindow();
+ window.Setup("Unable to Initialise HandBrake \nThis error is unrecoverable. Maybe try restarting.", e.ToString());
+ window.ShowDialog();
+
Application.Exit();
}
}
@@ -466,22 +468,6 @@ namespace Handbrake.Functions }
/// <summary>
- /// Show the Exception Window
- /// </summary>
- /// <param name="shortError">
- /// The short error.
- /// </param>
- /// <param name="longError">
- /// The long error.
- /// </param>
- public static void ShowExceptiowWindow(string shortError, string longError)
- {
- ExceptionWindow window = new ExceptionWindow();
- window.Setup(shortError, longError);
- window.ShowDialog();
- }
-
- /// <summary>
/// Get The Source from the CLI Query
/// </summary>
/// <param name="query">Full CLI Query</param>
|