From 9214b6f7c602ca0a6f28bc19ab37bece09828d8c Mon Sep 17 00:00:00 2001 From: Sigmanor Date: Wed, 20 Jan 2016 21:21:40 +0200 Subject: [PATCH] Added auto-lock settings --- Crypto Notepad/SettingsForm.Designer.cs | 17 +++++++++++++++-- Crypto Notepad/SettingsForm.cs | 7 +++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Crypto Notepad/SettingsForm.Designer.cs b/Crypto Notepad/SettingsForm.Designer.cs index 5661245..424f9ae 100644 --- a/Crypto Notepad/SettingsForm.Designer.cs +++ b/Crypto Notepad/SettingsForm.Designer.cs @@ -57,6 +57,7 @@ private void InitializeComponent() this.checkBox2 = new System.Windows.Forms.CheckBox(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.button1 = new System.Windows.Forms.Button(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -314,6 +315,7 @@ private void InitializeComponent() // // tabPage3 // + this.tabPage3.Controls.Add(this.checkBox4); this.tabPage3.Controls.Add(this.checkBox3); this.tabPage3.Controls.Add(this.checkBox2); this.tabPage3.Controls.Add(this.checkBox1); @@ -328,7 +330,7 @@ private void InitializeComponent() // checkBox3 // this.checkBox3.AutoSize = true; - this.checkBox3.Location = new System.Drawing.Point(7, 41); + this.checkBox3.Location = new System.Drawing.Point(7, 45); this.checkBox3.Name = "checkBox3"; this.checkBox3.Size = new System.Drawing.Size(88, 17); this.checkBox3.TabIndex = 2; @@ -338,7 +340,7 @@ private void InitializeComponent() // checkBox2 // this.checkBox2.AutoSize = true; - this.checkBox2.Location = new System.Drawing.Point(7, 64); + this.checkBox2.Location = new System.Drawing.Point(7, 72); this.checkBox2.Name = "checkBox2"; this.checkBox2.Size = new System.Drawing.Size(119, 17); this.checkBox2.TabIndex = 1; @@ -365,6 +367,16 @@ private void InitializeComponent() this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Location = new System.Drawing.Point(7, 99); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(128, 17); + this.checkBox4.TabIndex = 3; + this.checkBox4.Text = "Auto-lock on minimize"; + this.checkBox4.UseVisualStyleBackColor = true; + // // SettingsForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -423,5 +435,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label7; private System.Windows.Forms.Button button1; private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.CheckBox checkBox4; } } \ No newline at end of file diff --git a/Crypto Notepad/SettingsForm.cs b/Crypto Notepad/SettingsForm.cs index b776f92..6e05c30 100644 --- a/Crypto Notepad/SettingsForm.cs +++ b/Crypto Notepad/SettingsForm.cs @@ -28,12 +28,13 @@ private void SettingsForm_Load(object sender, EventArgs e) comboBox3.Text = ps.KeySize.ToString(); textBox1.Text = ps.TheSalt; textBox2.Text = ps.PasswordIterations.ToString(); - checkBox1.Checked = ps.AssociateCheck; - checkBox3.Checked = ps.ShowToolbar; panel1.BackColor = ps.RichForeColor; panel2.BackColor = ps.RichBackColor; panel3.BackColor = ps.HighlightsColor; + checkBox1.Checked = ps.AssociateCheck; checkBox2.Checked = ps.AutoCheckUpdate; + checkBox3.Checked = ps.ShowToolbar; + checkBox4.Checked = ps.AutoLock; } private void saveSettingsButton_Click(object sender, EventArgs e) @@ -67,6 +68,7 @@ private void SetSettings(string value) ps.PasswordIterations = Convert.ToInt32(textBox2.Text.ToString()); ps.ShowToolbar = checkBox3.Checked; ps.AutoCheckUpdate = checkBox2.Checked; + ps.AutoLock = checkBox4.Checked; ps.Save(); MainWindow.settingsChanged = true; @@ -84,6 +86,7 @@ private void SetSettings(string value) checkBox1.Checked = false; checkBox2.Checked = true; checkBox3.Checked = true; + checkBox4.Checked = false; } }