From 071894f8de6461155c33ce32db8c302ad4d16ae0 Mon Sep 17 00:00:00 2001 From: "gb.luke" Date: Sun, 4 Jul 2010 20:52:03 +0000 Subject: [PATCH] First creation of TODO file. Various changes. See list of changes in commit for details. --- NUS Downloader/Form1.Designer.cs | 84 +++++++++++++++----------------- NUS Downloader/Form1.cs | 55 +++++++++++++-------- NUS Downloader/TODO | 2 + 3 files changed, 75 insertions(+), 66 deletions(-) create mode 100644 NUS Downloader/TODO diff --git a/NUS Downloader/Form1.Designer.cs b/NUS Downloader/Form1.Designer.cs index b6917f2..0e27e1a 100644 --- a/NUS Downloader/Form1.Designer.cs +++ b/NUS Downloader/Form1.Designer.cs @@ -61,10 +61,6 @@ this.WiiWareMenuList = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.RegionCodesList = new System.Windows.Forms.ToolStripMenuItem(); - this.MassUpdateList = new System.Windows.Forms.ToolStripMenuItem(); - this.PALMassUpdate = new System.Windows.Forms.ToolStripMenuItem(); - this.NTSCMassUpdate = new System.Windows.Forms.ToolStripMenuItem(); - this.KoreaMassUpdate = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.updateDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.button3 = new System.Windows.Forms.Button(); @@ -104,6 +100,9 @@ this.titleversion = new wmgCMS.WaterMarkTextBox(); this.titleidbox = new wmgCMS.WaterMarkTextBox(); this.dlprogress = new wyDay.Controls.Windows7ProgressBar(); + this.PALMassUpdate = new System.Windows.Forms.ToolStripMenuItem(); + this.NTSCMassUpdate = new System.Windows.Forms.ToolStripMenuItem(); + this.KoreaMassUpdate = new System.Windows.Forms.ToolStripMenuItem(); this.databaseStrip.SuspendLayout(); this.extrasStrip.SuspendLayout(); this.proxyBox.SuspendLayout(); @@ -244,12 +243,11 @@ this.WiiWareMenuList, this.toolStripSeparator1, this.RegionCodesList, - this.MassUpdateList, this.toolStripSeparator4, this.updateDatabaseToolStripMenuItem}); this.databaseStrip.Name = "databaseStrip"; this.databaseStrip.ShowItemToolTips = false; - this.databaseStrip.Size = new System.Drawing.Size(167, 170); + this.databaseStrip.Size = new System.Drawing.Size(164, 148); // // SystemMenuList // @@ -261,7 +259,7 @@ // IOSMenuList // this.IOSMenuList.Name = "IOSMenuList"; - this.IOSMenuList.Size = new System.Drawing.Size(166, 22); + this.IOSMenuList.Size = new System.Drawing.Size(163, 22); this.IOSMenuList.Text = "IOS"; // // VCMenuList @@ -279,7 +277,7 @@ this.TurboGrafxCDMenuList, this.VCArcadeMenuList}); this.VCMenuList.Name = "VCMenuList"; - this.VCMenuList.Size = new System.Drawing.Size(166, 22); + this.VCMenuList.Size = new System.Drawing.Size(163, 22); this.VCMenuList.Text = "Virtual Console"; // // C64MenuList @@ -358,59 +356,31 @@ // WiiWareMenuList // this.WiiWareMenuList.Name = "WiiWareMenuList"; - this.WiiWareMenuList.Size = new System.Drawing.Size(166, 22); + this.WiiWareMenuList.Size = new System.Drawing.Size(163, 22); this.WiiWareMenuList.Text = "WiiWare"; // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(163, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(160, 6); // // RegionCodesList // this.RegionCodesList.Name = "RegionCodesList"; - this.RegionCodesList.Size = new System.Drawing.Size(166, 22); + this.RegionCodesList.Size = new System.Drawing.Size(163, 22); this.RegionCodesList.Text = "Region Codes"; this.RegionCodesList.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.RegionCodesList_DropDownItemClicked); // - // MassUpdateList - // - this.MassUpdateList.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.PALMassUpdate, - this.NTSCMassUpdate, - this.KoreaMassUpdate}); - this.MassUpdateList.Name = "MassUpdateList"; - this.MassUpdateList.Size = new System.Drawing.Size(166, 22); - this.MassUpdateList.Text = "Download Scripts"; - // - // PALMassUpdate - // - this.PALMassUpdate.Name = "PALMassUpdate"; - this.PALMassUpdate.Size = new System.Drawing.Size(104, 22); - this.PALMassUpdate.Text = "PAL"; - // - // NTSCMassUpdate - // - this.NTSCMassUpdate.Name = "NTSCMassUpdate"; - this.NTSCMassUpdate.Size = new System.Drawing.Size(104, 22); - this.NTSCMassUpdate.Text = "NTSC"; - // - // KoreaMassUpdate - // - this.KoreaMassUpdate.Name = "KoreaMassUpdate"; - this.KoreaMassUpdate.Size = new System.Drawing.Size(104, 22); - this.KoreaMassUpdate.Text = "Korea"; - // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(163, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(160, 6); // // updateDatabaseToolStripMenuItem // this.updateDatabaseToolStripMenuItem.Image = global::NUS_Downloader.Properties.Resources.database_save; this.updateDatabaseToolStripMenuItem.Name = "updateDatabaseToolStripMenuItem"; - this.updateDatabaseToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.updateDatabaseToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.updateDatabaseToolStripMenuItem.Text = "Update Database"; this.updateDatabaseToolStripMenuItem.Click += new System.EventHandler(this.updateDatabaseToolStripMenuItem_Click); // @@ -672,6 +642,10 @@ // // scriptsDatabaseToolStripMenuItem // + this.scriptsDatabaseToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.PALMassUpdate, + this.NTSCMassUpdate, + this.KoreaMassUpdate}); this.scriptsDatabaseToolStripMenuItem.Enabled = false; this.scriptsDatabaseToolStripMenuItem.Image = global::NUS_Downloader.Properties.Resources.script_code_red; this.scriptsDatabaseToolStripMenuItem.Name = "scriptsDatabaseToolStripMenuItem"; @@ -762,6 +736,27 @@ this.dlprogress.Size = new System.Drawing.Size(250, 15); this.dlprogress.TabIndex = 47; // + // PALMassUpdate + // + this.PALMassUpdate.Enabled = false; + this.PALMassUpdate.Name = "PALMassUpdate"; + this.PALMassUpdate.Size = new System.Drawing.Size(152, 22); + this.PALMassUpdate.Text = "PAL"; + // + // NTSCMassUpdate + // + this.NTSCMassUpdate.Enabled = false; + this.NTSCMassUpdate.Name = "NTSCMassUpdate"; + this.NTSCMassUpdate.Size = new System.Drawing.Size(152, 22); + this.NTSCMassUpdate.Text = "NTSC"; + // + // KoreaMassUpdate + // + this.KoreaMassUpdate.Enabled = false; + this.KoreaMassUpdate.Name = "KoreaMassUpdate"; + this.KoreaMassUpdate.Size = new System.Drawing.Size(152, 22); + this.KoreaMassUpdate.Text = "Korea"; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -862,10 +857,6 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripMenuItem getCommonKeyMenuItem; private System.Windows.Forms.ContextMenuStrip C64MenuListDrop; - private System.Windows.Forms.ToolStripMenuItem MassUpdateList; - private System.Windows.Forms.ToolStripMenuItem PALMassUpdate; - private System.Windows.Forms.ToolStripMenuItem NTSCMassUpdate; - private System.Windows.Forms.ToolStripMenuItem KoreaMassUpdate; private System.Windows.Forms.ComboBox consoleCBox; private System.Windows.Forms.ToolStripMenuItem commonKeykeybinToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem koreanKeykkeybinToolStripMenuItem; @@ -884,6 +875,9 @@ private System.Windows.Forms.ToolStripMenuItem scriptsLocalMenuEntry; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripMenuItem scriptsDatabaseToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem PALMassUpdate; + private System.Windows.Forms.ToolStripMenuItem NTSCMassUpdate; + private System.Windows.Forms.ToolStripMenuItem KoreaMassUpdate; } } diff --git a/NUS Downloader/Form1.cs b/NUS Downloader/Form1.cs index 35733e8..e470b18 100644 --- a/NUS Downloader/Form1.cs +++ b/NUS Downloader/Form1.cs @@ -302,6 +302,10 @@ namespace NUS_Downloader { this.databaseButton.Enabled = true; this.databaseButton.Text = "Database..."; + if (this.KoreaMassUpdate.HasDropDownItems || this.PALMassUpdate.HasDropDownItems || this.NTSCMassUpdate.HasDropDownItems) + { + this.scriptsbutton.Enabled = true; + } } private void DoAllDatabaseyStuff_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) @@ -1762,20 +1766,20 @@ namespace NUS_Downloader { case "KOR": KoreaMassUpdate.DropDownItems.Add(additionitem); + KoreaMassUpdate.Enabled = true; break; case "PAL": PALMassUpdate.DropDownItems.Add(additionitem); + PALMassUpdate.Enabled = true; break; case "NTSC": NTSCMassUpdate.DropDownItems.Add(additionitem); + NTSCMassUpdate.Enabled = true; break; default: Debug.WriteLine("Oops - database error"); return; } - // SVN was messing with me and i lost track which of these was the latest... - //additionitem.Click += new ToolStripItemClickedEventHandler(upditem_clicked); - //additionitem.Click += new EventHandler(upditem_itemclicked); } else { @@ -2950,7 +2954,7 @@ namespace NUS_Downloader /// The instance containing the event data. private void RunScript(object sender, System.ComponentModel.DoWorkEventArgs e) { - Control.CheckForIllegalCrossThreadCalls = false; + //Control.CheckForIllegalCrossThreadCalls = false; script_mode = true; statusbox.Text = ""; WriteStatus("Starting script download. Please be patient!"); @@ -3123,28 +3127,37 @@ namespace NUS_Downloader void OrganizeScripts(object sender, DoWorkEventArgs e) { //throw new NotImplementedException(); - foreach (string directory in Directory.GetDirectories(Path.Combine(CURRENT_DIR, "scripts"), "*", SearchOption.TopDirectoryOnly)) + try { - if (Directory.GetFiles(directory, "*.nus", SearchOption.TopDirectoryOnly).Length > 0) + foreach (string directory in Directory.GetDirectories(Path.Combine(CURRENT_DIR, "scripts"), "*", SearchOption.TopDirectoryOnly)) { - DirectoryInfo dinfo = new DirectoryInfo(directory); - ToolStripMenuItem folder_item = new ToolStripMenuItem(); - folder_item.Text = dinfo.Name + Path.DirectorySeparatorChar; - folder_item.Image = Properties.Resources.folder_table; - - - foreach (string nusscript in Directory.GetFiles(directory, "*.nus", SearchOption.TopDirectoryOnly)) + if (Directory.GetFiles(directory, "*.nus", SearchOption.TopDirectoryOnly).Length > 0) { - FileInfo finfo = new FileInfo(nusscript); - ToolStripMenuItem nus_script_item = new ToolStripMenuItem(); - nus_script_item.Text = finfo.Name; - nus_script_item.Image = Properties.Resources.script_go; - folder_item.DropDownItems.Add(nus_script_item); - } + DirectoryInfo dinfo = new DirectoryInfo(directory); + ToolStripMenuItem folder_item = new ToolStripMenuItem(); + folder_item.Text = dinfo.Name + Path.DirectorySeparatorChar; + folder_item.Image = Properties.Resources.folder_table; - scriptsLocalMenuEntry.DropDownItems.Add(folder_item); + + foreach (string nusscript in Directory.GetFiles(directory, "*.nus", SearchOption.TopDirectoryOnly)) + { + FileInfo finfo = new FileInfo(nusscript); + ToolStripMenuItem nus_script_item = new ToolStripMenuItem(); + nus_script_item.Text = finfo.Name; + nus_script_item.Image = Properties.Resources.script_go; + folder_item.DropDownItems.Add(nus_script_item); + } + + scriptsLocalMenuEntry.DropDownItems.Add(folder_item); + } } } - } + catch (DirectoryNotFoundException) + { + WriteStatus("Scripts directory not found..."); + WriteStatus("- Creating it."); + Directory.CreateDirectory(Path.Combine(CURRENT_DIR, "scripts")); + } + } } } \ No newline at end of file diff --git a/NUS Downloader/TODO b/NUS Downloader/TODO new file mode 100644 index 0000000..8417a7e --- /dev/null +++ b/NUS Downloader/TODO @@ -0,0 +1,2 @@ +Make more compatible with mono. +Finish scripting improvements. \ No newline at end of file