Skip to content

Commit

Permalink
Support Setting Defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
krisdb2009 committed Dec 24, 2019
1 parent a558abd commit 9489475
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions SuperGrate/Classes/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Config
{"ULSourceColumns", "0,3,4"},
{"ULStoreColumns", "0,1,5,6,4"}
};
public static Dictionary<string, string> DefaultSettings = Settings;
public static void SaveConfig()
{
Logger.Information("Generating SuperGrate.xml...");
Expand Down
22 changes: 19 additions & 3 deletions SuperGrate/Controls/ChangeSetting.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion SuperGrate/Controls/ChangeSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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];
}
}
}
2 changes: 1 addition & 1 deletion SuperGrate/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 9489475

Please sign in to comment.