Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElie Rodrigue <elie.rodrigue@nubik.ca>2017-05-24 05:39:40 +0300
committerElie Rodrigue <elie.rodrigue@nubik.ca>2017-05-24 05:39:40 +0300
commit2c71d660c158885d5398d2ff61aeea8513c2ffd2 (patch)
tree207ff97dc0cd1efdf24074d8a5a3d8bb5c43e0db
parent07ff4c5c79b71a994a62e2e5ad112f3a83b6ec23 (diff)
Rom manager
Still need to be bound with page manager Still need a cover manager
-rw-r--r--Apps/NesMiniApplication.cs6
-rw-r--r--MainForm.Designer.cs64
-rw-r--r--MainForm.cs21
-rw-r--r--MainForm.resx76
-rw-r--r--Manager/EmulatorManager.cs2
-rw-r--r--Manager/RomManager.cs154
-rw-r--r--Properties/DataSources/com.clusterrr.hakchi_gui.Manager.RomManager+Rom.datasource10
-rw-r--r--Properties/DataSources/com.clusterrr.hakchi_gui.UI.Forms.RomImporter+RomType.datasource10
-rw-r--r--Tooling/Tasks/ExtractFiles.cs45
-rw-r--r--Tooling/Tasks/ImportRoms.cs27
-rw-r--r--UI/Forms/RomImporter.Designer.cs145
-rw-r--r--UI/Forms/RomImporter.cs170
-rw-r--r--UI/Forms/RomImporter.resx126
-rw-r--r--UI/Forms/RomsList.Designer.cs116
-rw-r--r--UI/Forms/RomsList.cs25
-rw-r--r--UI/Forms/RomsList.resx129
-rw-r--r--hakchi_gui.csproj31
17 files changed, 1122 insertions, 35 deletions
diff --git a/Apps/NesMiniApplication.cs b/Apps/NesMiniApplication.cs
index 7e3b716c..d4f25376 100644
--- a/Apps/NesMiniApplication.cs
+++ b/Apps/NesMiniApplication.cs
@@ -15,7 +15,7 @@ namespace com.clusterrr.hakchi_gui
{
public class NesMiniApplication : INesMenuElement
{
-
+ private Manager.RomManager.Rom theRom;
public readonly static string GamesDirectory = Path.Combine(Program.BaseDirectoryExternal, "games");
const string DefaultReleaseDate = "1900-01-01";
const string DefaultPublisher = "UNKNOWN";
@@ -243,7 +243,9 @@ namespace com.clusterrr.hakchi_gui
if(availableEmus.Count >0)
{
toUse = availableEmus[0];
- return (NesMiniApplication)UnknowSystem.Import(fileName, sourceFile, rawRomData, toUse.Prefix[0], toUse.Executable, Manager.BitmapManager.getInstance().GetBitmap(".\\images\\" + toUse.DefaultImage), toUse.SupportZip); ;
+ NesMiniApplication app = (NesMiniApplication)UnknowSystem.Import(fileName, sourceFile, rawRomData, toUse.Prefix[0], toUse.Executable, Manager.BitmapManager.getInstance().GetBitmap(".\\images\\" + toUse.DefaultImage), toUse.SupportZip);
+ // app.theRom = Manager.RomManager.getInstance().AddRom(fileName);
+ return app;
}
else
{
diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs
index cbb0a139..82e562ca 100644
--- a/MainForm.Designer.cs
+++ b/MainForm.Designer.cs
@@ -103,10 +103,16 @@
this.openTelnetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripSeparator();
this.takeScreenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripSeparator();
+ this.fetchOriginalGamesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gitHubPageWithActualReleasesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fAQToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.romManagerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.viewAvailableRomsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.viewRomsInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.label5 = new System.Windows.Forms.Label();
this.buttonAddGames = new System.Windows.Forms.Button();
this.statusStrip = new System.Windows.Forms.StatusStrip();
@@ -120,8 +126,6 @@
this.timerConnectionCheck = new System.Windows.Forms.Timer(this.components);
this.gameDetail1 = new com.clusterrr.hakchi_gui.UI.Components.GameDetail();
this.gameSelecter1 = new com.clusterrr.hakchi_gui.UI.Components.GameSelecter();
- this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripSeparator();
- this.fetchOriginalGamesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip.SuspendLayout();
this.statusStrip.SuspendLayout();
this.SuspendLayout();
@@ -134,7 +138,8 @@
this.modulesToolStripMenuItem,
this.settingsToolStripMenuItem,
this.toolsToolStripMenuItem,
- this.helpToolStripMenuItem});
+ this.helpToolStripMenuItem,
+ this.romManagerToolStripMenuItem});
resources.ApplyResources(this.menuStrip, "menuStrip");
this.menuStrip.Name = "menuStrip";
//
@@ -656,6 +661,17 @@
resources.ApplyResources(this.takeScreenshotToolStripMenuItem, "takeScreenshotToolStripMenuItem");
this.takeScreenshotToolStripMenuItem.Click += new System.EventHandler(this.takeScreenshotToolStripMenuItem_Click);
//
+ // toolStripMenuItem9
+ //
+ this.toolStripMenuItem9.Name = "toolStripMenuItem9";
+ resources.ApplyResources(this.toolStripMenuItem9, "toolStripMenuItem9");
+ //
+ // fetchOriginalGamesToolStripMenuItem
+ //
+ this.fetchOriginalGamesToolStripMenuItem.Name = "fetchOriginalGamesToolStripMenuItem";
+ resources.ApplyResources(this.fetchOriginalGamesToolStripMenuItem, "fetchOriginalGamesToolStripMenuItem");
+ this.fetchOriginalGamesToolStripMenuItem.Click += new System.EventHandler(this.fetchOriginalGamesToolStripMenuItem_Click);
+ //
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -683,6 +699,33 @@
resources.ApplyResources(this.aboutToolStripMenuItem, "aboutToolStripMenuItem");
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
+ // romManagerToolStripMenuItem
+ //
+ this.romManagerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.importToolStripMenuItem,
+ this.viewAvailableRomsToolStripMenuItem,
+ this.viewRomsInfoToolStripMenuItem});
+ this.romManagerToolStripMenuItem.Name = "romManagerToolStripMenuItem";
+ resources.ApplyResources(this.romManagerToolStripMenuItem, "romManagerToolStripMenuItem");
+ //
+ // importToolStripMenuItem
+ //
+ this.importToolStripMenuItem.Name = "importToolStripMenuItem";
+ resources.ApplyResources(this.importToolStripMenuItem, "importToolStripMenuItem");
+ this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click);
+ //
+ // viewAvailableRomsToolStripMenuItem
+ //
+ this.viewAvailableRomsToolStripMenuItem.Name = "viewAvailableRomsToolStripMenuItem";
+ resources.ApplyResources(this.viewAvailableRomsToolStripMenuItem, "viewAvailableRomsToolStripMenuItem");
+ this.viewAvailableRomsToolStripMenuItem.Click += new System.EventHandler(this.viewAvailableRomsToolStripMenuItem_Click);
+ //
+ // viewRomsInfoToolStripMenuItem
+ //
+ this.viewRomsInfoToolStripMenuItem.Name = "viewRomsInfoToolStripMenuItem";
+ resources.ApplyResources(this.viewRomsInfoToolStripMenuItem, "viewRomsInfoToolStripMenuItem");
+ this.viewRomsInfoToolStripMenuItem.Click += new System.EventHandler(this.viewRomsInfoToolStripMenuItem_Click);
+ //
// label5
//
resources.ApplyResources(this.label5, "label5");
@@ -769,17 +812,6 @@
resources.ApplyResources(this.gameSelecter1, "gameSelecter1");
this.gameSelecter1.Name = "gameSelecter1";
//
- // toolStripMenuItem9
- //
- this.toolStripMenuItem9.Name = "toolStripMenuItem9";
- resources.ApplyResources(this.toolStripMenuItem9, "toolStripMenuItem9");
- //
- // fetchOriginalGamesToolStripMenuItem
- //
- this.fetchOriginalGamesToolStripMenuItem.Name = "fetchOriginalGamesToolStripMenuItem";
- resources.ApplyResources(this.fetchOriginalGamesToolStripMenuItem, "fetchOriginalGamesToolStripMenuItem");
- this.fetchOriginalGamesToolStripMenuItem.Click += new System.EventHandler(this.fetchOriginalGamesToolStripMenuItem_Click);
- //
// MainForm
//
this.AllowDrop = true;
@@ -905,6 +937,10 @@
private UI.Components.GameSelecter gameSelecter1;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem9;
private System.Windows.Forms.ToolStripMenuItem fetchOriginalGamesToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem romManagerToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem viewAvailableRomsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem viewRomsInfoToolStripMenuItem;
}
}
diff --git a/MainForm.cs b/MainForm.cs
index e1f672a9..2828432c 100644
--- a/MainForm.cs
+++ b/MainForm.cs
@@ -1150,5 +1150,26 @@ namespace com.clusterrr.hakchi_gui
}
+
+ private void importToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ UI.Forms.RomImporter ri = new UI.Forms.RomImporter();
+ ri.LoadRoms("D:\\Roms\\NES\\");
+ ri.ShowDialog();
+ }
+
+ private void viewRomsInfoToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ UI.Forms.RomImporter ri = new UI.Forms.RomImporter();
+ ri.SetInfoOnly();
+ ri.LoadRoms(Manager.RomManager.getInstance().RomFolder);
+ ri.ShowDialog();
+ }
+
+ private void viewAvailableRomsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ UI.Forms.RomsList rl = new UI.Forms.RomsList();
+ rl.ShowDialog();
+ }
}
} \ No newline at end of file
diff --git a/MainForm.resx b/MainForm.resx
index 8a2141f5..7ab5c53b 100644
--- a/MainForm.resx
+++ b/MainForm.resx
@@ -608,6 +608,30 @@
<data name="helpToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Help</value>
</data>
+ <data name="importToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>178, 22</value>
+ </data>
+ <data name="importToolStripMenuItem.Text" xml:space="preserve">
+ <value>Import</value>
+ </data>
+ <data name="viewAvailableRomsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>178, 22</value>
+ </data>
+ <data name="viewAvailableRomsToolStripMenuItem.Text" xml:space="preserve">
+ <value>View available roms</value>
+ </data>
+ <data name="viewRomsInfoToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>178, 22</value>
+ </data>
+ <data name="viewRomsInfoToolStripMenuItem.Text" xml:space="preserve">
+ <value>View roms info</value>
+ </data>
+ <data name="romManagerToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>94, 20</value>
+ </data>
+ <data name="romManagerToolStripMenuItem.Text" xml:space="preserve">
+ <value>Rom Manager</value>
+ </data>
<data name="menuStrip.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
@@ -783,10 +807,10 @@
<value>775, 17</value>
</metadata>
<data name="gameDetail1.Location" type="System.Drawing.Point, System.Drawing">
- <value>306, 18</value>
+ <value>306, 27</value>
</data>
<data name="gameDetail1.Size" type="System.Drawing.Size, System.Drawing">
- <value>299, 538</value>
+ <value>299, 529</value>
</data>
<data name="gameDetail1.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
@@ -2415,6 +2439,18 @@
<data name="&gt;&gt;takeScreenshotToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
+ <data name="&gt;&gt;toolStripMenuItem9.Name" xml:space="preserve">
+ <value>toolStripMenuItem9</value>
+ </data>
+ <data name="&gt;&gt;toolStripMenuItem9.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name="&gt;&gt;fetchOriginalGamesToolStripMenuItem.Name" xml:space="preserve">
+ <value>fetchOriginalGamesToolStripMenuItem</value>
+ </data>
+ <data name="&gt;&gt;fetchOriginalGamesToolStripMenuItem.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
<data name="&gt;&gt;helpToolStripMenuItem.Name" xml:space="preserve">
<value>helpToolStripMenuItem</value>
</data>
@@ -2439,6 +2475,30 @@
<data name="&gt;&gt;aboutToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
+ <data name="&gt;&gt;romManagerToolStripMenuItem.Name" xml:space="preserve">
+ <value>romManagerToolStripMenuItem</value>
+ </data>
+ <data name="&gt;&gt;romManagerToolStripMenuItem.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name="&gt;&gt;importToolStripMenuItem.Name" xml:space="preserve">
+ <value>importToolStripMenuItem</value>
+ </data>
+ <data name="&gt;&gt;importToolStripMenuItem.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name="&gt;&gt;viewAvailableRomsToolStripMenuItem.Name" xml:space="preserve">
+ <value>viewAvailableRomsToolStripMenuItem</value>
+ </data>
+ <data name="&gt;&gt;viewAvailableRomsToolStripMenuItem.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name="&gt;&gt;viewRomsInfoToolStripMenuItem.Name" xml:space="preserve">
+ <value>viewRomsInfoToolStripMenuItem</value>
+ </data>
+ <data name="&gt;&gt;viewRomsInfoToolStripMenuItem.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
<data name="&gt;&gt;toolStripStatusConnectionIcon.Name" xml:space="preserve">
<value>toolStripStatusConnectionIcon</value>
</data>
@@ -2481,18 +2541,6 @@
<data name="&gt;&gt;timerConnectionCheck.Type" xml:space="preserve">
<value>System.Windows.Forms.Timer, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
- <data name="&gt;&gt;toolStripMenuItem9.Name" xml:space="preserve">
- <value>toolStripMenuItem9</value>
- </data>
- <data name="&gt;&gt;toolStripMenuItem9.Type" xml:space="preserve">
- <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name="&gt;&gt;fetchOriginalGamesToolStripMenuItem.Name" xml:space="preserve">
- <value>fetchOriginalGamesToolStripMenuItem</value>
- </data>
- <data name="&gt;&gt;fetchOriginalGamesToolStripMenuItem.Type" xml:space="preserve">
- <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MainForm</value>
</data>
diff --git a/Manager/EmulatorManager.cs b/Manager/EmulatorManager.cs
index 2a7b45e3..1c15e7ea 100644
--- a/Manager/EmulatorManager.cs
+++ b/Manager/EmulatorManager.cs
@@ -185,7 +185,7 @@ namespace com.clusterrr.hakchi_gui.Manager
{
foreach (string ext in sde.Extensions)
{
- if (ext == extension)
+ if (ext.ToLower() == extension.ToLower())
{
ret = true;
break;
diff --git a/Manager/RomManager.cs b/Manager/RomManager.cs
new file mode 100644
index 00000000..b27e3d2a
--- /dev/null
+++ b/Manager/RomManager.cs
@@ -0,0 +1,154 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+namespace com.clusterrr.hakchi_gui.Manager
+{
+ public class RomManager
+ {
+ public string RomFolder = System.IO.Path.Combine(Program.BaseDirectoryExternal, "roms");
+ public delegate void RomModificationHandler (Rom modifiedRom);
+ public event RomModificationHandler RomAdded;
+ public class Rom
+ {
+
+ public Rom(string filePath)
+ {
+ LocalPath = filePath;
+
+
+ }
+ public string Size
+ {
+ get
+ {
+ return Math.Round(((new System.IO.FileInfo(LocalPath)).Length / 1024.0 / 1024.0), 2).ToString() + " mB";
+ }
+ }
+ public string Extension
+ {
+ get
+ {
+ return System.IO.Path.GetExtension(LocalPath);
+ }
+ }
+ public string LocalPath { get; set; }
+
+ public string DetectedName
+ {
+ get
+ {
+ string ret = System.IO.Path.GetFileNameWithoutExtension(LocalPath);
+ ret = Regex.Replace(ret, @" ?\(.*?\)", string.Empty).Trim();
+ ret = Regex.Replace(ret, @" ?\[.*?\]", string.Empty).Trim();
+ ret = ret.Replace("_", " ").Replace(" ", " ").Trim();
+ return ret;
+ }
+
+ }
+ }
+ private RomManager()
+ {
+ LoadLibrary();
+ }
+ public List<Rom> GetLibrary()
+ {
+ List<Rom> ret = new List<Rom>();
+ ret.AddRange(_RomLibrary);
+ return ret;
+ }
+ private void LoadLibrary()
+ {
+ string[] subFiles = System.IO.Directory.GetFiles(RomFolder, "*.*", System.IO.SearchOption.AllDirectories);
+ foreach(string s in subFiles)
+ {
+ AddRom(s);
+ }
+ }
+ private bool IsRomInLibrary(string localPath)
+ {
+ bool ret = false;
+ foreach (Rom r in _RomLibrary)
+ {
+ if (localPath.ToLower() == r.LocalPath.ToLower())
+ {
+ ret = true;
+ break;
+ }
+ }
+ return ret;
+ }
+ public Rom GetRom(string filePath)
+ {
+ Rom ret = null;
+
+ foreach (Rom r in _RomLibrary)
+ {
+ if (filePath.ToLower() == r.LocalPath.ToLower())
+ {
+ ret = r;
+ break;
+ }
+ }
+ /* if(ret == null)
+ {
+ ret = AddRom(filePath);
+ }
+ */
+ return ret;
+ }
+ public Rom AddRom(string filePath)
+ {
+ Rom ret = null;
+
+ if (System.IO.File.Exists(filePath))
+ {
+ string destinationPath = System.IO.Path.Combine(RomFolder, System.IO.Path.GetExtension(filePath).Replace(".", "") + "\\" + System.IO.Path.GetFileName(filePath));
+ string ext = System.IO.Path.GetExtension(filePath);
+ // if (EmulatorManager.getInstance().isFileValidRom(ext))
+ {
+ if (!IsRomInLibrary(destinationPath))
+ {
+ if (destinationPath != filePath)
+ {
+ string folder = System.IO.Path.GetDirectoryName(destinationPath);
+ if (!System.IO.Directory.Exists(folder))
+ {
+ System.IO.Directory.CreateDirectory(folder);
+ }
+ if (System.IO.File.Exists(destinationPath))
+ {
+ System.IO.File.Delete(destinationPath);
+ }
+ System.IO.File.Copy(filePath, destinationPath);
+ }
+ ret = new Rom(destinationPath);
+
+ _RomLibrary.Add(ret);
+ if(RomAdded != null)
+ {
+ RomAdded(ret);
+ }
+ }
+ else
+ {
+ ret = GetRom(destinationPath);
+ }
+ }
+ }
+ return ret;
+ }
+
+ private List<Rom> _RomLibrary = new List<Rom>();
+ private static RomManager instance;
+ public static RomManager getInstance()
+ {
+ if (instance == null)
+ {
+ instance = new RomManager();
+ }
+ return instance;
+ }
+ }
+}
diff --git a/Properties/DataSources/com.clusterrr.hakchi_gui.Manager.RomManager+Rom.datasource b/Properties/DataSources/com.clusterrr.hakchi_gui.Manager.RomManager+Rom.datasource
new file mode 100644
index 00000000..aa0123db
--- /dev/null
+++ b/Properties/DataSources/com.clusterrr.hakchi_gui.Manager.RomManager+Rom.datasource
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ This file is automatically generated by Visual Studio .Net. It is
+ used to store generic object data source configuration information.
+ Renaming the file extension or editing the content of this file may
+ cause the file to be unrecognizable by the program.
+-->
+<GenericObjectDataSource DisplayName="RomManager+Rom" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
+ <TypeInfo>com.clusterrr.hakchi_gui.Manager.RomManager+Rom, hakchi, Version=2.0.17.19, Culture=neutral, PublicKeyToken=null</TypeInfo>
+</GenericObjectDataSource> \ No newline at end of file
diff --git a/Properties/DataSources/com.clusterrr.hakchi_gui.UI.Forms.RomImporter+RomType.datasource b/Properties/DataSources/com.clusterrr.hakchi_gui.UI.Forms.RomImporter+RomType.datasource
new file mode 100644
index 00000000..82c1b651
--- /dev/null
+++ b/Properties/DataSources/com.clusterrr.hakchi_gui.UI.Forms.RomImporter+RomType.datasource
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ This file is automatically generated by Visual Studio .Net. It is
+ used to store generic object data source configuration information.
+ Renaming the file extension or editing the content of this file may
+ cause the file to be unrecognizable by the program.
+-->
+<GenericObjectDataSource DisplayName="RomImporter+RomType" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
+ <TypeInfo>com.clusterrr.hakchi_gui.UI.Forms.RomImporter+RomType, hakchi, Version=2.0.17.19, Culture=neutral, PublicKeyToken=null</TypeInfo>
+</GenericObjectDataSource> \ No newline at end of file
diff --git a/Tooling/Tasks/ExtractFiles.cs b/Tooling/Tasks/ExtractFiles.cs
new file mode 100644
index 00000000..816d56fb
--- /dev/null
+++ b/Tooling/Tasks/ExtractFiles.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace com.clusterrr.hakchi_gui.Tooling.Tasks
+{
+
+ class ExtractFiles : TaskableTool
+ {
+
+ Dictionary<string, string> _filesToDir;
+ public ExtractFiles(Dictionary<string,string> filesToDirectory) : base("Extracting roms")
+ {
+ _filesToDir = filesToDirectory;
+ }
+ public override void Execute()
+ {
+ SevenZip.SevenZipExtractor.SetLibraryPath(System.IO.Path.Combine(Program.BaseDirectoryInternal, IntPtr.Size == 8 ? @"tools\7z64.dll" : @"tools\7z.dll"));
+ int done = 0;
+ foreach (string f in _filesToDir.Keys)
+ {
+ using (var szExtractor = new SevenZip.SevenZipExtractor(f))
+ {
+
+ ReportStatus("Extracting " + f);
+ try
+ {
+ System.IO.Directory.CreateDirectory(_filesToDir[f]);
+ szExtractor.ExtractArchive(_filesToDir[f]);
+ done++;
+ }
+ catch(Exception exc)
+ {
+ ReportError("Cannot extract " + f + "\r\n" + exc.Message, false);
+ }
+ ReportProgress(done * 100 / _filesToDir.Count);
+
+ }
+ }
+ ReportCompleted();
+ }
+
+ }
+}
diff --git a/Tooling/Tasks/ImportRoms.cs b/Tooling/Tasks/ImportRoms.cs
new file mode 100644
index 00000000..82460ae0
--- /dev/null
+++ b/Tooling/Tasks/ImportRoms.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace com.clusterrr.hakchi_gui.Tooling.Tasks
+{
+ class ImportRoms:TaskableTool
+ {
+ List<string> _ToImport;
+ public ImportRoms(List<string> toImport):base("Import roms")
+ {
+ _ToImport = toImport;
+ }
+ public override void Execute()
+ {
+ ReportStatus("Importing...");
+ for (int x = 0; x < _ToImport.Count; x++)
+ {
+ ReportStatus("Importing " + System.IO.Path.GetFileName(_ToImport[x]));
+ Manager.RomManager.getInstance().AddRom(_ToImport[x]);
+ ReportProgress((x + 1) * 100 / _ToImport.Count);
+ }
+ ReportCompleted();
+ }
+ }
+}
diff --git a/UI/Forms/RomImporter.Designer.cs b/UI/Forms/RomImporter.Designer.cs
new file mode 100644
index 00000000..c88a9e6c
--- /dev/null
+++ b/UI/Forms/RomImporter.Designer.cs
@@ -0,0 +1,145 @@
+namespace com.clusterrr.hakchi_gui.UI.Forms
+{
+ partial class RomImporter
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.dataGridView1 = new System.Windows.Forms.DataGridView();
+ this.romTypeBindingSource = new System.Windows.Forms.BindingSource(this.components);
+ this.extensionDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.importDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ this.romCountDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.sizeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.btnImport = new System.Windows.Forms.Button();
+ this.button1 = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.romTypeBindingSource)).BeginInit();
+ this.SuspendLayout();
+ //
+ // dataGridView1
+ //
+ this.dataGridView1.AllowUserToAddRows = false;
+ this.dataGridView1.AllowUserToDeleteRows = false;
+ this.dataGridView1.AllowUserToOrderColumns = true;
+ this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.dataGridView1.AutoGenerateColumns = false;
+ this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.extensionDataGridViewTextBoxColumn,
+ this.importDataGridViewCheckBoxColumn,
+ this.romCountDataGridViewTextBoxColumn,
+ this.sizeDataGridViewTextBoxColumn});
+ this.dataGridView1.DataSource = this.romTypeBindingSource;
+ this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
+ this.dataGridView1.Location = new System.Drawing.Point(2, 1);
+ this.dataGridView1.MultiSelect = false;
+ this.dataGridView1.Name = "dataGridView1";
+ this.dataGridView1.Size = new System.Drawing.Size(444, 301);
+ this.dataGridView1.TabIndex = 0;
+ //
+ // romTypeBindingSource
+ //
+ this.romTypeBindingSource.DataSource = typeof(com.clusterrr.hakchi_gui.UI.Forms.RomImporter.RomType);
+ this.romTypeBindingSource.CurrentChanged += new System.EventHandler(this.romTypeBindingSource_CurrentChanged);
+ //
+ // extensionDataGridViewTextBoxColumn
+ //
+ this.extensionDataGridViewTextBoxColumn.DataPropertyName = "extension";
+ this.extensionDataGridViewTextBoxColumn.HeaderText = "extension";
+ this.extensionDataGridViewTextBoxColumn.Name = "extensionDataGridViewTextBoxColumn";
+ this.extensionDataGridViewTextBoxColumn.ReadOnly = true;
+ //
+ // importDataGridViewCheckBoxColumn
+ //
+ this.importDataGridViewCheckBoxColumn.DataPropertyName = "import";
+ this.importDataGridViewCheckBoxColumn.HeaderText = "import";
+ this.importDataGridViewCheckBoxColumn.Name = "importDataGridViewCheckBoxColumn";
+ //
+ // romCountDataGridViewTextBoxColumn
+ //
+ this.romCountDataGridViewTextBoxColumn.DataPropertyName = "RomCount";
+ this.romCountDataGridViewTextBoxColumn.HeaderText = "RomCount";
+ this.romCountDataGridViewTextBoxColumn.Name = "romCountDataGridViewTextBoxColumn";
+ this.romCountDataGridViewTextBoxColumn.ReadOnly = true;
+ //
+ // sizeDataGridViewTextBoxColumn
+ //
+ this.sizeDataGridViewTextBoxColumn.DataPropertyName = "Size";
+ this.sizeDataGridViewTextBoxColumn.HeaderText = "Size";
+ this.sizeDataGridViewTextBoxColumn.Name = "sizeDataGridViewTextBoxColumn";
+ this.sizeDataGridViewTextBoxColumn.ReadOnly = true;
+ //
+ // btnImport
+ //
+ this.btnImport.Location = new System.Drawing.Point(361, 308);
+ this.btnImport.Name = "btnImport";
+ this.btnImport.Size = new System.Drawing.Size(75, 23);
+ this.btnImport.TabIndex = 1;
+ this.btnImport.Text = "Import!";
+ this.btnImport.UseVisualStyleBackColor = true;
+ this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(12, 308);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "Cancel";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // RomImporter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(448, 339);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.btnImport);
+ this.Controls.Add(this.dataGridView1);
+ this.Name = "RomImporter";
+ this.Text = "RomImporter";
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.romTypeBindingSource)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.DataGridView dataGridView1;
+ private System.Windows.Forms.BindingSource romTypeBindingSource;
+ private System.Windows.Forms.DataGridViewTextBoxColumn extensionDataGridViewTextBoxColumn;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn importDataGridViewCheckBoxColumn;
+ private System.Windows.Forms.DataGridViewTextBoxColumn romCountDataGridViewTextBoxColumn;
+ private System.Windows.Forms.DataGridViewTextBoxColumn sizeDataGridViewTextBoxColumn;
+ private System.Windows.Forms.Button btnImport;
+ private System.Windows.Forms.Button button1;
+ }
+} \ No newline at end of file
diff --git a/UI/Forms/RomImporter.cs b/UI/Forms/RomImporter.cs
new file mode 100644
index 00000000..250b7993
--- /dev/null
+++ b/UI/Forms/RomImporter.cs
@@ -0,0 +1,170 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace com.clusterrr.hakchi_gui.UI.Forms
+{
+ public partial class RomImporter : Form
+ {
+ bool _InfoOnly = false;
+ public void SetInfoOnly()
+ {
+ _InfoOnly = true;
+ importDataGridViewCheckBoxColumn.Visible = false;
+ this.Text = "Rom informations";
+ btnImport.Hide();
+ }
+ public RomImporter()
+ {
+ InitializeComponent();
+ this.Shown += RomImporter_Shown;
+ }
+
+ private void RomImporter_Shown(object sender, EventArgs e)
+ {
+
+ }
+ private RomType[] LoadRoms(string folder, bool skipZip)
+ {
+ string[] roms = System.IO.Directory.GetFiles(folder, "*.*", System.IO.SearchOption.AllDirectories);
+ Dictionary<string, RomType> typesToImport = new Dictionary<string, RomType>();
+ int zipcount = 0;
+ List<string> compressed = new List<string>();
+ foreach (String r in roms)
+ {
+ string ext = System.IO.Path.GetExtension(r).ToLower();
+ if (!typesToImport.ContainsKey(ext))
+ {
+ typesToImport[ext] = new RomType();
+ typesToImport[ext].extension = ext;
+ typesToImport[ext].import = true;
+ }
+ typesToImport[ext].romsPath.Add(r);
+ if (ext == ".zip" || ext == ".7z" || ext == ".rar")
+ {
+ zipcount++;
+ compressed.Add(r);
+ }
+ }
+ if (!skipZip && !_InfoOnly)
+ {
+ /*Check if unzip required*/
+ if (zipcount > 0)
+ {
+ if (MessageBox.Show("It appears you are importing compressed files (" + zipcount.ToString() + "), uncompressing them will allow better emulator detection.\r\nDo you want to automatically extract them? \r\nClicking No will keep them as is.", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+ {
+ if (System.IO.Directory.Exists(".\\RomsTemp\\"))
+ {
+ System.IO.Directory.Delete(".\\RomsTemp\\",true);
+ }
+ System.IO.Directory.CreateDirectory(".\\RomsTemp\\");
+ Dictionary<string, string> fToDir = new Dictionary<string, string>();
+
+ foreach (string f in compressed)
+ {
+
+ string filename = System.IO.Path.GetFileName(f);
+ string tf = System.IO.Path.Combine(".\\RomsTemp\\", filename + "\\");
+ fToDir[f] = tf;
+ }
+ AsyncTask at = new AsyncTask(new Tooling.Tasks.ExtractFiles(fToDir));
+ at.ShowDialog();
+ RomType[] added = LoadRoms(".\\RomsTemp\\", true);
+ foreach(RomType rt in added)
+ {
+ if(!typesToImport.ContainsKey(rt.extension))
+ {
+ typesToImport[rt.extension] = rt;
+ }
+ else
+ {
+ typesToImport[rt.extension].romsPath.AddRange(rt.romsPath);
+ }
+ }
+ typesToImport.Remove(".zip");
+ typesToImport.Remove(".7z");
+ typesToImport.Remove(".rar");
+ }
+ }
+ }
+ return typesToImport.Values.ToArray() ;
+ }
+ public void LoadRoms(string folder)
+ {
+
+
+ romTypeBindingSource.Clear();
+ foreach (RomType rt in LoadRoms(folder,false))
+ {
+ romTypeBindingSource.Add(rt);
+ }
+ // dataGridView1.DataSource = typesToImport.Values;
+ // dataGridView1.Rows.AddRange(typesToImport.Values.ToArray());
+ }
+ public class RomType
+ {
+ public string extension { get; set; }
+ public bool import { get; set; }
+ public List<string> romsPath = new List<string>();
+ public string Size
+ {
+ get
+ {
+ double total = 0;
+ foreach(string file in romsPath)
+ {
+ System.IO.FileInfo fi = new System.IO.FileInfo(file);
+ total = total + fi.Length;
+
+ }
+ double d = (total / 1024.0 / 1024.0);
+
+ return Math.Round(d,1).ToString() + " mB";
+ }
+ }
+ public int RomCount { get
+ {
+ return romsPath.Count;
+ }
+ }
+ }
+
+ private void romTypeBindingSource_CurrentChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (System.IO.Directory.Exists(".\\RomsTemp\\"))
+ {
+ System.IO.Directory.Delete(".\\RomsTemp\\", true);
+ }
+ this.Close();
+ }
+
+ private void btnImport_Click(object sender, EventArgs e)
+ {
+ List<string> toImport = new List<string>();
+ foreach(RomType rt in romTypeBindingSource.List)
+ {
+ if(rt.import)
+ {
+ toImport.AddRange(rt.romsPath);
+ }
+ }
+ AsyncTask at = new AsyncTask(new Tooling.Tasks.ImportRoms(toImport));
+ at.ShowDialog();
+ if (System.IO.Directory.Exists(".\\RomsTemp\\"))
+ {
+ System.IO.Directory.Delete(".\\RomsTemp\\", true);
+ }
+ this.Close();
+ }
+ }
+}
diff --git a/UI/Forms/RomImporter.resx b/UI/Forms/RomImporter.resx
new file mode 100644
index 00000000..af5f6afc
--- /dev/null
+++ b/UI/Forms/RomImporter.resx
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="romTypeBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="romTypeBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root> \ No newline at end of file
diff --git a/UI/Forms/RomsList.Designer.cs b/UI/Forms/RomsList.Designer.cs
new file mode 100644
index 00000000..1625dec0
--- /dev/null
+++ b/UI/Forms/RomsList.Designer.cs
@@ -0,0 +1,116 @@
+namespace com.clusterrr.hakchi_gui.UI.Forms
+{
+ partial class RomsList
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.dataGridView1 = new System.Windows.Forms.DataGridView();
+ this.romBindingSource = new System.Windows.Forms.BindingSource(this.components);
+ this.detectedNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Extension = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.SizeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.localPathDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.romBindingSource)).BeginInit();
+ this.SuspendLayout();
+ //
+ // dataGridView1
+ //
+ this.dataGridView1.AllowUserToAddRows = false;
+ this.dataGridView1.AllowUserToDeleteRows = false;
+ this.dataGridView1.AllowUserToOrderColumns = true;
+ this.dataGridView1.AutoGenerateColumns = false;
+ this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.detectedNameDataGridViewTextBoxColumn,
+ this.Extension,
+ this.SizeColumn,
+ this.localPathDataGridViewTextBoxColumn});
+ this.dataGridView1.DataSource = this.romBindingSource;
+ this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dataGridView1.Location = new System.Drawing.Point(0, 0);
+ this.dataGridView1.Name = "dataGridView1";
+ this.dataGridView1.Size = new System.Drawing.Size(518, 388);
+ this.dataGridView1.TabIndex = 0;
+ //
+ // romBindingSource
+ //
+ this.romBindingSource.DataSource = typeof(com.clusterrr.hakchi_gui.Manager.RomManager.Rom);
+ //
+ // detectedNameDataGridViewTextBoxColumn
+ //
+ this.detectedNameDataGridViewTextBoxColumn.DataPropertyName = "DetectedName";
+ this.detectedNameDataGridViewTextBoxColumn.HeaderText = "DetectedName";
+ this.detectedNameDataGridViewTextBoxColumn.Name = "detectedNameDataGridViewTextBoxColumn";
+ this.detectedNameDataGridViewTextBoxColumn.ReadOnly = true;
+ //
+ // Extension
+ //
+ this.Extension.DataPropertyName = "Extension";
+ this.Extension.HeaderText = "Extension";
+ this.Extension.Name = "Extension";
+ this.Extension.ReadOnly = true;
+ //
+ // Size
+ //
+ this.SizeColumn.DataPropertyName = "Size";
+ this.SizeColumn.HeaderText = "Size";
+ this.SizeColumn.Name = "Size";
+ this.SizeColumn.ReadOnly = true;
+ //
+ // localPathDataGridViewTextBoxColumn
+ //
+ this.localPathDataGridViewTextBoxColumn.DataPropertyName = "LocalPath";
+ this.localPathDataGridViewTextBoxColumn.HeaderText = "LocalPath";
+ this.localPathDataGridViewTextBoxColumn.Name = "localPathDataGridViewTextBoxColumn";
+ this.localPathDataGridViewTextBoxColumn.ReadOnly = true;
+ //
+ // RomsList
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(518, 388);
+ this.Controls.Add(this.dataGridView1);
+ this.Name = "RomsList";
+ this.Text = "RomsList";
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.romBindingSource)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.DataGridView dataGridView1;
+ private System.Windows.Forms.BindingSource romBindingSource;
+ private System.Windows.Forms.DataGridViewTextBoxColumn detectedNameDataGridViewTextBoxColumn;
+ private System.Windows.Forms.DataGridViewTextBoxColumn Extension;
+ private System.Windows.Forms.DataGridViewTextBoxColumn SizeColumn;
+ private System.Windows.Forms.DataGridViewTextBoxColumn localPathDataGridViewTextBoxColumn;
+ }
+} \ No newline at end of file
diff --git a/UI/Forms/RomsList.cs b/UI/Forms/RomsList.cs
new file mode 100644
index 00000000..e79949e5
--- /dev/null
+++ b/UI/Forms/RomsList.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace com.clusterrr.hakchi_gui.UI.Forms
+{
+ public partial class RomsList : Form
+ {
+ public RomsList()
+ {
+ InitializeComponent();
+ foreach (DataGridViewColumn column in this.dataGridView1.Columns)
+ column.SortMode = DataGridViewColumnSortMode.Automatic;
+ foreach (Manager.RomManager.Rom r in Manager.RomManager.getInstance().GetLibrary())
+ {
+ romBindingSource.Add(r);
+ }
+ }
+ }
+}
diff --git a/UI/Forms/RomsList.resx b/UI/Forms/RomsList.resx
new file mode 100644
index 00000000..43bca332
--- /dev/null
+++ b/UI/Forms/RomsList.resx
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="Extension.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="Size.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="romBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root> \ No newline at end of file
diff --git a/hakchi_gui.csproj b/hakchi_gui.csproj
index b80ba337..6925dd01 100644
--- a/hakchi_gui.csproj
+++ b/hakchi_gui.csproj
@@ -318,6 +318,7 @@
<Compile Include="Manager\EmulatorManager.cs" />
<Compile Include="Manager\EventBus.cs" />
<Compile Include="Manager\GameManager.cs" />
+ <Compile Include="Manager\RomManager.cs" />
<Compile Include="MessageBoxManager.cs" />
<Compile Include="Properties\Resources.Designer.cs" />
<Compile Include="Properties\Settings.Designer.cs">
@@ -444,8 +445,10 @@
<DependentUpon>FoldersManagerForm.cs</DependentUpon>
</Compile>
<Compile Include="Tooling\TaskableTool.cs" />
+ <Compile Include="Tooling\Tasks\ExtractFiles.cs" />
<Compile Include="Tooling\Tasks\FetchOriginalGames.cs" />
<Compile Include="Tooling\Tasks\ImportGames.cs" />
+ <Compile Include="Tooling\Tasks\ImportRoms.cs" />
<Compile Include="UI\Components\EmulatorSelector.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -473,6 +476,18 @@
<Compile Include="UI\Forms\AsyncTask.Designer.cs">
<DependentUpon>AsyncTask.cs</DependentUpon>
</Compile>
+ <Compile Include="UI\Forms\RomImporter.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="UI\Forms\RomImporter.Designer.cs">
+ <DependentUpon>RomImporter.cs</DependentUpon>
+ </Compile>
+ <Compile Include="UI\Forms\RomsList.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="UI\Forms\RomsList.Designer.cs">
+ <DependentUpon>RomsList.cs</DependentUpon>
+ </Compile>
<Compile Include="UnsupportedFourScreenException.cs" />
<Compile Include="UnsupportedMapperException.cs" />
<Compile Include="WaitingClovershellForm.cs">
@@ -1026,6 +1041,12 @@
<EmbeddedResource Include="UI\Forms\AsyncTask.resx">
<DependentUpon>AsyncTask.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="UI\Forms\RomImporter.resx">
+ <DependentUpon>RomImporter.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="UI\Forms\RomsList.resx">
+ <DependentUpon>RomsList.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="WaitingClovershellForm.bg-BG.resx">
<DependentUpon>WaitingClovershellForm.cs</DependentUpon>
</EmbeddedResource>
@@ -1336,6 +1357,8 @@
</Content>
<None Include="app.config" />
<None Include="Properties\app.manifest" />
+ <None Include="Properties\DataSources\com.clusterrr.hakchi_gui.Manager.RomManager+Rom.datasource" />
+ <None Include="Properties\DataSources\com.clusterrr.hakchi_gui.UI.Forms.RomImporter+RomType.datasource" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -1763,22 +1786,22 @@
<ItemGroup>
<PublishFile Include="data\GameGenieDB.xml">
<Visible>False</Visible>
- <PublishState>Include</PublishState>
- <IncludeHash>True</IncludeHash>
<Group>
</Group>
<TargetPath>
</TargetPath>
+ <PublishState>Include</PublishState>
+ <IncludeHash>True</IncludeHash>
<FileType>File</FileType>
</PublishFile>
<PublishFile Include="data\nescarts.xml">
<Visible>False</Visible>
- <PublishState>Include</PublishState>
- <IncludeHash>True</IncludeHash>
<Group>
</Group>
<TargetPath>
</TargetPath>
+ <PublishState>Include</PublishState>
+ <IncludeHash>True</IncludeHash>
<FileType>File</FileType>
</PublishFile>
</ItemGroup>