/[EmuXPortal]/trunk/EmuXPortal/Api/ConfigLoader.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Api/ConfigLoader.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/EmuXPortal/Api/ConfigLoader.cs	2012/04/03 21:39:47	15
+++ trunk/EmuXPortal/Api/ConfigLoader.cs	2012/04/04 05:58:04	33
@@ -1,4 +1,4 @@
-#define CONFIGURATION_TESTING // when defined will use config-dbg.ini, otherwise config.ini
+//#define CONFIGURATION_TESTING // when defined will use config-dbg.ini, otherwise config.ini
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -47,14 +47,27 @@
                         {
                             reader.ReadToFollowing("ROMPATH");
                             RomPath = reader.ReadElementContentAsString();
+                            if (RomPath == "")
+                            {
+                                logger.WriteLine("\t\tROMPATH has not been configured...");
+                                MessageBox.Show("Please edit config.ini and update ROMPATH to point to your roms folder", "ROMPATH has not been configured", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                                logger.WriteLine("Terminating application...");
+                                Application.Exit();
+                            }
                             logger.WriteLine("\tROMPATH={0}", RomPath);
                             reader.ReadToFollowing("DISPLAYDEVICE");
                             DisplayDevice = reader.ReadElementContentAsString();
+                            if (DisplayDevice == "")
+                            {
+                                logger.WriteLine("\t\tDISPLAYDEVICE was an empty string...using defaults: {0}", new DisplayHelper().PhysicalDisplayDevice.DeviceName);
+                                DisplayDevice = new DisplayHelper().PhysicalDisplayDevice.DeviceName;
+                            }
                             logger.WriteLine("\tDISPLAYDEVICE={0}", DisplayDevice);
                         }
                     }
                     logger.WriteLine("Loaded Config: {0}", path);
                     loaded = true;
+
                 }
                 catch (Exception ex)
                 {

 

  ViewVC Help
Powered by ViewVC 1.1.22