diff --git a/DATabase/Core/Generate.cs b/DATabase/Core/Generate.cs index b6a6577c..f0848988 100644 --- a/DATabase/Core/Generate.cs +++ b/DATabase/Core/Generate.cs @@ -116,6 +116,8 @@ namespace SabreTools if (_sources != "") { string query = "SELECT name FROM sources WHERE id in (" + _sources + ")"; + Console.WriteLine(query); + using (SQLiteConnection dbc = new SQLiteConnection(_connectionString)) { dbc.Open(); diff --git a/SabreToolsUI/SabreToolsUI.Designer.cs b/SabreToolsUI/SabreToolsUI.Designer.cs index d28fa8e7..ef67e54c 100644 --- a/SabreToolsUI/SabreToolsUI.Designer.cs +++ b/SabreToolsUI/SabreToolsUI.Designer.cs @@ -34,15 +34,16 @@ this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.checkedListBox1 = new System.Windows.Forms.CheckedListBox(); - this.checkedListBox2 = new System.Windows.Forms.CheckedListBox(); + this.generateDatLabel = new System.Windows.Forms.Label(); + this.systemsLabel = new System.Windows.Forms.Label(); + this.systemsCheckedListBox = new System.Windows.Forms.CheckedListBox(); + this.sourcesCheckedListBox = new System.Windows.Forms.CheckedListBox(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -95,51 +96,41 @@ this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // - // label1 + // generateDatLabel // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(12, 34); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(112, 17); - this.label1.TabIndex = 1; - this.label1.Text = "Generate DAT"; + this.generateDatLabel.AutoSize = true; + this.generateDatLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.generateDatLabel.Location = new System.Drawing.Point(12, 34); + this.generateDatLabel.Name = "generateDatLabel"; + this.generateDatLabel.Size = new System.Drawing.Size(112, 17); + this.generateDatLabel.TabIndex = 1; + this.generateDatLabel.Text = "Generate DAT"; // - // label2 + // systemsLabel // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(15, 65); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(0, 13); - this.label2.TabIndex = 2; + this.systemsLabel.AutoSize = true; + this.systemsLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.systemsLabel.Location = new System.Drawing.Point(15, 65); + this.systemsLabel.Name = "systemsLabel"; + this.systemsLabel.Size = new System.Drawing.Size(56, 15); + this.systemsLabel.TabIndex = 3; + this.systemsLabel.Text = "Systems:"; // - // label3 + // systemsCheckedListBox // - this.label3.AutoSize = true; - this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.Location = new System.Drawing.Point(15, 65); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(56, 15); - this.label3.TabIndex = 3; - this.label3.Text = "Systems:"; + this.systemsCheckedListBox.FormattingEnabled = true; + this.systemsCheckedListBox.Location = new System.Drawing.Point(77, 65); + this.systemsCheckedListBox.Name = "systemsCheckedListBox"; + this.systemsCheckedListBox.Size = new System.Drawing.Size(260, 34); + this.systemsCheckedListBox.TabIndex = 4; // - // checkedListBox1 + // sourcesCheckedListBox // - this.checkedListBox1.FormattingEnabled = true; - this.checkedListBox1.Items.AddRange(GetAllSystems()); - this.checkedListBox1.Location = new System.Drawing.Point(77, 65); - this.checkedListBox1.Name = "checkedListBox1"; - this.checkedListBox1.Size = new System.Drawing.Size(260, 34); - this.checkedListBox1.TabIndex = 4; - // - // checkedListBox2 - // - this.checkedListBox2.FormattingEnabled = true; - this.checkedListBox2.Items.AddRange(GetAllSources()); - this.checkedListBox2.Location = new System.Drawing.Point(415, 65); - this.checkedListBox2.Name = "checkedListBox2"; - this.checkedListBox2.Size = new System.Drawing.Size(244, 34); - this.checkedListBox2.TabIndex = 7; + this.sourcesCheckedListBox.FormattingEnabled = true; + this.sourcesCheckedListBox.Location = new System.Drawing.Point(415, 65); + this.sourcesCheckedListBox.Name = "sourcesCheckedListBox"; + this.sourcesCheckedListBox.Size = new System.Drawing.Size(244, 34); + this.sourcesCheckedListBox.TabIndex = 7; // // label4 // @@ -161,7 +152,7 @@ // // button1 // - this.button1.Location = new System.Drawing.Point(18, 107); + this.button1.Location = new System.Drawing.Point(18, 145); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 8; @@ -171,7 +162,7 @@ // // button2 // - this.button2.Location = new System.Drawing.Point(100, 107); + this.button2.Location = new System.Drawing.Point(100, 145); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(97, 23); this.button2.TabIndex = 9; @@ -179,20 +170,43 @@ this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(18, 105); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(129, 17); + this.checkBox1.TabIndex = 10; + this.checkBox1.Text = "Use RomVault Format"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Checked = true; + this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox2.Location = new System.Drawing.Point(154, 105); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(102, 17); + this.checkBox2.TabIndex = 11; + this.checkBox2.Text = "Rename Games"; + this.checkBox2.UseVisualStyleBackColor = true; + // // SabreToolsUI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(681, 477); + this.Controls.Add(this.checkBox2); + this.Controls.Add(this.checkBox1); this.Controls.Add(this.button2); this.Controls.Add(this.button1); - this.Controls.Add(this.checkedListBox2); + this.Controls.Add(this.sourcesCheckedListBox); this.Controls.Add(this.label4); this.Controls.Add(this.label5); - this.Controls.Add(this.checkedListBox1); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); + this.Controls.Add(this.systemsCheckedListBox); + this.Controls.Add(this.systemsLabel); + this.Controls.Add(this.generateDatLabel); this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.Name = "SabreToolsUI"; @@ -212,15 +226,16 @@ private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.CheckedListBox checkedListBox1; - private System.Windows.Forms.CheckedListBox checkedListBox2; + private System.Windows.Forms.Label generateDatLabel; + private System.Windows.Forms.Label systemsLabel; + private System.Windows.Forms.CheckedListBox systemsCheckedListBox; + private System.Windows.Forms.CheckedListBox sourcesCheckedListBox; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; } } diff --git a/SabreToolsUI/SabreToolsUI.cs b/SabreToolsUI/SabreToolsUI.cs index 65645d19..fbfa51ce 100644 --- a/SabreToolsUI/SabreToolsUI.cs +++ b/SabreToolsUI/SabreToolsUI.cs @@ -108,32 +108,28 @@ ORDER BY sources.name COLLATE NOCASE"; string systems = ""; string sources = ""; - CheckedListBox.CheckedItemCollection cil = this.checkedListBox1.CheckedItems; - Console.WriteLine(cil.Count); + CheckedListBox.CheckedItemCollection cil = this.systemsCheckedListBox.CheckedItems; foreach (object ci in cil) { string id = Regex.Match(ci.ToString(), @".*? \((.*?)\)").Groups[1].Value; - systems += (systems == "" ? id : ", " + id); - Console.WriteLine(systems); + systems += (systems == "" ? id : "," + id); } - cil = this.checkedListBox2.CheckedItems; - Console.WriteLine(cil.Count); + cil = this.sourcesCheckedListBox.CheckedItems; foreach (object ci in cil) { string id = Regex.Match(ci.ToString(), @".*? \((.*?)\)").Groups[1].Value; - sources += (sources == "" ? id : ", " + id); - Console.WriteLine(systems); + sources += (sources == "" ? id : "," + id); } - Process.Start("DATabase.exe", "-g" + (systems != "" ? " systems=" + systems : "") + (sources != "" ? " sources=" + sources : "")); + Process.Start("DATabase.exe", "-l -g" + (systems != "" ? " system=" + systems : "") + (sources != "" ? " source=" + sources : "")); } private void button2_Click(object sender, EventArgs e) { - Process.Start("DATabase.exe", "-ga"); + Process.Start("DATabase.exe", "-l -ga"); } } }