/[EmuXPortal]/trunk/EmuXPortal/Form1.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Form1.cs

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

--- trunk/EmuXPortal/Form1.cs	2014/08/04 10:07:53	191
+++ trunk/EmuXPortal/Form1.cs	2014/08/04 10:30:21	197
@@ -540,8 +540,31 @@
         private void gameWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { }
         private void gameWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
-            Stopwatch t = e.Result as Stopwatch;            
-            rom_flow.Controls[0].Select();
+            Stopwatch t = e.Result as Stopwatch;
+            if (rom_flow.Controls.Count > 0)
+            {
+                rom_flow.Controls[0].Select();
+            }
+            else
+            {
+                GameControl game_ctrl = new GameControl();
+                game_ctrl.Font = GetFormFont();
+                game_ctrl.Dock = DockStyle.Top;
+                game_ctrl.Width = this.Width - 10;
+                //try
+                //{
+                //    lock (gameimage_lock)
+                //    {
+                //        game_ctrl.GameImage = (Image)DefaultGameImage.Clone();
+                //    }
+                //}
+                //catch (Exception ex)
+                //{
+                //    throw ex;
+                //}
+                game_ctrl.GameName = "You haven't favorited any games, select a game and then press CTRL+F to favorite it";
+                rom_flow.Controls.Add(game_ctrl);
+            }
             t.Stop();
             log.WriteLine("RomParser took: {0}s to parse roms", (int)t.Elapsed.TotalSeconds);
         }
@@ -603,7 +626,30 @@
         private void platformWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
             Stopwatch t = e.Result as Stopwatch;
-            platform_flow.Controls[0].Select();
+            if (platform_flow.Controls.Count > 0)
+            {
+                platform_flow.Controls[0].Select();
+            }
+            else
+            {
+                PlatformControl platform_ctrl = new PlatformControl();
+                platform_ctrl.Font = GetFormFont();
+                platform_ctrl.Dock = DockStyle.Top;
+                platform_ctrl.Width = this.Width - 10;
+                //try
+                //{
+                //    lock (platformimage_lock)
+                //    {
+                //        platform_ctrl.PlatformImage = (Image)DefaultPlatformImage.Clone();
+                //    }
+                //}
+                //catch (Exception ex)
+                //{
+                //    throw ex;
+                //}
+                platform_ctrl.PlatformName = string.Format("You don't have any roms in your rompath: '{0}'",Config.RomPath);
+                platform_flow.Controls.Add(platform_ctrl);
+            }
             log.WriteLine("PlatformParser took: {0}s to parse platforms", (int)t.Elapsed.TotalSeconds);
         }
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22