Able auto save when locked

This commit is contained in:
Sigmanor 2017-02-05 22:25:58 +02:00
parent f3ecd89f4c
commit d13214a563
5 changed files with 34 additions and 1 deletions

View file

@ -43,7 +43,7 @@
<value>192</value>
</setting>
<setting name="TheSalt" serializeAs="String">
<value/>
<value />
</setting>
<setting name="PasswordIterations" serializeAs="String">
<value>2</value>
@ -69,6 +69,9 @@
<setting name="WindowState" serializeAs="String">
<value>Normal</value>
</setting>
<setting name="AutoSave" serializeAs="String">
<value>True</value>
</setting>
</Crypto_Notepad.Properties.Settings>
<EncryptPad.Properties.Settings>
<setting name="TopPosition" serializeAs="String">

View file

@ -281,5 +281,17 @@ public bool AutoLock {
this["WindowState"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool AutoSave {
get {
return ((bool)(this["AutoSave"]));
}
set {
this["AutoSave"] = value;
}
}
}
}

View file

@ -62,5 +62,8 @@
<Setting Name="WindowState" Provider="PortableSettingsProvider" Type="System.Windows.Forms.FormWindowState" Scope="User">
<Value Profile="(Default)">Normal</Value>
</Setting>
<Setting Name="AutoSave" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

View file

@ -62,6 +62,7 @@ private void InitializeComponent()
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.checkBox5 = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
@ -351,6 +352,7 @@ private void InitializeComponent()
//
// tabPage3
//
this.tabPage3.Controls.Add(this.checkBox5);
this.tabPage3.Controls.Add(this.checkBox4);
this.tabPage3.Controls.Add(this.checkBox3);
this.tabPage3.Controls.Add(this.checkBox2);
@ -413,6 +415,16 @@ private void InitializeComponent()
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// checkBox5
//
this.checkBox5.AutoSize = true;
this.checkBox5.Location = new System.Drawing.Point(7, 126);
this.checkBox5.Name = "checkBox5";
this.checkBox5.Size = new System.Drawing.Size(112, 17);
this.checkBox5.TabIndex = 4;
this.checkBox5.Text = "Auto-save on lock";
this.checkBox5.UseVisualStyleBackColor = true;
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -475,5 +487,6 @@ private void InitializeComponent()
private System.Windows.Forms.Label warningLabel;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.PictureBox closeLabel;
private System.Windows.Forms.CheckBox checkBox5;
}
}

View file

@ -35,6 +35,7 @@ private void SettingsForm_Load(object sender, EventArgs e)
checkBox2.Checked = ps.AutoCheckUpdate;
checkBox3.Checked = ps.ShowToolbar;
checkBox4.Checked = ps.AutoLock;
checkBox5.Checked = ps.AutoSave;
if (ps.WarningMsg == false)
{
@ -75,6 +76,7 @@ private void SetSettings(string value)
ps.ShowToolbar = checkBox3.Checked;
ps.AutoCheckUpdate = checkBox2.Checked;
ps.AutoLock = checkBox4.Checked;
ps.AutoSave = checkBox5.Checked;
ps.Save();
publicVar.settingsChanged = true;