Commits

Devin Martin  committed ca8399d

Add toolstrip seperator

  • Participants
  • Parent commits 44d352c

Comments (0)

Files changed (3)

File Constants.cs

+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace KeeOtp
+{
+    internal class Constants
+    {
+        public const string OtpDictionaryKey = "OTPAUTH";
+    }
+}

File KeeOtpExt.cs

     public sealed class KeeOtpExt : Plugin
     {
         private IPluginHost host = null;
+        private ToolStripItem otpSeperatorToolStripItem;
         private ToolStripItem otpDialogToolStripItem;
-
-        /// <summary>
-        /// The <c>Initialize</c> function is called by KeePass when
-        /// you should initialize your plugin (create menu items, etc.).
-        /// </summary>
-        /// <param name="host">Plugin host interface. By using this
-        /// interface, you can access the KeePass main window and the
-        /// currently opened database.</param>
-        /// <returns>You must return <c>true</c> in order to signal
-        /// successful initialization. If you return <c>false</c>,
-        /// KeePass unloads your plugin (without calling the
-        /// <c>Terminate</c> function of your plugin).</returns>
+        
         public override bool Initialize(IPluginHost host)
         {
             Debug.Assert(host != null);
             if (host == null) return false;
             this.host = host;
+
+            this.otpSeperatorToolStripItem = new ToolStripSeparator();
+            host.MainWindow.EntryContextMenu.Items.Add(this.otpSeperatorToolStripItem);
+
             this.otpDialogToolStripItem = host.MainWindow.EntryContextMenu.Items.Add("One Time Passwords");
             this.otpDialogToolStripItem.Click += new EventHandler(otpDialogToolStripItem_Click);
             return true; // Initialization successful
         }
 
-        /// <summary>
-        /// The <c>Terminate</c> function is called by KeePass when
-        /// you should free all resources, close open files/streams,
-        /// etc. It is also recommended that you remove all your
-        /// plugin menu items from the KeePass menu.
-        /// </summary>
         public override void Terminate()
         {
             // Remove all of our menu items
-            ToolStripItemCollection tsMenu = host.MainWindow.EntryContextMenu.Items;
-            tsMenu.Remove(otpDialogToolStripItem);
+            ToolStripItemCollection menu = host.MainWindow.EntryContextMenu.Items;
+            menu.Remove(otpSeperatorToolStripItem);
+            menu.Remove(otpDialogToolStripItem);
         }
 
         void otpDialogToolStripItem_Click(object sender, EventArgs e)
             var entry = entries[0];
 
             ShowOneTimePasswords form = new ShowOneTimePasswords(entry);
-            form.Show();
+            form.ShowDialog();
         }
     }
 }

File ShowOneTimePasswords.Designer.cs

             this.labelOtp = new System.Windows.Forms.Label();
             this.labelRemaining = new System.Windows.Forms.Label();
             this.labelRemainingLabel = new System.Windows.Forms.Label();
+            this.labelInstructions = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // labelOtp
             this.labelRemainingLabel.TabIndex = 2;
             this.labelRemainingLabel.Text = "Time Remaining:";
             // 
+            // labelInstructions
+            // 
+            this.labelInstructions.Location = new System.Drawing.Point(31, 9);
+            this.labelInstructions.Name = "labelInstructions";
+            this.labelInstructions.Size = new System.Drawing.Size(226, 42);
+            this.labelInstructions.TabIndex = 3;
+            this.labelInstructions.Text = "Enter this code in the verification system.  If problems occur contunually double" +
+    " check that the clock on your computer is set precisely.  Be sure to double chec" +
+    "k the time zone as well.";
+            // 
             // ShowOneTimePasswords
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(284, 262);
+            this.ClientSize = new System.Drawing.Size(284, 161);
+            this.Controls.Add(this.labelInstructions);
             this.Controls.Add(this.labelRemainingLabel);
             this.Controls.Add(this.labelRemaining);
             this.Controls.Add(this.labelOtp);
         private System.Windows.Forms.Label labelOtp;
         private System.Windows.Forms.Label labelRemaining;
         private System.Windows.Forms.Label labelRemainingLabel;
+        private System.Windows.Forms.Label labelInstructions;
     }
 }