changeset 22:ff011053ec3f

Re #242: Create Qt# UI for WarFoundry * Try resolving SIGSEGV crashes * Add more logging * Add dialog on major crash so that user gets a message somewhere other than the log file
author IBBoard <dev@ibboard.co.uk>
date Sun, 21 Feb 2010 14:55:23 +0000
parents d6e95d51b9a4
children d1259ec9d089
files Main.cs
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Main.cs	Sun Feb 21 14:51:32 2010 +0000
+++ b/Main.cs	Sun Feb 21 14:55:23 2010 +0000
@@ -16,19 +16,22 @@
 	class MainClass
 	{
 		private static ILog logger = LogManager.GetLogger(typeof(MainClass));
+		static MainWindow win;
 		
-		public static void Main (string[] args)
+		public static void Main(string[] args)
 		{
 			try
 			{
-				new QApplication (args);
+				logger.InfoFormat("Starting application with args: {0}", args.ToString());
+				new QApplication(args);
 				
-				SetUpWarFoundryEnvironment ();
+				SetUpWarFoundryEnvironment();
 				
-				MainWindow win = new MainWindow ();
-				win.Show ();
-				
-				QApplication.Exec ();
+				win = new MainWindow();
+				win.Show();
+				logger.Debug("Starting exec");
+				QApplication.Exec();
+				logger.Info("Closing application");
 			}
 			catch(Exception ex)
 			{
@@ -38,8 +41,9 @@
 				
 		}
 		
-		private static void SetUpWarFoundryEnvironment ()
+		private static void SetUpWarFoundryEnvironment()
 		{
+			logger.Debug("Creating application environment");
 			//FIXME: Temporary hack to add paths and factories before we get preferences and plugins
 			WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Path.Combine(Constants.ExecutablePath, "data")));
 			WarFoundryLoader.GetDefault().RegisterFactory(WarFoundryXmlFactory.GetFactory());
@@ -47,7 +51,7 @@
 			WarFoundrySaver.SetFileSaver(new WarFoundryXmlSaver());
 		}		
 
-		private static void FileLoadingFinished (List<FileLoadFailure> failures)
+		private static void FileLoadingFinished(List<FileLoadFailure> failures)
 		{
 			foreach(FileLoadFailure failure in failures)
 			{