Added able to auto-clear clipboard on app close

This commit is contained in:
Alexander 2020-01-19 14:52:38 +02:00
parent 6a2adbbf65
commit 9e18e19eec
No known key found for this signature in database
GPG key ID: 1F83313BFEB322E9
5 changed files with 37 additions and 0 deletions

View file

@ -186,6 +186,9 @@
<setting name="statusPanelClipboard" serializeAs="String">
<value>False</value>
</setting>
<setting name="clearClipboardAtClose" serializeAs="String">
<value>False</value>
</setting>
<setting name="shortcutKeys" serializeAs="String">
<value>True</value>
</setting>

View file

@ -905,6 +905,10 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
writer.Write(encryptedText);
writer.Close();
}
if (settings.clearClipboardAtClose)
{
Clipboard.Clear();
}
}
if (res == DialogResult.Cancel)
{
@ -915,6 +919,14 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
}
}
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
{
if (settings.clearClipboardAtClose)
{
Clipboard.Clear();
}
}
private void MainForm_Shown(object sender, EventArgs e)
{
Visible = true;

View file

@ -39,6 +39,7 @@ private void LoadSettings()
minimizeToTrayCheckBox.Checked = settings.minimizeToTray;
closeToTrayCheckBox.Checked = settings.closeToTray;
singleInstanceCheckBox.Checked = settings.singleInstance;
clearClipboardCheckBox.Checked = settings.clearClipboardAtClose;
integrateCheckBox.Checked = settings.explorerIntegrate;
associateCheckBox.Checked = settings.explorerAssociate;
sendToCheckBox.Checked = settings.explorerSendTo;
@ -608,6 +609,10 @@ private void ClearClipboardTextBox_TextChanged(object sender, EventArgs e)
}
}
private void ClearClipboardCheckBox_Click(object sender, EventArgs e)
{
settings.clearClipboardAtClose = clearClipboardCheckBox.Checked;
}
private void ShortcutKeysCheckBox_Click(object sender, EventArgs e)
{

View file

@ -777,6 +777,20 @@ public bool statusPanelClipboard {
this["statusPanelClipboard"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool clearClipboardAtClose {
get {
return ((bool)(this["clearClipboardAtClose"]));
}
set {
this["clearClipboardAtClose"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]

View file

@ -176,6 +176,9 @@
<Setting Name="statusPanelClipboard" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="clearClipboardAtClose" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="shortcutKeys" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>