diff --git a/SuperGrate/Classes/Config.cs b/SuperGrate/Classes/Config.cs index 70dea87..724e09f 100644 --- a/SuperGrate/Classes/Config.cs +++ b/SuperGrate/Classes/Config.cs @@ -32,6 +32,7 @@ class Config {"ULSourceColumns", "0,3,4"}, {"ULStoreColumns", "0,1,5,6,4"} }; + public static Dictionary DefaultSettings = Settings; public static void SaveConfig() { Logger.Information("Generating SuperGrate.xml..."); diff --git a/SuperGrate/Controls/ChangeSetting.Designer.cs b/SuperGrate/Controls/ChangeSetting.Designer.cs index b205944..6a25201 100644 --- a/SuperGrate/Controls/ChangeSetting.Designer.cs +++ b/SuperGrate/Controls/ChangeSetting.Designer.cs @@ -33,6 +33,7 @@ private void InitializeComponent() this.btnCancel = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button(); this.helpProvider = new System.Windows.Forms.HelpProvider(); + this.btnRestoreDefault = new System.Windows.Forms.Button(); this.SuspendLayout(); // // tbComment @@ -42,6 +43,7 @@ private void InitializeComponent() this.tbComment.Multiline = true; this.tbComment.Name = "tbComment"; this.tbComment.ReadOnly = true; + this.tbComment.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.helpProvider.SetShowHelp(this.tbComment, true); this.tbComment.Size = new System.Drawing.Size(381, 63); this.tbComment.TabIndex = 0; @@ -62,7 +64,7 @@ private void InitializeComponent() // this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; this.helpProvider.SetHelpString(this.btnCancel, "Closes window, and does not apply change."); - this.btnCancel.Location = new System.Drawing.Point(230, 144); + this.btnCancel.Location = new System.Drawing.Point(230, 143); this.btnCancel.Name = "btnCancel"; this.helpProvider.SetShowHelp(this.btnCancel, true); this.btnCancel.Size = new System.Drawing.Size(75, 23); @@ -76,7 +78,7 @@ private void InitializeComponent() this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.System; this.helpProvider.SetHelpString(this.btnSave, "Applies the setting changed above for the current session. Press \"Save to Disk\" o" + "n the next screen to save the changes to disk."); - this.btnSave.Location = new System.Drawing.Point(311, 144); + this.btnSave.Location = new System.Drawing.Point(312, 143); this.btnSave.Name = "btnSave"; this.helpProvider.SetShowHelp(this.btnSave, true); this.btnSave.Size = new System.Drawing.Size(75, 23); @@ -85,12 +87,25 @@ private void InitializeComponent() this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.BtnSave_Click); // + // btnRestoreDefault + // + this.btnRestoreDefault.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.helpProvider.SetHelpString(this.btnRestoreDefault, "Restores default setting value."); + this.btnRestoreDefault.Location = new System.Drawing.Point(4, 143); + this.btnRestoreDefault.Name = "btnRestoreDefault"; + this.helpProvider.SetShowHelp(this.btnRestoreDefault, true); + this.btnRestoreDefault.Size = new System.Drawing.Size(75, 23); + this.btnRestoreDefault.TabIndex = 4; + this.btnRestoreDefault.Text = "&Default"; + this.btnRestoreDefault.Click += new System.EventHandler(this.btnRestoreDefault_Click); + // // ChangeSetting // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(391, 173); + this.ClientSize = new System.Drawing.Size(391, 171); + this.Controls.Add(this.btnRestoreDefault); this.Controls.Add(this.btnSave); this.Controls.Add(this.btnCancel); this.Controls.Add(this.tbValue); @@ -117,5 +132,6 @@ private void InitializeComponent() private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Button btnSave; private System.Windows.Forms.HelpProvider helpProvider; + private System.Windows.Forms.Button btnRestoreDefault; } } \ No newline at end of file diff --git a/SuperGrate/Controls/ChangeSetting.cs b/SuperGrate/Controls/ChangeSetting.cs index 0c1b41f..b45fb09 100644 --- a/SuperGrate/Controls/ChangeSetting.cs +++ b/SuperGrate/Controls/ChangeSetting.cs @@ -25,7 +25,7 @@ private void ChangeSetting_Load(object sender, EventArgs e) break; }; } - tbComment.Text = lastComment; + tbComment.Text = lastComment + "\r\n\r\n" + "Default Value: " + Config.DefaultSettings[Setting]; } private void BtnCancel_Click(object sender, EventArgs e) { @@ -44,5 +44,9 @@ private void TbValue_KeyPress(object sender, KeyPressEventArgs e) btnSave.PerformClick(); } } + private void btnRestoreDefault_Click(object sender, EventArgs e) + { + tbValue.Text = Config.DefaultSettings[Setting]; + } } } diff --git a/SuperGrate/Main.cs b/SuperGrate/Main.cs index ab488c5..4630e3a 100644 --- a/SuperGrate/Main.cs +++ b/SuperGrate/Main.cs @@ -381,8 +381,8 @@ private void miNewInstance_Click(object sender, EventArgs e) } private void miAddRemoveCol_Click(object sender, EventArgs e) { - UserRow AllAvailableColumns = null; string SettingKey = ""; + UserRow AllAvailableColumns = null; if (CurrentListSource == ListSources.MigrationStore) { SettingKey = "ULStoreColumns";