/[EmuXPortal]/branches/mono/EmuXPortal/Form1.cs
ViewVC logotype

Diff of /branches/mono/EmuXPortal/Form1.cs

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

--- branches/mono/EmuXPortal/Form1.cs	2019/05/06 01:31:22	391
+++ branches/mono/EmuXPortal/Form1.cs	2019/05/06 02:08:15	393
@@ -224,7 +224,7 @@
 			}
 			Application.DoEvents ();
 		}
-		private void CopyRomToLocalCache (string src_rom_file, string dst_rom_file, string src_rom_image, string dst_rom_image)
+		private void CopyRomToLocalCache (string src_emu_rom_config, string dst_emu_rom_config, string src_rom_file, string dst_rom_file, string src_rom_image, string dst_rom_image)
 		{
 			bAbortRomCopyToLocalCache = false; // reset the copy abort flag
 			progress_bar.Font = ResizeFont (GetFormFont (), PROGRESS_BAR_FONT_SIZE);
@@ -262,6 +262,19 @@
 					Application.DoEvents ();
 				}
 			}
+
+			if (!string.IsNullOrEmpty (src_emu_rom_config) && !string.IsNullOrEmpty (dst_emu_rom_config)) {
+				bAbortRomCopyToLocalCache = false;
+				cp = new FileProgressCopier (src_emu_rom_config, dst_emu_rom_config, new CopyProgressEvent (OnFileCopyProgress), new AbortEvent (OnAbortRomCopyToLocalCache));
+				cp.Start ();
+				while (!cp.CopyFinished) {
+					Application.DoEvents ();
+				}
+			}
+
+			// check if local rom emu.config is present
+			
+
 			if (this.InvokeRequired) {
 				this.Invoke ((MethodInvoker)delegate () {
 					this.Controls.Remove (progress_bar);
@@ -352,6 +365,10 @@
 					string local_romfile = string.IsNullOrEmpty(rom_filename) ? "" : OSInfo.FormatPath (string.Format ("{0}/{1}", local_rom_path, rom_filename));
 					string local_romimage = string.IsNullOrEmpty(rom_imagefilename) ? "" : OSInfo.FormatPath (string.Format ("{0}/{1}", local_rom_path, rom_imagefilename));
 
+					string emu_config = config.EmuConfig.ConfigPath;
+					
+					string local_emu_config = string.IsNullOrEmpty(emu_config) ? "" : OSInfo.FormatPath (string.Format ("{0}/{1}", local_rom_path, config.EmuConfig.ConfigFile));
+					
 					if (string.IsNullOrEmpty (local_romfile)) {
 						gLog.Error.WriteLine ("Local rom file could not be found. [src rom={0}]", rom_file);
 						return;
@@ -363,7 +380,7 @@
 						di.Create ();
 					}
 					this.Enabled = false;
-					CopyRomToLocalCache (rom_file, local_romfile, rom_image, local_romimage);
+					CopyRomToLocalCache (emu_config, local_emu_config, rom_file, local_romfile, rom_image, local_romimage);
 					this.Enabled = true;
 				}
 			}

 

  ViewVC Help
Powered by ViewVC 1.1.22