From fa8cbf650d4f57b990ba7e068ae131728f3e5be8 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 11 Aug 2013 20:06:27 +0000 Subject: [PATCH] New Path Config - defaults button --- .../config/NewPathConfig.Designer.cs | 13 +++++++++++++ BizHawk.MultiClient/config/NewPathConfig.cs | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/BizHawk.MultiClient/config/NewPathConfig.Designer.cs b/BizHawk.MultiClient/config/NewPathConfig.Designer.cs index 9f357e47b4..d8cf44c70f 100644 --- a/BizHawk.MultiClient/config/NewPathConfig.Designer.cs +++ b/BizHawk.MultiClient/config/NewPathConfig.Designer.cs @@ -38,6 +38,7 @@ this.BasePathBox = new System.Windows.Forms.TextBox(); this.BrowseBase = new System.Windows.Forms.Button(); this.BaseDescription = new System.Windows.Forms.Label(); + this.DefaultsBtn = new System.Windows.Forms.Button(); this.SuspendLayout(); // // OK @@ -148,6 +149,16 @@ this.BaseDescription.TabIndex = 208; this.BaseDescription.Text = "Global Base"; // + // DefaultsBtn + // + this.DefaultsBtn.Location = new System.Drawing.Point(93, 411); + this.DefaultsBtn.Name = "DefaultsBtn"; + this.DefaultsBtn.Size = new System.Drawing.Size(75, 23); + this.DefaultsBtn.TabIndex = 211; + this.DefaultsBtn.Text = "&Defaults"; + this.DefaultsBtn.UseVisualStyleBackColor = true; + this.DefaultsBtn.Click += new System.EventHandler(this.DefaultsBtn_Click); + // // NewPathConfig // this.AcceptButton = this.OK; @@ -155,6 +166,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.Cancel; this.ClientSize = new System.Drawing.Size(618, 446); + this.Controls.Add(this.DefaultsBtn); this.Controls.Add(this.label1); this.Controls.Add(this.button1); this.Controls.Add(this.RecentForROMs); @@ -187,5 +199,6 @@ private System.Windows.Forms.TextBox BasePathBox; private System.Windows.Forms.Button BrowseBase; private System.Windows.Forms.Label BaseDescription; + private System.Windows.Forms.Button DefaultsBtn; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/config/NewPathConfig.cs b/BizHawk.MultiClient/config/NewPathConfig.cs index 50e70eed88..11b414b1eb 100644 --- a/BizHawk.MultiClient/config/NewPathConfig.cs +++ b/BizHawk.MultiClient/config/NewPathConfig.cs @@ -43,7 +43,7 @@ namespace BizHawk.MultiClient { RecentForROMs.Checked = Global.Config.UseRecentForROMs; BasePathBox.Text = Global.Config.BasePath; - DoTabs(); + DoTabs(Global.Config.PathEntries.Paths); SetDefaultFocusedTab(); DoROMToggle(); } @@ -87,8 +87,11 @@ namespace BizHawk.MultiClient } } - private void DoTabs() + private void DoTabs(List PathCollection) { + PathTabControl.SuspendLayout(); + PathTabControl.TabPages.Clear(); + //Separate by system List systems = Global.Config.PathEntries.Select(x => x.System).Distinct().ToList(); systems.Sort(); @@ -105,7 +108,7 @@ namespace BizHawk.MultiClient Text = systemId, Name = systemId, }; - List paths = Global.Config.PathEntries.Where(x => x.System == systemId).OrderBy(x => x.Ordinal).ThenBy(x => x.Type).ToList(); + List paths = PathCollection.Where(x => x.System == systemId).OrderBy(x => x.Ordinal).ThenBy(x => x.Type).ToList(); int _x = 6; int _y = 14; @@ -186,6 +189,8 @@ namespace BizHawk.MultiClient PathTabControl.TabPages.Add(t); } + + PathTabControl.ResumeLayout(); } private void BrowseFolder(TextBox box, string _Name, string System) @@ -308,5 +313,10 @@ namespace BizHawk.MultiClient return _AllPathControls; } } + + private void DefaultsBtn_Click(object sender, EventArgs e) + { + DoTabs(PathEntryCollection.DefaultValues); + } } }