private void btnOk_Click(object sender, EventArgs e)
{
bool save = false;
if (chkAutoSaveEdit.Checked && string.IsNullOrEmpty(txtAutosave.Text))
{
chkAutoSaveEdit.Checked = false;
}
if (cmboProject.Text.Equals("custom") && !string.IsNullOrEmpty(cmboCustomProject.Text))
{
FixCustomProject();
cmboCustomProject.Items.Add(cmboCustomProject.Text);
}
StringBuilder customs = new StringBuilder();
foreach (string s in from string s in cmboCustomProject.Items where !string.IsNullOrEmpty(s.Trim()) select s)
{
customs.Append(s + "|");
}
string tmp = customs.ToString();
Properties.Settings.Default.CustomWikis = (tmp.Length == 0) ? "" : tmp.Substring(0, tmp.LastIndexOf('|'));
if (Properties.Settings.Default.CustomWikis.Length > 0)
save = true;
if (Properties.Settings.Default.AskForTerminate != chkAlwaysConfirmExit.Checked)
{
Properties.Settings.Default.AskForTerminate = chkAlwaysConfirmExit.Checked;
save = true;
}
if (Properties.Settings.Default.Privacy.Equals(chkPrivacy.Checked))
{
Properties.Settings.Default.Privacy = !chkPrivacy.Checked;
save = true;
}
if (save)
{
Properties.Settings.Default.Save();
}
}