Devin Martin avatar Devin Martin committed 66635fa

KeePass 2.21 added plugin specified placeholder hints. Take advantage of this in KeeOtp.

Comments (0)

Files changed (1)


+using System;
+using System.Windows.Forms;
 using KeePass.Plugins;
 using KeePass.Util;
 using KeePass.Util.Spr;
 using KeePassLib;
 using KeePassLib.Utility;
 using OtpSharp;
-using System;
-using System.Windows.Forms;
 namespace KeeOtp
         private ToolStripItem otpTopDialogToolStripItem;
         private ToolStripItem otpTopSeperatorToolStripItem;
+        private const string totpPlaceHolderHint = "{TOTP}";
         public override bool Initialize(IPluginHost host)
+            // this adds a hint on the placeholder form under the "plugin provided" section of placeholders
+            SprEngine.FilterPlaceholderHints.Add(totpPlaceHolderHint);
             return true; // Initialization successful
             var toolsMenu = host.MainWindow.ToolsMenu;
+            SprEngine.FilterPlaceholderHints.Remove(totpPlaceHolderHint);
         void otpDialogToolStripItem_Click(object sender, EventArgs e)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.