From 5030aa9274f77766fe5ac329265f4cac2314eb23 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 9 Nov 2019 21:33:35 +0200 Subject: [PATCH] Added message with recommendations to "Encryption" settings tab. --- Crypto Notepad/App.config | 3 +++ .../Properties/Settings.Designer.cs | 13 ++++++++++++ Crypto Notepad/Properties/Settings.settings | 3 +++ Crypto Notepad/SettingsForm.Designer.cs | 20 ++++++++++++++++++- Crypto Notepad/SettingsForm.cs | 13 ++++++++++-- Crypto Notepad/SettingsForm.resx | 6 ++++++ 6 files changed, 55 insertions(+), 3 deletions(-) diff --git a/Crypto Notepad/App.config b/Crypto Notepad/App.config index 070603b..c30728a 100644 --- a/Crypto Notepad/App.config +++ b/Crypto Notepad/App.config @@ -141,6 +141,9 @@ True + + True + diff --git a/Crypto Notepad/Properties/Settings.Designer.cs b/Crypto Notepad/Properties/Settings.Designer.cs index c021ddc..fde5535 100644 --- a/Crypto Notepad/Properties/Settings.Designer.cs +++ b/Crypto Notepad/Properties/Settings.Designer.cs @@ -582,5 +582,18 @@ public bool statusPanelSize { this["statusPanelSize"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool encryptionToolTip { + get { + return ((bool)(this["encryptionToolTip"])); + } + set { + this["encryptionToolTip"] = value; + } + } } } diff --git a/Crypto Notepad/Properties/Settings.settings b/Crypto Notepad/Properties/Settings.settings index 6aca5a9..0c7e1f6 100644 --- a/Crypto Notepad/Properties/Settings.settings +++ b/Crypto Notepad/Properties/Settings.settings @@ -131,5 +131,8 @@ True + + True + \ No newline at end of file diff --git a/Crypto Notepad/SettingsForm.Designer.cs b/Crypto Notepad/SettingsForm.Designer.cs index f09301c..da08540 100644 --- a/Crypto Notepad/SettingsForm.Designer.cs +++ b/Crypto Notepad/SettingsForm.Designer.cs @@ -28,6 +28,7 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm)); this.editorFontColorLabel = new System.Windows.Forms.Label(); this.colorDialog = new System.Windows.Forms.ColorDialog(); @@ -58,6 +59,7 @@ private void InitializeComponent() this.associateCheckBox = new System.Windows.Forms.CheckBox(); this.sendToCheckBox = new System.Windows.Forms.CheckBox(); this.encryptionTabPage = new System.Windows.Forms.TabPage(); + this.encryptionToolTipLabel = new System.Windows.Forms.Label(); this.passwordIterationsTextBox = new System.Windows.Forms.TextBox(); this.hashAlgorithmComboBox = new System.Windows.Forms.ComboBox(); this.passwordIterationsLabel = new System.Windows.Forms.Label(); @@ -91,6 +93,7 @@ private void InitializeComponent() this.searchBackColorLabel = new System.Windows.Forms.Label(); this.settingsNavigation = new System.Windows.Forms.ListBox(); this.fontDialog = new System.Windows.Forms.FontDialog(); + this.settingsToolTip = new System.Windows.Forms.ToolTip(this.components); this.settingsTabControl.SuspendLayout(); this.applicationTabPage.SuspendLayout(); this.editorTabPage.SuspendLayout(); @@ -434,6 +437,7 @@ private void InitializeComponent() // this.encryptionTabPage.BackColor = System.Drawing.SystemColors.Window; this.encryptionTabPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.encryptionTabPage.Controls.Add(this.encryptionToolTipLabel); this.encryptionTabPage.Controls.Add(this.passwordIterationsTextBox); this.encryptionTabPage.Controls.Add(this.hashAlgorithmComboBox); this.encryptionTabPage.Controls.Add(this.passwordIterationsLabel); @@ -447,6 +451,18 @@ private void InitializeComponent() this.encryptionTabPage.TabIndex = 1; this.encryptionTabPage.Text = "enc"; // + // encryptionToolTipLabel + // + this.encryptionToolTipLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.encryptionToolTipLabel.Font = new System.Drawing.Font("Segoe UI", 8F); + this.encryptionToolTipLabel.Location = new System.Drawing.Point(9, 140); + this.encryptionToolTipLabel.Name = "encryptionToolTipLabel"; + this.encryptionToolTipLabel.Size = new System.Drawing.Size(223, 96); + this.encryptionToolTipLabel.TabIndex = 7; + this.encryptionToolTipLabel.Text = resources.GetString("encryptionToolTipLabel.Text"); + this.settingsToolTip.SetToolTip(this.encryptionToolTipLabel, "Left click to permanently hide this tooltip"); + this.encryptionToolTipLabel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.EncryptionToolTipLabel_MouseClick); + // // passwordIterationsTextBox // this.passwordIterationsTextBox.Location = new System.Drawing.Point(132, 62); @@ -565,7 +581,7 @@ private void InitializeComponent() this.statusPanelSizeCheckBox.TabIndex = 7; this.statusPanelSizeCheckBox.Text = "Size"; this.statusPanelSizeCheckBox.UseVisualStyleBackColor = true; - this.statusPanelSizeCheckBox.Click += new System.EventHandler(this.statusPanelSizeCheckBox_Click); + this.statusPanelSizeCheckBox.Click += new System.EventHandler(this.StatusPanelSizeCheckBox_Click); // // statusPanelLinesCheckBox // @@ -936,5 +952,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox statusPanelModifiedCheckBox; private System.Windows.Forms.CheckBox statusPanelSizeCheckBox; private System.Windows.Forms.GroupBox statusPanelLabelsGroupBox; + private System.Windows.Forms.Label encryptionToolTipLabel; + private System.Windows.Forms.ToolTip settingsToolTip; } } \ No newline at end of file diff --git a/Crypto Notepad/SettingsForm.cs b/Crypto Notepad/SettingsForm.cs index ca32613..ce350da 100644 --- a/Crypto Notepad/SettingsForm.cs +++ b/Crypto Notepad/SettingsForm.cs @@ -57,6 +57,7 @@ private void LoadSettings() statusPanelModifiedCheckBox.Checked = settings.statusPanelModified; statusPanelSizeCheckBox.Checked = settings.statusPanelSize; statusPanelLabelsGroupBox.Visible = settings.statusPanelVisible; + encryptionToolTipLabel.Visible = settings.encryptionToolTip; } private static void AssociateExtension(string applicationExecutablePath, string extension) @@ -619,15 +620,23 @@ private void StatusPanelModifiedCheckBox_Click(object sender, EventArgs e) main.StatusPanelFileInfo(); } - private void statusPanelSizeCheckBox_Click(object sender, EventArgs e) + private void StatusPanelSizeCheckBox_Click(object sender, EventArgs e) { MainForm main = Owner as MainForm; main.statusPanelSizeLabel.Visible = statusPanelSizeCheckBox.Checked; settings.statusPanelSize = statusPanelSizeCheckBox.Checked; main.StatusPanelFileInfo(); } + #endregion - + private void EncryptionToolTipLabel_MouseClick(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + encryptionToolTipLabel.Visible = false; + settings.encryptionToolTip = false; + } + } } } \ No newline at end of file diff --git a/Crypto Notepad/SettingsForm.resx b/Crypto Notepad/SettingsForm.resx index add797e..971dc00 100644 --- a/Crypto Notepad/SettingsForm.resx +++ b/Crypto Notepad/SettingsForm.resx @@ -120,6 +120,12 @@ 17, 17 + + For the best balance of performance && security is recommended to use SHA512 Hash / 256 Key size / above 2000000 Password iterations. But caution, if you change this parameters you will not able to decrypt previously encrypted files with old parameters. + + + 240, 17 + 131, 17