diff --git a/AutoTypeSearch/AutoTypeSearch.csproj b/AutoTypeSearch/AutoTypeSearch.csproj index 8572a12..a211b89 100755 --- a/AutoTypeSearch/AutoTypeSearch.csproj +++ b/AutoTypeSearch/AutoTypeSearch.csproj @@ -115,6 +115,9 @@ + + + IF $(ConfigurationName) == Release "$(ProjectDir)..\CreatePlgX.bat" diff --git a/AutoTypeSearch/AutoTypeSearch.csproj b/AutoTypeSearch/AutoTypeSearch.csproj index 8572a12..a211b89 100755 --- a/AutoTypeSearch/AutoTypeSearch.csproj +++ b/AutoTypeSearch/AutoTypeSearch.csproj @@ -115,6 +115,9 @@ + + + IF $(ConfigurationName) == Release "$(ProjectDir)..\CreatePlgX.bat" diff --git a/AutoTypeSearch/Delete.png b/AutoTypeSearch/Delete.png new file mode 100644 index 0000000..9d61fb8 --- /dev/null +++ b/AutoTypeSearch/Delete.png Binary files differ diff --git a/AutoTypeSearch/AutoTypeSearch.csproj b/AutoTypeSearch/AutoTypeSearch.csproj index 8572a12..a211b89 100755 --- a/AutoTypeSearch/AutoTypeSearch.csproj +++ b/AutoTypeSearch/AutoTypeSearch.csproj @@ -115,6 +115,9 @@ + + + IF $(ConfigurationName) == Release "$(ProjectDir)..\CreatePlgX.bat" diff --git a/AutoTypeSearch/Delete.png b/AutoTypeSearch/Delete.png new file mode 100644 index 0000000..9d61fb8 --- /dev/null +++ b/AutoTypeSearch/Delete.png Binary files differ diff --git a/AutoTypeSearch/Options.Designer.cs b/AutoTypeSearch/Options.Designer.cs index 4886b6d..8844dbd 100755 --- a/AutoTypeSearch/Options.Designer.cs +++ b/AutoTypeSearch/Options.Designer.cs @@ -1,4 +1,4 @@ -using KeePass.UI; +using KeePass.UI; namespace AutoTypeSearch { @@ -30,295 +30,394 @@ /// private void InitializeComponent() { - System.Windows.Forms.GroupBox searchOptionsGroup; - System.Windows.Forms.GroupBox searchInGroup; - System.Windows.Forms.GroupBox actionsGroup; - System.Windows.Forms.Label alternativeActionLabel; - System.Windows.Forms.Label defaultActionLabel; - this.mResolveReferences = new System.Windows.Forms.CheckBox(); - this.mExcludeExpired = new System.Windows.Forms.CheckBox(); - this.mCaseSensitive = new System.Windows.Forms.CheckBox(); - this.mSearchInTags = new System.Windows.Forms.CheckBox(); - this.mSearchInOtherFields = new System.Windows.Forms.CheckBox(); - this.mSearchInNotes = new System.Windows.Forms.CheckBox(); - this.mSearchInUrl = new System.Windows.Forms.CheckBox(); - this.mSearchInUserName = new System.Windows.Forms.CheckBox(); - this.mSearchInTitle = new System.Windows.Forms.CheckBox(); - this.mAlternativeAction = new System.Windows.Forms.ComboBox(); - this.mDefaultAction = new System.Windows.Forms.ComboBox(); - this.mShowHotKeyControl = new KeePass.UI.HotKeyControlEx(); - this.mShowSearchGroup = new System.Windows.Forms.GroupBox(); - this.mShowOnHotKey = new System.Windows.Forms.CheckBox(); - this.mShowOnIPC = new System.Windows.Forms.CheckBox(); - this.mShowOnFailedSearch = new System.Windows.Forms.CheckBox(); - searchOptionsGroup = new System.Windows.Forms.GroupBox(); - searchInGroup = new System.Windows.Forms.GroupBox(); - actionsGroup = new System.Windows.Forms.GroupBox(); - alternativeActionLabel = new System.Windows.Forms.Label(); - defaultActionLabel = new System.Windows.Forms.Label(); - searchOptionsGroup.SuspendLayout(); - searchInGroup.SuspendLayout(); - actionsGroup.SuspendLayout(); - this.mShowSearchGroup.SuspendLayout(); - this.SuspendLayout(); - // - // searchOptionsGroup - // - searchOptionsGroup.Controls.Add(this.mResolveReferences); - searchOptionsGroup.Controls.Add(this.mExcludeExpired); - searchOptionsGroup.Controls.Add(this.mCaseSensitive); - searchOptionsGroup.Location = new System.Drawing.Point(6, 189); - searchOptionsGroup.Name = "searchOptionsGroup"; - searchOptionsGroup.Size = new System.Drawing.Size(540, 45); - searchOptionsGroup.TabIndex = 2; - searchOptionsGroup.TabStop = false; - searchOptionsGroup.Text = "Search options"; - // - // mResolveReferences - // - this.mResolveReferences.AutoSize = true; - this.mResolveReferences.Location = new System.Drawing.Point(251, 20); - this.mResolveReferences.Name = "mResolveReferences"; - this.mResolveReferences.Size = new System.Drawing.Size(170, 17); - this.mResolveReferences.TabIndex = 2; - this.mResolveReferences.Text = "Resolve fiel&d references (slow)"; - this.mResolveReferences.UseVisualStyleBackColor = true; - // - // mExcludeExpired - // - this.mExcludeExpired.AutoSize = true; - this.mExcludeExpired.Location = new System.Drawing.Point(108, 20); - this.mExcludeExpired.Name = "mExcludeExpired"; - this.mExcludeExpired.Size = new System.Drawing.Size(135, 17); - this.mExcludeExpired.TabIndex = 1; - this.mExcludeExpired.Text = "Exclude &expired entries"; - this.mExcludeExpired.UseVisualStyleBackColor = true; - // - // mCaseSensitive - // - this.mCaseSensitive.AutoSize = true; - this.mCaseSensitive.Location = new System.Drawing.Point(10, 20); - this.mCaseSensitive.Name = "mCaseSensitive"; - this.mCaseSensitive.Size = new System.Drawing.Size(94, 17); - this.mCaseSensitive.TabIndex = 0; - this.mCaseSensitive.Text = "Case-sensiti&ve"; - this.mCaseSensitive.UseVisualStyleBackColor = true; - // - // searchInGroup - // - searchInGroup.Controls.Add(this.mSearchInTags); - searchInGroup.Controls.Add(this.mSearchInOtherFields); - searchInGroup.Controls.Add(this.mSearchInNotes); - searchInGroup.Controls.Add(this.mSearchInUrl); - searchInGroup.Controls.Add(this.mSearchInUserName); - searchInGroup.Controls.Add(this.mSearchInTitle); - searchInGroup.Location = new System.Drawing.Point(6, 136); - searchInGroup.Name = "searchInGroup"; - searchInGroup.Size = new System.Drawing.Size(540, 47); - searchInGroup.TabIndex = 1; - searchInGroup.TabStop = false; - searchInGroup.Text = "Search in"; - // - // mSearchInTags - // - this.mSearchInTags.AutoSize = true; - this.mSearchInTags.Location = new System.Drawing.Point(258, 19); - this.mSearchInTags.Name = "mSearchInTags"; - this.mSearchInTags.Size = new System.Drawing.Size(50, 17); - this.mSearchInTags.TabIndex = 4; - this.mSearchInTags.Text = "Ta&gs"; - this.mSearchInTags.UseVisualStyleBackColor = true; - // - // mSearchInOtherFields - // - this.mSearchInOtherFields.AutoSize = true; - this.mSearchInOtherFields.Location = new System.Drawing.Point(314, 19); - this.mSearchInOtherFields.Name = "mSearchInOtherFields"; - this.mSearchInOtherFields.Size = new System.Drawing.Size(139, 17); - this.mSearchInOtherFields.TabIndex = 5; - this.mSearchInOtherFields.Text = "&Other unprotected fields"; - this.mSearchInOtherFields.UseVisualStyleBackColor = true; - // - // mSearchInNotes - // - this.mSearchInNotes.AutoSize = true; - this.mSearchInNotes.Location = new System.Drawing.Point(198, 19); - this.mSearchInNotes.Name = "mSearchInNotes"; - this.mSearchInNotes.Size = new System.Drawing.Size(54, 17); - this.mSearchInNotes.TabIndex = 3; - this.mSearchInNotes.Text = "Note&s"; - this.mSearchInNotes.UseVisualStyleBackColor = true; - // - // mSearchInUrl - // - this.mSearchInUrl.AutoSize = true; - this.mSearchInUrl.Location = new System.Drawing.Point(144, 19); - this.mSearchInUrl.Name = "mSearchInUrl"; - this.mSearchInUrl.Size = new System.Drawing.Size(48, 17); - this.mSearchInUrl.TabIndex = 2; - this.mSearchInUrl.Text = "&URL"; - this.mSearchInUrl.UseVisualStyleBackColor = true; - // - // mSearchInUserName - // - this.mSearchInUserName.AutoSize = true; - this.mSearchInUserName.Location = new System.Drawing.Point(61, 19); - this.mSearchInUserName.Name = "mSearchInUserName"; - this.mSearchInUserName.Size = new System.Drawing.Size(77, 17); - this.mSearchInUserName.TabIndex = 1; - this.mSearchInUserName.Text = "User &name"; - this.mSearchInUserName.UseVisualStyleBackColor = true; - // - // mSearchInTitle - // - this.mSearchInTitle.AutoSize = true; - this.mSearchInTitle.Location = new System.Drawing.Point(9, 19); - this.mSearchInTitle.Name = "mSearchInTitle"; - this.mSearchInTitle.Size = new System.Drawing.Size(46, 17); - this.mSearchInTitle.TabIndex = 0; - this.mSearchInTitle.Text = "&Title"; - this.mSearchInTitle.UseVisualStyleBackColor = true; - // - // actionsGroup - // - actionsGroup.Controls.Add(this.mAlternativeAction); - actionsGroup.Controls.Add(this.mDefaultAction); - actionsGroup.Controls.Add(alternativeActionLabel); - actionsGroup.Controls.Add(defaultActionLabel); - actionsGroup.Location = new System.Drawing.Point(6, 241); - actionsGroup.Name = "actionsGroup"; - actionsGroup.Size = new System.Drawing.Size(540, 67); - actionsGroup.TabIndex = 3; - actionsGroup.TabStop = false; - actionsGroup.Text = "Actions"; - // - // mAlternativeAction - // - this.mAlternativeAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.mAlternativeAction.Location = new System.Drawing.Point(288, 37); - this.mAlternativeAction.Name = "mAlternativeAction"; - this.mAlternativeAction.Size = new System.Drawing.Size(240, 21); - this.mAlternativeAction.TabIndex = 3; - // - // mDefaultAction - // - this.mDefaultAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.mDefaultAction.Location = new System.Drawing.Point(11, 37); - this.mDefaultAction.Name = "mDefaultAction"; - this.mDefaultAction.Size = new System.Drawing.Size(240, 21); - this.mDefaultAction.TabIndex = 1; - // - // alternativeActionLabel - // - alternativeActionLabel.AutoSize = true; - alternativeActionLabel.Location = new System.Drawing.Point(285, 20); - alternativeActionLabel.Name = "alternativeActionLabel"; - alternativeActionLabel.Size = new System.Drawing.Size(159, 13); - alternativeActionLabel.TabIndex = 2; - alternativeActionLabel.Text = "A<ernative action (Shift + Enter):"; - // - // defaultActionLabel - // - defaultActionLabel.AutoSize = true; - defaultActionLabel.Location = new System.Drawing.Point(8, 20); - defaultActionLabel.Name = "defaultActionLabel"; - defaultActionLabel.Size = new System.Drawing.Size(110, 13); - defaultActionLabel.TabIndex = 0; - defaultActionLabel.Text = "De&fault action (Enter):"; - // - // mShowHotKeyControl - // - this.mShowHotKeyControl.Location = new System.Drawing.Point(30, 65); - this.mShowHotKeyControl.Name = "mShowHotKeyControl"; - this.mShowHotKeyControl.Size = new System.Drawing.Size(123, 20); - this.mShowHotKeyControl.TabIndex = 2; - // - // mShowSearchGroup - // - this.mShowSearchGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + System.Windows.Forms.GroupBox searchInGroup; + System.Windows.Forms.GroupBox actionsGroup; + System.Windows.Forms.Label alternativeActionLabel; + System.Windows.Forms.Label defaultActionLabel; + System.Windows.Forms.GroupBox searchOptionsGroup; + this.mSearchInTags = new System.Windows.Forms.CheckBox(); + this.mSearchInOtherFields = new System.Windows.Forms.CheckBox(); + this.mSearchInNotes = new System.Windows.Forms.CheckBox(); + this.mSearchInUrl = new System.Windows.Forms.CheckBox(); + this.mSearchInUserName = new System.Windows.Forms.CheckBox(); + this.mSearchInTitle = new System.Windows.Forms.CheckBox(); + this.mAlternativeAction = new System.Windows.Forms.ComboBox(); + this.mDefaultAction = new System.Windows.Forms.ComboBox(); + this.mResolveReferences = new System.Windows.Forms.CheckBox(); + this.mExcludeExpired = new System.Windows.Forms.CheckBox(); + this.mCaseSensitive = new System.Windows.Forms.CheckBox(); + this.mPanel = new System.Windows.Forms.Panel(); + this.mShowSearchGroup = new System.Windows.Forms.GroupBox(); + this.mShowOnHotKey = new System.Windows.Forms.CheckBox(); + this.mShowHotKeyControl = new KeePass.UI.HotKeyControlEx(); + this.mShowOnIPC = new System.Windows.Forms.CheckBox(); + this.mShowOnFailedSearch = new System.Windows.Forms.CheckBox(); + this.mCustomSequences = new System.Windows.Forms.GroupBox(); + this.mAdditionalSequences = new AutoTypeSearch.EditableStringList(); + this.mAdditionalSequencesTitle = new System.Windows.Forms.Label(); + this.mAllowCustomSequences = new System.Windows.Forms.CheckBox(); + searchInGroup = new System.Windows.Forms.GroupBox(); + actionsGroup = new System.Windows.Forms.GroupBox(); + alternativeActionLabel = new System.Windows.Forms.Label(); + defaultActionLabel = new System.Windows.Forms.Label(); + searchOptionsGroup = new System.Windows.Forms.GroupBox(); + searchInGroup.SuspendLayout(); + actionsGroup.SuspendLayout(); + searchOptionsGroup.SuspendLayout(); + this.mPanel.SuspendLayout(); + this.mShowSearchGroup.SuspendLayout(); + this.mCustomSequences.SuspendLayout(); + this.SuspendLayout(); + // + // searchInGroup + // + searchInGroup.Controls.Add(this.mSearchInTags); + searchInGroup.Controls.Add(this.mSearchInOtherFields); + searchInGroup.Controls.Add(this.mSearchInNotes); + searchInGroup.Controls.Add(this.mSearchInUrl); + searchInGroup.Controls.Add(this.mSearchInUserName); + searchInGroup.Controls.Add(this.mSearchInTitle); + searchInGroup.Location = new System.Drawing.Point(4, 197); + searchInGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchInGroup.Name = "searchInGroup"; + searchInGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchInGroup.Size = new System.Drawing.Size(764, 72); + searchInGroup.TabIndex = 1; + searchInGroup.TabStop = false; + searchInGroup.Text = "Search in"; + // + // mSearchInTags + // + this.mSearchInTags.AutoSize = true; + this.mSearchInTags.Location = new System.Drawing.Point(387, 29); + this.mSearchInTags.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInTags.Name = "mSearchInTags"; + this.mSearchInTags.Size = new System.Drawing.Size(70, 24); + this.mSearchInTags.TabIndex = 4; + this.mSearchInTags.Text = "Ta&gs"; + this.mSearchInTags.UseVisualStyleBackColor = true; + // + // mSearchInOtherFields + // + this.mSearchInOtherFields.AutoSize = true; + this.mSearchInOtherFields.Location = new System.Drawing.Point(471, 29); + this.mSearchInOtherFields.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInOtherFields.Name = "mSearchInOtherFields"; + this.mSearchInOtherFields.Size = new System.Drawing.Size(206, 24); + this.mSearchInOtherFields.TabIndex = 5; + this.mSearchInOtherFields.Text = "&Other unprotected fields"; + this.mSearchInOtherFields.UseVisualStyleBackColor = true; + // + // mSearchInNotes + // + this.mSearchInNotes.AutoSize = true; + this.mSearchInNotes.Location = new System.Drawing.Point(297, 29); + this.mSearchInNotes.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInNotes.Name = "mSearchInNotes"; + this.mSearchInNotes.Size = new System.Drawing.Size(77, 24); + this.mSearchInNotes.TabIndex = 3; + this.mSearchInNotes.Text = "Note&s"; + this.mSearchInNotes.UseVisualStyleBackColor = true; + // + // mSearchInUrl + // + this.mSearchInUrl.AutoSize = true; + this.mSearchInUrl.Location = new System.Drawing.Point(216, 29); + this.mSearchInUrl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInUrl.Name = "mSearchInUrl"; + this.mSearchInUrl.Size = new System.Drawing.Size(68, 24); + this.mSearchInUrl.TabIndex = 2; + this.mSearchInUrl.Text = "&URL"; + this.mSearchInUrl.UseVisualStyleBackColor = true; + // + // mSearchInUserName + // + this.mSearchInUserName.AutoSize = true; + this.mSearchInUserName.Location = new System.Drawing.Point(92, 29); + this.mSearchInUserName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInUserName.Name = "mSearchInUserName"; + this.mSearchInUserName.Size = new System.Drawing.Size(113, 24); + this.mSearchInUserName.TabIndex = 1; + this.mSearchInUserName.Text = "User &name"; + this.mSearchInUserName.UseVisualStyleBackColor = true; + // + // mSearchInTitle + // + this.mSearchInTitle.AutoSize = true; + this.mSearchInTitle.Location = new System.Drawing.Point(14, 29); + this.mSearchInTitle.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInTitle.Name = "mSearchInTitle"; + this.mSearchInTitle.Size = new System.Drawing.Size(64, 24); + this.mSearchInTitle.TabIndex = 0; + this.mSearchInTitle.Text = "&Title"; + this.mSearchInTitle.UseVisualStyleBackColor = true; + // + // actionsGroup + // + actionsGroup.Controls.Add(this.mAlternativeAction); + actionsGroup.Controls.Add(this.mDefaultAction); + actionsGroup.Controls.Add(alternativeActionLabel); + actionsGroup.Controls.Add(defaultActionLabel); + actionsGroup.Location = new System.Drawing.Point(4, 358); + actionsGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + actionsGroup.Name = "actionsGroup"; + actionsGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + actionsGroup.Size = new System.Drawing.Size(764, 103); + actionsGroup.TabIndex = 3; + actionsGroup.TabStop = false; + actionsGroup.Text = "Actions"; + // + // mAlternativeAction + // + this.mAlternativeAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.mAlternativeAction.Location = new System.Drawing.Point(392, 57); + this.mAlternativeAction.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mAlternativeAction.Name = "mAlternativeAction"; + this.mAlternativeAction.Size = new System.Drawing.Size(358, 28); + this.mAlternativeAction.TabIndex = 3; + // + // mDefaultAction + // + this.mDefaultAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.mDefaultAction.Location = new System.Drawing.Point(16, 57); + this.mDefaultAction.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mDefaultAction.Name = "mDefaultAction"; + this.mDefaultAction.Size = new System.Drawing.Size(358, 28); + this.mDefaultAction.TabIndex = 1; + // + // alternativeActionLabel + // + alternativeActionLabel.AutoSize = true; + alternativeActionLabel.Location = new System.Drawing.Point(388, 31); + alternativeActionLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + alternativeActionLabel.Name = "alternativeActionLabel"; + alternativeActionLabel.Size = new System.Drawing.Size(238, 20); + alternativeActionLabel.TabIndex = 2; + alternativeActionLabel.Text = "A<ernative action (Shift + Enter):"; + // + // defaultActionLabel + // + defaultActionLabel.AutoSize = true; + defaultActionLabel.Location = new System.Drawing.Point(12, 31); + defaultActionLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + defaultActionLabel.Name = "defaultActionLabel"; + defaultActionLabel.Size = new System.Drawing.Size(165, 20); + defaultActionLabel.TabIndex = 0; + defaultActionLabel.Text = "De&fault action (Enter):"; + // + // searchOptionsGroup + // + searchOptionsGroup.Controls.Add(this.mResolveReferences); + searchOptionsGroup.Controls.Add(this.mExcludeExpired); + searchOptionsGroup.Controls.Add(this.mCaseSensitive); + searchOptionsGroup.Location = new System.Drawing.Point(4, 279); + searchOptionsGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchOptionsGroup.Name = "searchOptionsGroup"; + searchOptionsGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchOptionsGroup.Size = new System.Drawing.Size(764, 69); + searchOptionsGroup.TabIndex = 2; + searchOptionsGroup.TabStop = false; + searchOptionsGroup.Text = "Search options"; + // + // mResolveReferences + // + this.mResolveReferences.AutoSize = true; + this.mResolveReferences.Location = new System.Drawing.Point(376, 31); + this.mResolveReferences.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mResolveReferences.Name = "mResolveReferences"; + this.mResolveReferences.Size = new System.Drawing.Size(250, 24); + this.mResolveReferences.TabIndex = 2; + this.mResolveReferences.Text = "Resolve fiel&d references (slow)"; + this.mResolveReferences.UseVisualStyleBackColor = true; + // + // mExcludeExpired + // + this.mExcludeExpired.AutoSize = true; + this.mExcludeExpired.Location = new System.Drawing.Point(162, 31); + this.mExcludeExpired.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mExcludeExpired.Name = "mExcludeExpired"; + this.mExcludeExpired.Size = new System.Drawing.Size(198, 24); + this.mExcludeExpired.TabIndex = 1; + this.mExcludeExpired.Text = "Exclude &expired entries"; + this.mExcludeExpired.UseVisualStyleBackColor = true; + // + // mCaseSensitive + // + this.mCaseSensitive.AutoSize = true; + this.mCaseSensitive.Location = new System.Drawing.Point(15, 31); + this.mCaseSensitive.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mCaseSensitive.Name = "mCaseSensitive"; + this.mCaseSensitive.Size = new System.Drawing.Size(138, 24); + this.mCaseSensitive.TabIndex = 0; + this.mCaseSensitive.Text = "Case-sensiti&ve"; + this.mCaseSensitive.UseVisualStyleBackColor = true; + // + // mPanel + // + this.mPanel.AutoScroll = true; + this.mPanel.Controls.Add(this.mShowSearchGroup); + this.mPanel.Controls.Add(this.mCustomSequences); + this.mPanel.Controls.Add(searchOptionsGroup); + this.mPanel.Controls.Add(actionsGroup); + this.mPanel.Controls.Add(searchInGroup); + this.mPanel.Location = new System.Drawing.Point(9, 18); + this.mPanel.Name = "mPanel"; + this.mPanel.Size = new System.Drawing.Size(808, 463); + this.mPanel.TabIndex = 5; + // + // mShowSearchGroup + // + this.mShowSearchGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.mShowSearchGroup.Controls.Add(this.mShowOnHotKey); - this.mShowSearchGroup.Controls.Add(this.mShowHotKeyControl); - this.mShowSearchGroup.Controls.Add(this.mShowOnIPC); - this.mShowSearchGroup.Controls.Add(this.mShowOnFailedSearch); - this.mShowSearchGroup.Location = new System.Drawing.Point(6, 12); - this.mShowSearchGroup.Name = "mShowSearchGroup"; - this.mShowSearchGroup.Size = new System.Drawing.Size(540, 118); - this.mShowSearchGroup.TabIndex = 0; - this.mShowSearchGroup.TabStop = false; - this.mShowSearchGroup.Text = "Show search window"; - // - // mShowOnHotKey - // - this.mShowOnHotKey.AutoSize = true; - this.mShowOnHotKey.Location = new System.Drawing.Point(10, 44); - this.mShowOnHotKey.Name = "mShowOnHotKey"; - this.mShowOnHotKey.Size = new System.Drawing.Size(233, 17); - this.mShowOnHotKey.TabIndex = 1; - this.mShowOnHotKey.Text = "Show when system-wide &hot key is pressed:"; - this.mShowOnHotKey.UseVisualStyleBackColor = true; - this.mShowOnHotKey.CheckedChanged += new System.EventHandler(this.mShowOnHotKey_CheckedChanged); - // - // mShowOnIPC - // - this.mShowOnIPC.AutoSize = true; - this.mShowOnIPC.Location = new System.Drawing.Point(10, 93); - this.mShowOnIPC.Name = "mShowOnIPC"; - this.mShowOnIPC.Size = new System.Drawing.Size(386, 17); - this.mShowOnIPC.TabIndex = 3; - this.mShowOnIPC.Text = "Show when \"/e1:AutoTypeSearch\" is passed as a ¶meter to KeePass.exe"; - this.mShowOnIPC.UseVisualStyleBackColor = true; - // - // mShowOnFailedSearch - // - this.mShowOnFailedSearch.AutoSize = true; - this.mShowOnFailedSearch.Location = new System.Drawing.Point(10, 21); - this.mShowOnFailedSearch.Name = "mShowOnFailedSearch"; - this.mShowOnFailedSearch.Size = new System.Drawing.Size(275, 17); - this.mShowOnFailedSearch.TabIndex = 0; - this.mShowOnFailedSearch.Text = "Show &automatically if global auto-type finds no match"; - this.mShowOnFailedSearch.UseVisualStyleBackColor = true; - // - // Options - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(actionsGroup); - this.Controls.Add(searchInGroup); - this.Controls.Add(searchOptionsGroup); - this.Controls.Add(this.mShowSearchGroup); - this.Name = "Options"; - this.Size = new System.Drawing.Size(551, 311); - searchOptionsGroup.ResumeLayout(false); - searchOptionsGroup.PerformLayout(); - searchInGroup.ResumeLayout(false); - searchInGroup.PerformLayout(); - actionsGroup.ResumeLayout(false); - actionsGroup.PerformLayout(); - this.mShowSearchGroup.ResumeLayout(false); - this.mShowSearchGroup.PerformLayout(); - this.ResumeLayout(false); + this.mShowSearchGroup.Controls.Add(this.mShowOnHotKey); + this.mShowSearchGroup.Controls.Add(this.mShowHotKeyControl); + this.mShowSearchGroup.Controls.Add(this.mShowOnIPC); + this.mShowSearchGroup.Controls.Add(this.mShowOnFailedSearch); + this.mShowSearchGroup.Location = new System.Drawing.Point(4, 5); + this.mShowSearchGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowSearchGroup.Name = "mShowSearchGroup"; + this.mShowSearchGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowSearchGroup.Size = new System.Drawing.Size(764, 182); + this.mShowSearchGroup.TabIndex = 0; + this.mShowSearchGroup.TabStop = false; + this.mShowSearchGroup.Text = "Show search window"; + // + // mShowOnHotKey + // + this.mShowOnHotKey.AutoSize = true; + this.mShowOnHotKey.Location = new System.Drawing.Point(15, 68); + this.mShowOnHotKey.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnHotKey.Name = "mShowOnHotKey"; + this.mShowOnHotKey.Size = new System.Drawing.Size(343, 24); + this.mShowOnHotKey.TabIndex = 1; + this.mShowOnHotKey.Text = "Show when system-wide &hot key is pressed:"; + this.mShowOnHotKey.UseVisualStyleBackColor = true; + this.mShowOnHotKey.CheckedChanged += new System.EventHandler(this.mShowOnHotKey_CheckedChanged); + // + // mShowHotKeyControl + // + this.mShowHotKeyControl.Location = new System.Drawing.Point(45, 100); + this.mShowHotKeyControl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowHotKeyControl.Name = "mShowHotKeyControl"; + this.mShowHotKeyControl.Size = new System.Drawing.Size(182, 26); + this.mShowHotKeyControl.TabIndex = 2; + // + // mShowOnIPC + // + this.mShowOnIPC.AutoSize = true; + this.mShowOnIPC.Location = new System.Drawing.Point(15, 143); + this.mShowOnIPC.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnIPC.Name = "mShowOnIPC"; + this.mShowOnIPC.Size = new System.Drawing.Size(574, 24); + this.mShowOnIPC.TabIndex = 3; + this.mShowOnIPC.Text = "Show when \"/e1:AutoTypeSearch\" is passed as a ¶meter to KeePass.exe"; + this.mShowOnIPC.UseVisualStyleBackColor = true; + // + // mShowOnFailedSearch + // + this.mShowOnFailedSearch.AutoSize = true; + this.mShowOnFailedSearch.Location = new System.Drawing.Point(15, 32); + this.mShowOnFailedSearch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnFailedSearch.Name = "mShowOnFailedSearch"; + this.mShowOnFailedSearch.Size = new System.Drawing.Size(408, 24); + this.mShowOnFailedSearch.TabIndex = 0; + this.mShowOnFailedSearch.Text = "Show &automatically if global auto-type finds no match"; + this.mShowOnFailedSearch.UseVisualStyleBackColor = true; + // + // mCustomSequences + // + this.mCustomSequences.Controls.Add(this.mAdditionalSequences); + this.mCustomSequences.Controls.Add(this.mAdditionalSequencesTitle); + this.mCustomSequences.Controls.Add(this.mAllowCustomSequences); + this.mCustomSequences.Location = new System.Drawing.Point(4, 469); + this.mCustomSequences.Name = "mCustomSequences"; + this.mCustomSequences.Size = new System.Drawing.Size(764, 206); + this.mCustomSequences.TabIndex = 4; + this.mCustomSequences.TabStop = false; + this.mCustomSequences.Text = "Custom Sequences"; + // + // mAdditionalSequences + // + this.mAdditionalSequences.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.mAdditionalSequences.FormattingEnabled = true; + this.mAdditionalSequences.ItemHeight = 20; + this.mAdditionalSequences.Items.AddRange(new object[] { + "+ new sequence", + "+ new sequence"}); + this.mAdditionalSequences.Location = new System.Drawing.Point(6, 87); + this.mAdditionalSequences.Name = "mAdditionalSequences"; + this.mAdditionalSequences.Size = new System.Drawing.Size(744, 104); + this.mAdditionalSequences.TabIndex = 9; + this.mAdditionalSequences.StartEdit += new System.EventHandler(this.mAdditionalSequences_StartEdit); + this.mAdditionalSequences.FinishEdit += new AutoTypeSearch.FinishEditEventHandler(this.mAdditionalSequences_FinishEdit); + this.mAdditionalSequences.SelectedIndexChanged += new System.EventHandler(this.mAdditionalSequences_SelectedIndexChanged); + // + // mAdditionalSequencesTitle + // + this.mAdditionalSequencesTitle.AutoSize = true; + this.mAdditionalSequencesTitle.Location = new System.Drawing.Point(6, 61); + this.mAdditionalSequencesTitle.Name = "mAdditionalSequencesTitle"; + this.mAdditionalSequencesTitle.Size = new System.Drawing.Size(221, 20); + this.mAdditionalSequencesTitle.TabIndex = 8; + this.mAdditionalSequencesTitle.Text = "Add&itional custom sequences:"; + // + // mAllowCustomSequences + // + this.mAllowCustomSequences.AutoSize = true; + this.mAllowCustomSequences.Location = new System.Drawing.Point(7, 27); + this.mAllowCustomSequences.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mAllowCustomSequences.Name = "mAllowCustomSequences"; + this.mAllowCustomSequences.Size = new System.Drawing.Size(281, 24); + this.mAllowCustomSequences.TabIndex = 6; + this.mAllowCustomSequences.Text = "Allow &custom auto-type sequences"; + this.mAllowCustomSequences.UseVisualStyleBackColor = true; + // + // Options + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.mPanel); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "Options"; + this.Size = new System.Drawing.Size(834, 499); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.Options_Paint); + searchInGroup.ResumeLayout(false); + searchInGroup.PerformLayout(); + actionsGroup.ResumeLayout(false); + actionsGroup.PerformLayout(); + searchOptionsGroup.ResumeLayout(false); + searchOptionsGroup.PerformLayout(); + this.mPanel.ResumeLayout(false); + this.mShowSearchGroup.ResumeLayout(false); + this.mShowSearchGroup.PerformLayout(); + this.mCustomSequences.ResumeLayout(false); + this.mCustomSequences.PerformLayout(); + this.ResumeLayout(false); } #endregion - private KeePass.UI.HotKeyControlEx mShowHotKeyControl; + private System.Windows.Forms.Panel mPanel; + private System.Windows.Forms.GroupBox mShowSearchGroup; private System.Windows.Forms.CheckBox mShowOnHotKey; + private HotKeyControlEx mShowHotKeyControl; private System.Windows.Forms.CheckBox mShowOnIPC; private System.Windows.Forms.CheckBox mShowOnFailedSearch; + private System.Windows.Forms.GroupBox mCustomSequences; + private System.Windows.Forms.Label mAdditionalSequencesTitle; + private System.Windows.Forms.CheckBox mAllowCustomSequences; + private System.Windows.Forms.CheckBox mResolveReferences; + private System.Windows.Forms.CheckBox mExcludeExpired; private System.Windows.Forms.CheckBox mCaseSensitive; + private System.Windows.Forms.ComboBox mAlternativeAction; + private System.Windows.Forms.ComboBox mDefaultAction; private System.Windows.Forms.CheckBox mSearchInTags; private System.Windows.Forms.CheckBox mSearchInOtherFields; private System.Windows.Forms.CheckBox mSearchInNotes; private System.Windows.Forms.CheckBox mSearchInUrl; private System.Windows.Forms.CheckBox mSearchInUserName; private System.Windows.Forms.CheckBox mSearchInTitle; - private System.Windows.Forms.CheckBox mResolveReferences; - private System.Windows.Forms.CheckBox mExcludeExpired; - private System.Windows.Forms.ComboBox mAlternativeAction; - private System.Windows.Forms.ComboBox mDefaultAction; - private System.Windows.Forms.GroupBox mShowSearchGroup; - + private EditableStringList mAdditionalSequences; } } diff --git a/AutoTypeSearch/AutoTypeSearch.csproj b/AutoTypeSearch/AutoTypeSearch.csproj index 8572a12..a211b89 100755 --- a/AutoTypeSearch/AutoTypeSearch.csproj +++ b/AutoTypeSearch/AutoTypeSearch.csproj @@ -115,6 +115,9 @@ + + + IF $(ConfigurationName) == Release "$(ProjectDir)..\CreatePlgX.bat" diff --git a/AutoTypeSearch/Delete.png b/AutoTypeSearch/Delete.png new file mode 100644 index 0000000..9d61fb8 --- /dev/null +++ b/AutoTypeSearch/Delete.png Binary files differ diff --git a/AutoTypeSearch/Options.Designer.cs b/AutoTypeSearch/Options.Designer.cs index 4886b6d..8844dbd 100755 --- a/AutoTypeSearch/Options.Designer.cs +++ b/AutoTypeSearch/Options.Designer.cs @@ -1,4 +1,4 @@ -using KeePass.UI; +using KeePass.UI; namespace AutoTypeSearch { @@ -30,295 +30,394 @@ /// private void InitializeComponent() { - System.Windows.Forms.GroupBox searchOptionsGroup; - System.Windows.Forms.GroupBox searchInGroup; - System.Windows.Forms.GroupBox actionsGroup; - System.Windows.Forms.Label alternativeActionLabel; - System.Windows.Forms.Label defaultActionLabel; - this.mResolveReferences = new System.Windows.Forms.CheckBox(); - this.mExcludeExpired = new System.Windows.Forms.CheckBox(); - this.mCaseSensitive = new System.Windows.Forms.CheckBox(); - this.mSearchInTags = new System.Windows.Forms.CheckBox(); - this.mSearchInOtherFields = new System.Windows.Forms.CheckBox(); - this.mSearchInNotes = new System.Windows.Forms.CheckBox(); - this.mSearchInUrl = new System.Windows.Forms.CheckBox(); - this.mSearchInUserName = new System.Windows.Forms.CheckBox(); - this.mSearchInTitle = new System.Windows.Forms.CheckBox(); - this.mAlternativeAction = new System.Windows.Forms.ComboBox(); - this.mDefaultAction = new System.Windows.Forms.ComboBox(); - this.mShowHotKeyControl = new KeePass.UI.HotKeyControlEx(); - this.mShowSearchGroup = new System.Windows.Forms.GroupBox(); - this.mShowOnHotKey = new System.Windows.Forms.CheckBox(); - this.mShowOnIPC = new System.Windows.Forms.CheckBox(); - this.mShowOnFailedSearch = new System.Windows.Forms.CheckBox(); - searchOptionsGroup = new System.Windows.Forms.GroupBox(); - searchInGroup = new System.Windows.Forms.GroupBox(); - actionsGroup = new System.Windows.Forms.GroupBox(); - alternativeActionLabel = new System.Windows.Forms.Label(); - defaultActionLabel = new System.Windows.Forms.Label(); - searchOptionsGroup.SuspendLayout(); - searchInGroup.SuspendLayout(); - actionsGroup.SuspendLayout(); - this.mShowSearchGroup.SuspendLayout(); - this.SuspendLayout(); - // - // searchOptionsGroup - // - searchOptionsGroup.Controls.Add(this.mResolveReferences); - searchOptionsGroup.Controls.Add(this.mExcludeExpired); - searchOptionsGroup.Controls.Add(this.mCaseSensitive); - searchOptionsGroup.Location = new System.Drawing.Point(6, 189); - searchOptionsGroup.Name = "searchOptionsGroup"; - searchOptionsGroup.Size = new System.Drawing.Size(540, 45); - searchOptionsGroup.TabIndex = 2; - searchOptionsGroup.TabStop = false; - searchOptionsGroup.Text = "Search options"; - // - // mResolveReferences - // - this.mResolveReferences.AutoSize = true; - this.mResolveReferences.Location = new System.Drawing.Point(251, 20); - this.mResolveReferences.Name = "mResolveReferences"; - this.mResolveReferences.Size = new System.Drawing.Size(170, 17); - this.mResolveReferences.TabIndex = 2; - this.mResolveReferences.Text = "Resolve fiel&d references (slow)"; - this.mResolveReferences.UseVisualStyleBackColor = true; - // - // mExcludeExpired - // - this.mExcludeExpired.AutoSize = true; - this.mExcludeExpired.Location = new System.Drawing.Point(108, 20); - this.mExcludeExpired.Name = "mExcludeExpired"; - this.mExcludeExpired.Size = new System.Drawing.Size(135, 17); - this.mExcludeExpired.TabIndex = 1; - this.mExcludeExpired.Text = "Exclude &expired entries"; - this.mExcludeExpired.UseVisualStyleBackColor = true; - // - // mCaseSensitive - // - this.mCaseSensitive.AutoSize = true; - this.mCaseSensitive.Location = new System.Drawing.Point(10, 20); - this.mCaseSensitive.Name = "mCaseSensitive"; - this.mCaseSensitive.Size = new System.Drawing.Size(94, 17); - this.mCaseSensitive.TabIndex = 0; - this.mCaseSensitive.Text = "Case-sensiti&ve"; - this.mCaseSensitive.UseVisualStyleBackColor = true; - // - // searchInGroup - // - searchInGroup.Controls.Add(this.mSearchInTags); - searchInGroup.Controls.Add(this.mSearchInOtherFields); - searchInGroup.Controls.Add(this.mSearchInNotes); - searchInGroup.Controls.Add(this.mSearchInUrl); - searchInGroup.Controls.Add(this.mSearchInUserName); - searchInGroup.Controls.Add(this.mSearchInTitle); - searchInGroup.Location = new System.Drawing.Point(6, 136); - searchInGroup.Name = "searchInGroup"; - searchInGroup.Size = new System.Drawing.Size(540, 47); - searchInGroup.TabIndex = 1; - searchInGroup.TabStop = false; - searchInGroup.Text = "Search in"; - // - // mSearchInTags - // - this.mSearchInTags.AutoSize = true; - this.mSearchInTags.Location = new System.Drawing.Point(258, 19); - this.mSearchInTags.Name = "mSearchInTags"; - this.mSearchInTags.Size = new System.Drawing.Size(50, 17); - this.mSearchInTags.TabIndex = 4; - this.mSearchInTags.Text = "Ta&gs"; - this.mSearchInTags.UseVisualStyleBackColor = true; - // - // mSearchInOtherFields - // - this.mSearchInOtherFields.AutoSize = true; - this.mSearchInOtherFields.Location = new System.Drawing.Point(314, 19); - this.mSearchInOtherFields.Name = "mSearchInOtherFields"; - this.mSearchInOtherFields.Size = new System.Drawing.Size(139, 17); - this.mSearchInOtherFields.TabIndex = 5; - this.mSearchInOtherFields.Text = "&Other unprotected fields"; - this.mSearchInOtherFields.UseVisualStyleBackColor = true; - // - // mSearchInNotes - // - this.mSearchInNotes.AutoSize = true; - this.mSearchInNotes.Location = new System.Drawing.Point(198, 19); - this.mSearchInNotes.Name = "mSearchInNotes"; - this.mSearchInNotes.Size = new System.Drawing.Size(54, 17); - this.mSearchInNotes.TabIndex = 3; - this.mSearchInNotes.Text = "Note&s"; - this.mSearchInNotes.UseVisualStyleBackColor = true; - // - // mSearchInUrl - // - this.mSearchInUrl.AutoSize = true; - this.mSearchInUrl.Location = new System.Drawing.Point(144, 19); - this.mSearchInUrl.Name = "mSearchInUrl"; - this.mSearchInUrl.Size = new System.Drawing.Size(48, 17); - this.mSearchInUrl.TabIndex = 2; - this.mSearchInUrl.Text = "&URL"; - this.mSearchInUrl.UseVisualStyleBackColor = true; - // - // mSearchInUserName - // - this.mSearchInUserName.AutoSize = true; - this.mSearchInUserName.Location = new System.Drawing.Point(61, 19); - this.mSearchInUserName.Name = "mSearchInUserName"; - this.mSearchInUserName.Size = new System.Drawing.Size(77, 17); - this.mSearchInUserName.TabIndex = 1; - this.mSearchInUserName.Text = "User &name"; - this.mSearchInUserName.UseVisualStyleBackColor = true; - // - // mSearchInTitle - // - this.mSearchInTitle.AutoSize = true; - this.mSearchInTitle.Location = new System.Drawing.Point(9, 19); - this.mSearchInTitle.Name = "mSearchInTitle"; - this.mSearchInTitle.Size = new System.Drawing.Size(46, 17); - this.mSearchInTitle.TabIndex = 0; - this.mSearchInTitle.Text = "&Title"; - this.mSearchInTitle.UseVisualStyleBackColor = true; - // - // actionsGroup - // - actionsGroup.Controls.Add(this.mAlternativeAction); - actionsGroup.Controls.Add(this.mDefaultAction); - actionsGroup.Controls.Add(alternativeActionLabel); - actionsGroup.Controls.Add(defaultActionLabel); - actionsGroup.Location = new System.Drawing.Point(6, 241); - actionsGroup.Name = "actionsGroup"; - actionsGroup.Size = new System.Drawing.Size(540, 67); - actionsGroup.TabIndex = 3; - actionsGroup.TabStop = false; - actionsGroup.Text = "Actions"; - // - // mAlternativeAction - // - this.mAlternativeAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.mAlternativeAction.Location = new System.Drawing.Point(288, 37); - this.mAlternativeAction.Name = "mAlternativeAction"; - this.mAlternativeAction.Size = new System.Drawing.Size(240, 21); - this.mAlternativeAction.TabIndex = 3; - // - // mDefaultAction - // - this.mDefaultAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.mDefaultAction.Location = new System.Drawing.Point(11, 37); - this.mDefaultAction.Name = "mDefaultAction"; - this.mDefaultAction.Size = new System.Drawing.Size(240, 21); - this.mDefaultAction.TabIndex = 1; - // - // alternativeActionLabel - // - alternativeActionLabel.AutoSize = true; - alternativeActionLabel.Location = new System.Drawing.Point(285, 20); - alternativeActionLabel.Name = "alternativeActionLabel"; - alternativeActionLabel.Size = new System.Drawing.Size(159, 13); - alternativeActionLabel.TabIndex = 2; - alternativeActionLabel.Text = "A<ernative action (Shift + Enter):"; - // - // defaultActionLabel - // - defaultActionLabel.AutoSize = true; - defaultActionLabel.Location = new System.Drawing.Point(8, 20); - defaultActionLabel.Name = "defaultActionLabel"; - defaultActionLabel.Size = new System.Drawing.Size(110, 13); - defaultActionLabel.TabIndex = 0; - defaultActionLabel.Text = "De&fault action (Enter):"; - // - // mShowHotKeyControl - // - this.mShowHotKeyControl.Location = new System.Drawing.Point(30, 65); - this.mShowHotKeyControl.Name = "mShowHotKeyControl"; - this.mShowHotKeyControl.Size = new System.Drawing.Size(123, 20); - this.mShowHotKeyControl.TabIndex = 2; - // - // mShowSearchGroup - // - this.mShowSearchGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + System.Windows.Forms.GroupBox searchInGroup; + System.Windows.Forms.GroupBox actionsGroup; + System.Windows.Forms.Label alternativeActionLabel; + System.Windows.Forms.Label defaultActionLabel; + System.Windows.Forms.GroupBox searchOptionsGroup; + this.mSearchInTags = new System.Windows.Forms.CheckBox(); + this.mSearchInOtherFields = new System.Windows.Forms.CheckBox(); + this.mSearchInNotes = new System.Windows.Forms.CheckBox(); + this.mSearchInUrl = new System.Windows.Forms.CheckBox(); + this.mSearchInUserName = new System.Windows.Forms.CheckBox(); + this.mSearchInTitle = new System.Windows.Forms.CheckBox(); + this.mAlternativeAction = new System.Windows.Forms.ComboBox(); + this.mDefaultAction = new System.Windows.Forms.ComboBox(); + this.mResolveReferences = new System.Windows.Forms.CheckBox(); + this.mExcludeExpired = new System.Windows.Forms.CheckBox(); + this.mCaseSensitive = new System.Windows.Forms.CheckBox(); + this.mPanel = new System.Windows.Forms.Panel(); + this.mShowSearchGroup = new System.Windows.Forms.GroupBox(); + this.mShowOnHotKey = new System.Windows.Forms.CheckBox(); + this.mShowHotKeyControl = new KeePass.UI.HotKeyControlEx(); + this.mShowOnIPC = new System.Windows.Forms.CheckBox(); + this.mShowOnFailedSearch = new System.Windows.Forms.CheckBox(); + this.mCustomSequences = new System.Windows.Forms.GroupBox(); + this.mAdditionalSequences = new AutoTypeSearch.EditableStringList(); + this.mAdditionalSequencesTitle = new System.Windows.Forms.Label(); + this.mAllowCustomSequences = new System.Windows.Forms.CheckBox(); + searchInGroup = new System.Windows.Forms.GroupBox(); + actionsGroup = new System.Windows.Forms.GroupBox(); + alternativeActionLabel = new System.Windows.Forms.Label(); + defaultActionLabel = new System.Windows.Forms.Label(); + searchOptionsGroup = new System.Windows.Forms.GroupBox(); + searchInGroup.SuspendLayout(); + actionsGroup.SuspendLayout(); + searchOptionsGroup.SuspendLayout(); + this.mPanel.SuspendLayout(); + this.mShowSearchGroup.SuspendLayout(); + this.mCustomSequences.SuspendLayout(); + this.SuspendLayout(); + // + // searchInGroup + // + searchInGroup.Controls.Add(this.mSearchInTags); + searchInGroup.Controls.Add(this.mSearchInOtherFields); + searchInGroup.Controls.Add(this.mSearchInNotes); + searchInGroup.Controls.Add(this.mSearchInUrl); + searchInGroup.Controls.Add(this.mSearchInUserName); + searchInGroup.Controls.Add(this.mSearchInTitle); + searchInGroup.Location = new System.Drawing.Point(4, 197); + searchInGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchInGroup.Name = "searchInGroup"; + searchInGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchInGroup.Size = new System.Drawing.Size(764, 72); + searchInGroup.TabIndex = 1; + searchInGroup.TabStop = false; + searchInGroup.Text = "Search in"; + // + // mSearchInTags + // + this.mSearchInTags.AutoSize = true; + this.mSearchInTags.Location = new System.Drawing.Point(387, 29); + this.mSearchInTags.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInTags.Name = "mSearchInTags"; + this.mSearchInTags.Size = new System.Drawing.Size(70, 24); + this.mSearchInTags.TabIndex = 4; + this.mSearchInTags.Text = "Ta&gs"; + this.mSearchInTags.UseVisualStyleBackColor = true; + // + // mSearchInOtherFields + // + this.mSearchInOtherFields.AutoSize = true; + this.mSearchInOtherFields.Location = new System.Drawing.Point(471, 29); + this.mSearchInOtherFields.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInOtherFields.Name = "mSearchInOtherFields"; + this.mSearchInOtherFields.Size = new System.Drawing.Size(206, 24); + this.mSearchInOtherFields.TabIndex = 5; + this.mSearchInOtherFields.Text = "&Other unprotected fields"; + this.mSearchInOtherFields.UseVisualStyleBackColor = true; + // + // mSearchInNotes + // + this.mSearchInNotes.AutoSize = true; + this.mSearchInNotes.Location = new System.Drawing.Point(297, 29); + this.mSearchInNotes.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInNotes.Name = "mSearchInNotes"; + this.mSearchInNotes.Size = new System.Drawing.Size(77, 24); + this.mSearchInNotes.TabIndex = 3; + this.mSearchInNotes.Text = "Note&s"; + this.mSearchInNotes.UseVisualStyleBackColor = true; + // + // mSearchInUrl + // + this.mSearchInUrl.AutoSize = true; + this.mSearchInUrl.Location = new System.Drawing.Point(216, 29); + this.mSearchInUrl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInUrl.Name = "mSearchInUrl"; + this.mSearchInUrl.Size = new System.Drawing.Size(68, 24); + this.mSearchInUrl.TabIndex = 2; + this.mSearchInUrl.Text = "&URL"; + this.mSearchInUrl.UseVisualStyleBackColor = true; + // + // mSearchInUserName + // + this.mSearchInUserName.AutoSize = true; + this.mSearchInUserName.Location = new System.Drawing.Point(92, 29); + this.mSearchInUserName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInUserName.Name = "mSearchInUserName"; + this.mSearchInUserName.Size = new System.Drawing.Size(113, 24); + this.mSearchInUserName.TabIndex = 1; + this.mSearchInUserName.Text = "User &name"; + this.mSearchInUserName.UseVisualStyleBackColor = true; + // + // mSearchInTitle + // + this.mSearchInTitle.AutoSize = true; + this.mSearchInTitle.Location = new System.Drawing.Point(14, 29); + this.mSearchInTitle.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInTitle.Name = "mSearchInTitle"; + this.mSearchInTitle.Size = new System.Drawing.Size(64, 24); + this.mSearchInTitle.TabIndex = 0; + this.mSearchInTitle.Text = "&Title"; + this.mSearchInTitle.UseVisualStyleBackColor = true; + // + // actionsGroup + // + actionsGroup.Controls.Add(this.mAlternativeAction); + actionsGroup.Controls.Add(this.mDefaultAction); + actionsGroup.Controls.Add(alternativeActionLabel); + actionsGroup.Controls.Add(defaultActionLabel); + actionsGroup.Location = new System.Drawing.Point(4, 358); + actionsGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + actionsGroup.Name = "actionsGroup"; + actionsGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + actionsGroup.Size = new System.Drawing.Size(764, 103); + actionsGroup.TabIndex = 3; + actionsGroup.TabStop = false; + actionsGroup.Text = "Actions"; + // + // mAlternativeAction + // + this.mAlternativeAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.mAlternativeAction.Location = new System.Drawing.Point(392, 57); + this.mAlternativeAction.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mAlternativeAction.Name = "mAlternativeAction"; + this.mAlternativeAction.Size = new System.Drawing.Size(358, 28); + this.mAlternativeAction.TabIndex = 3; + // + // mDefaultAction + // + this.mDefaultAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.mDefaultAction.Location = new System.Drawing.Point(16, 57); + this.mDefaultAction.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mDefaultAction.Name = "mDefaultAction"; + this.mDefaultAction.Size = new System.Drawing.Size(358, 28); + this.mDefaultAction.TabIndex = 1; + // + // alternativeActionLabel + // + alternativeActionLabel.AutoSize = true; + alternativeActionLabel.Location = new System.Drawing.Point(388, 31); + alternativeActionLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + alternativeActionLabel.Name = "alternativeActionLabel"; + alternativeActionLabel.Size = new System.Drawing.Size(238, 20); + alternativeActionLabel.TabIndex = 2; + alternativeActionLabel.Text = "A<ernative action (Shift + Enter):"; + // + // defaultActionLabel + // + defaultActionLabel.AutoSize = true; + defaultActionLabel.Location = new System.Drawing.Point(12, 31); + defaultActionLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + defaultActionLabel.Name = "defaultActionLabel"; + defaultActionLabel.Size = new System.Drawing.Size(165, 20); + defaultActionLabel.TabIndex = 0; + defaultActionLabel.Text = "De&fault action (Enter):"; + // + // searchOptionsGroup + // + searchOptionsGroup.Controls.Add(this.mResolveReferences); + searchOptionsGroup.Controls.Add(this.mExcludeExpired); + searchOptionsGroup.Controls.Add(this.mCaseSensitive); + searchOptionsGroup.Location = new System.Drawing.Point(4, 279); + searchOptionsGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchOptionsGroup.Name = "searchOptionsGroup"; + searchOptionsGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchOptionsGroup.Size = new System.Drawing.Size(764, 69); + searchOptionsGroup.TabIndex = 2; + searchOptionsGroup.TabStop = false; + searchOptionsGroup.Text = "Search options"; + // + // mResolveReferences + // + this.mResolveReferences.AutoSize = true; + this.mResolveReferences.Location = new System.Drawing.Point(376, 31); + this.mResolveReferences.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mResolveReferences.Name = "mResolveReferences"; + this.mResolveReferences.Size = new System.Drawing.Size(250, 24); + this.mResolveReferences.TabIndex = 2; + this.mResolveReferences.Text = "Resolve fiel&d references (slow)"; + this.mResolveReferences.UseVisualStyleBackColor = true; + // + // mExcludeExpired + // + this.mExcludeExpired.AutoSize = true; + this.mExcludeExpired.Location = new System.Drawing.Point(162, 31); + this.mExcludeExpired.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mExcludeExpired.Name = "mExcludeExpired"; + this.mExcludeExpired.Size = new System.Drawing.Size(198, 24); + this.mExcludeExpired.TabIndex = 1; + this.mExcludeExpired.Text = "Exclude &expired entries"; + this.mExcludeExpired.UseVisualStyleBackColor = true; + // + // mCaseSensitive + // + this.mCaseSensitive.AutoSize = true; + this.mCaseSensitive.Location = new System.Drawing.Point(15, 31); + this.mCaseSensitive.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mCaseSensitive.Name = "mCaseSensitive"; + this.mCaseSensitive.Size = new System.Drawing.Size(138, 24); + this.mCaseSensitive.TabIndex = 0; + this.mCaseSensitive.Text = "Case-sensiti&ve"; + this.mCaseSensitive.UseVisualStyleBackColor = true; + // + // mPanel + // + this.mPanel.AutoScroll = true; + this.mPanel.Controls.Add(this.mShowSearchGroup); + this.mPanel.Controls.Add(this.mCustomSequences); + this.mPanel.Controls.Add(searchOptionsGroup); + this.mPanel.Controls.Add(actionsGroup); + this.mPanel.Controls.Add(searchInGroup); + this.mPanel.Location = new System.Drawing.Point(9, 18); + this.mPanel.Name = "mPanel"; + this.mPanel.Size = new System.Drawing.Size(808, 463); + this.mPanel.TabIndex = 5; + // + // mShowSearchGroup + // + this.mShowSearchGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.mShowSearchGroup.Controls.Add(this.mShowOnHotKey); - this.mShowSearchGroup.Controls.Add(this.mShowHotKeyControl); - this.mShowSearchGroup.Controls.Add(this.mShowOnIPC); - this.mShowSearchGroup.Controls.Add(this.mShowOnFailedSearch); - this.mShowSearchGroup.Location = new System.Drawing.Point(6, 12); - this.mShowSearchGroup.Name = "mShowSearchGroup"; - this.mShowSearchGroup.Size = new System.Drawing.Size(540, 118); - this.mShowSearchGroup.TabIndex = 0; - this.mShowSearchGroup.TabStop = false; - this.mShowSearchGroup.Text = "Show search window"; - // - // mShowOnHotKey - // - this.mShowOnHotKey.AutoSize = true; - this.mShowOnHotKey.Location = new System.Drawing.Point(10, 44); - this.mShowOnHotKey.Name = "mShowOnHotKey"; - this.mShowOnHotKey.Size = new System.Drawing.Size(233, 17); - this.mShowOnHotKey.TabIndex = 1; - this.mShowOnHotKey.Text = "Show when system-wide &hot key is pressed:"; - this.mShowOnHotKey.UseVisualStyleBackColor = true; - this.mShowOnHotKey.CheckedChanged += new System.EventHandler(this.mShowOnHotKey_CheckedChanged); - // - // mShowOnIPC - // - this.mShowOnIPC.AutoSize = true; - this.mShowOnIPC.Location = new System.Drawing.Point(10, 93); - this.mShowOnIPC.Name = "mShowOnIPC"; - this.mShowOnIPC.Size = new System.Drawing.Size(386, 17); - this.mShowOnIPC.TabIndex = 3; - this.mShowOnIPC.Text = "Show when \"/e1:AutoTypeSearch\" is passed as a ¶meter to KeePass.exe"; - this.mShowOnIPC.UseVisualStyleBackColor = true; - // - // mShowOnFailedSearch - // - this.mShowOnFailedSearch.AutoSize = true; - this.mShowOnFailedSearch.Location = new System.Drawing.Point(10, 21); - this.mShowOnFailedSearch.Name = "mShowOnFailedSearch"; - this.mShowOnFailedSearch.Size = new System.Drawing.Size(275, 17); - this.mShowOnFailedSearch.TabIndex = 0; - this.mShowOnFailedSearch.Text = "Show &automatically if global auto-type finds no match"; - this.mShowOnFailedSearch.UseVisualStyleBackColor = true; - // - // Options - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(actionsGroup); - this.Controls.Add(searchInGroup); - this.Controls.Add(searchOptionsGroup); - this.Controls.Add(this.mShowSearchGroup); - this.Name = "Options"; - this.Size = new System.Drawing.Size(551, 311); - searchOptionsGroup.ResumeLayout(false); - searchOptionsGroup.PerformLayout(); - searchInGroup.ResumeLayout(false); - searchInGroup.PerformLayout(); - actionsGroup.ResumeLayout(false); - actionsGroup.PerformLayout(); - this.mShowSearchGroup.ResumeLayout(false); - this.mShowSearchGroup.PerformLayout(); - this.ResumeLayout(false); + this.mShowSearchGroup.Controls.Add(this.mShowOnHotKey); + this.mShowSearchGroup.Controls.Add(this.mShowHotKeyControl); + this.mShowSearchGroup.Controls.Add(this.mShowOnIPC); + this.mShowSearchGroup.Controls.Add(this.mShowOnFailedSearch); + this.mShowSearchGroup.Location = new System.Drawing.Point(4, 5); + this.mShowSearchGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowSearchGroup.Name = "mShowSearchGroup"; + this.mShowSearchGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowSearchGroup.Size = new System.Drawing.Size(764, 182); + this.mShowSearchGroup.TabIndex = 0; + this.mShowSearchGroup.TabStop = false; + this.mShowSearchGroup.Text = "Show search window"; + // + // mShowOnHotKey + // + this.mShowOnHotKey.AutoSize = true; + this.mShowOnHotKey.Location = new System.Drawing.Point(15, 68); + this.mShowOnHotKey.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnHotKey.Name = "mShowOnHotKey"; + this.mShowOnHotKey.Size = new System.Drawing.Size(343, 24); + this.mShowOnHotKey.TabIndex = 1; + this.mShowOnHotKey.Text = "Show when system-wide &hot key is pressed:"; + this.mShowOnHotKey.UseVisualStyleBackColor = true; + this.mShowOnHotKey.CheckedChanged += new System.EventHandler(this.mShowOnHotKey_CheckedChanged); + // + // mShowHotKeyControl + // + this.mShowHotKeyControl.Location = new System.Drawing.Point(45, 100); + this.mShowHotKeyControl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowHotKeyControl.Name = "mShowHotKeyControl"; + this.mShowHotKeyControl.Size = new System.Drawing.Size(182, 26); + this.mShowHotKeyControl.TabIndex = 2; + // + // mShowOnIPC + // + this.mShowOnIPC.AutoSize = true; + this.mShowOnIPC.Location = new System.Drawing.Point(15, 143); + this.mShowOnIPC.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnIPC.Name = "mShowOnIPC"; + this.mShowOnIPC.Size = new System.Drawing.Size(574, 24); + this.mShowOnIPC.TabIndex = 3; + this.mShowOnIPC.Text = "Show when \"/e1:AutoTypeSearch\" is passed as a ¶meter to KeePass.exe"; + this.mShowOnIPC.UseVisualStyleBackColor = true; + // + // mShowOnFailedSearch + // + this.mShowOnFailedSearch.AutoSize = true; + this.mShowOnFailedSearch.Location = new System.Drawing.Point(15, 32); + this.mShowOnFailedSearch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnFailedSearch.Name = "mShowOnFailedSearch"; + this.mShowOnFailedSearch.Size = new System.Drawing.Size(408, 24); + this.mShowOnFailedSearch.TabIndex = 0; + this.mShowOnFailedSearch.Text = "Show &automatically if global auto-type finds no match"; + this.mShowOnFailedSearch.UseVisualStyleBackColor = true; + // + // mCustomSequences + // + this.mCustomSequences.Controls.Add(this.mAdditionalSequences); + this.mCustomSequences.Controls.Add(this.mAdditionalSequencesTitle); + this.mCustomSequences.Controls.Add(this.mAllowCustomSequences); + this.mCustomSequences.Location = new System.Drawing.Point(4, 469); + this.mCustomSequences.Name = "mCustomSequences"; + this.mCustomSequences.Size = new System.Drawing.Size(764, 206); + this.mCustomSequences.TabIndex = 4; + this.mCustomSequences.TabStop = false; + this.mCustomSequences.Text = "Custom Sequences"; + // + // mAdditionalSequences + // + this.mAdditionalSequences.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.mAdditionalSequences.FormattingEnabled = true; + this.mAdditionalSequences.ItemHeight = 20; + this.mAdditionalSequences.Items.AddRange(new object[] { + "+ new sequence", + "+ new sequence"}); + this.mAdditionalSequences.Location = new System.Drawing.Point(6, 87); + this.mAdditionalSequences.Name = "mAdditionalSequences"; + this.mAdditionalSequences.Size = new System.Drawing.Size(744, 104); + this.mAdditionalSequences.TabIndex = 9; + this.mAdditionalSequences.StartEdit += new System.EventHandler(this.mAdditionalSequences_StartEdit); + this.mAdditionalSequences.FinishEdit += new AutoTypeSearch.FinishEditEventHandler(this.mAdditionalSequences_FinishEdit); + this.mAdditionalSequences.SelectedIndexChanged += new System.EventHandler(this.mAdditionalSequences_SelectedIndexChanged); + // + // mAdditionalSequencesTitle + // + this.mAdditionalSequencesTitle.AutoSize = true; + this.mAdditionalSequencesTitle.Location = new System.Drawing.Point(6, 61); + this.mAdditionalSequencesTitle.Name = "mAdditionalSequencesTitle"; + this.mAdditionalSequencesTitle.Size = new System.Drawing.Size(221, 20); + this.mAdditionalSequencesTitle.TabIndex = 8; + this.mAdditionalSequencesTitle.Text = "Add&itional custom sequences:"; + // + // mAllowCustomSequences + // + this.mAllowCustomSequences.AutoSize = true; + this.mAllowCustomSequences.Location = new System.Drawing.Point(7, 27); + this.mAllowCustomSequences.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mAllowCustomSequences.Name = "mAllowCustomSequences"; + this.mAllowCustomSequences.Size = new System.Drawing.Size(281, 24); + this.mAllowCustomSequences.TabIndex = 6; + this.mAllowCustomSequences.Text = "Allow &custom auto-type sequences"; + this.mAllowCustomSequences.UseVisualStyleBackColor = true; + // + // Options + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.mPanel); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "Options"; + this.Size = new System.Drawing.Size(834, 499); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.Options_Paint); + searchInGroup.ResumeLayout(false); + searchInGroup.PerformLayout(); + actionsGroup.ResumeLayout(false); + actionsGroup.PerformLayout(); + searchOptionsGroup.ResumeLayout(false); + searchOptionsGroup.PerformLayout(); + this.mPanel.ResumeLayout(false); + this.mShowSearchGroup.ResumeLayout(false); + this.mShowSearchGroup.PerformLayout(); + this.mCustomSequences.ResumeLayout(false); + this.mCustomSequences.PerformLayout(); + this.ResumeLayout(false); } #endregion - private KeePass.UI.HotKeyControlEx mShowHotKeyControl; + private System.Windows.Forms.Panel mPanel; + private System.Windows.Forms.GroupBox mShowSearchGroup; private System.Windows.Forms.CheckBox mShowOnHotKey; + private HotKeyControlEx mShowHotKeyControl; private System.Windows.Forms.CheckBox mShowOnIPC; private System.Windows.Forms.CheckBox mShowOnFailedSearch; + private System.Windows.Forms.GroupBox mCustomSequences; + private System.Windows.Forms.Label mAdditionalSequencesTitle; + private System.Windows.Forms.CheckBox mAllowCustomSequences; + private System.Windows.Forms.CheckBox mResolveReferences; + private System.Windows.Forms.CheckBox mExcludeExpired; private System.Windows.Forms.CheckBox mCaseSensitive; + private System.Windows.Forms.ComboBox mAlternativeAction; + private System.Windows.Forms.ComboBox mDefaultAction; private System.Windows.Forms.CheckBox mSearchInTags; private System.Windows.Forms.CheckBox mSearchInOtherFields; private System.Windows.Forms.CheckBox mSearchInNotes; private System.Windows.Forms.CheckBox mSearchInUrl; private System.Windows.Forms.CheckBox mSearchInUserName; private System.Windows.Forms.CheckBox mSearchInTitle; - private System.Windows.Forms.CheckBox mResolveReferences; - private System.Windows.Forms.CheckBox mExcludeExpired; - private System.Windows.Forms.ComboBox mAlternativeAction; - private System.Windows.Forms.ComboBox mDefaultAction; - private System.Windows.Forms.GroupBox mShowSearchGroup; - + private EditableStringList mAdditionalSequences; } } diff --git a/AutoTypeSearch/Options.cs b/AutoTypeSearch/Options.cs index b99561c..85819b3 100755 --- a/AutoTypeSearch/Options.cs +++ b/AutoTypeSearch/Options.cs @@ -1,7 +1,10 @@ using System; using System.Configuration; using System.Diagnostics; +using System.Drawing; +using System.IO; using System.Linq; +using System.Net.NetworkInformation; using System.Windows.Forms; using AutoTypeSearch.Properties; using KeePass.Forms; @@ -29,7 +32,7 @@ // Read options mShowOnFailedSearch.Checked = Settings.Default.ShowOnFailedAutoType; - + if (NativeLib.IsUnix()) { mShowOnHotKey.Enabled = false; @@ -51,13 +54,26 @@ mSearchInNotes.Checked = Settings.Default.SearchNotes; mSearchInTags.Checked = Settings.Default.SearchTags; mSearchInOtherFields.Checked = Settings.Default.SearchCustomFields; - + mCaseSensitive.Checked = Settings.Default.CaseSensitive; mExcludeExpired.Checked = Settings.Default.ExcludeExpired; mResolveReferences.Checked = Settings.Default.ResolveReferences; mDefaultAction.SelectedIndex = (int)Settings.Default.DefaultAction; mAlternativeAction.SelectedIndex = (int)Settings.Default.AlternativeAction; + + mAdditionalSequences.BeginUpdate(); + mAdditionalSequences.Items.Clear(); + + if (Settings.Default.AdditionalCustomSequences != null) + { + foreach (string s in Settings.Default.AdditionalCustomSequences) + { + mAdditionalSequences.Items.Add(s); + } + } + + mAdditionalSequences.EndUpdate(); } private Keys ShowHotKey @@ -90,6 +106,15 @@ Settings.Default.AlternativeAction = (Actions)mAlternativeAction.SelectedIndex; Settings.Default.ShowHotKey = ShowHotKey; + Settings.Default.AdditionalCustomSequences = new System.Collections.Specialized.StringCollection(); + for (int i = 0; i < mAdditionalSequences.Items.Count; i++) + { + if (i != mAdditionalSequences.NewEntryIndex) + { + Settings.Default.AdditionalCustomSequences.Add(mAdditionalSequences.Items[i].ToString()); + } + } + ApplyHotKey(); } @@ -161,8 +186,10 @@ } #endregion + private static OptionsForm sOptionsForm; public static void AddToWindow(OptionsForm optionsForm) { + Options.sOptionsForm = optionsForm; var tabControl = optionsForm.Controls.Find("m_tabMain", false).FirstOrDefault() as TabControl; var okButton = optionsForm.Controls.Find("m_btnOK", false).FirstOrDefault() as Button; @@ -187,5 +214,110 @@ options.ApplySettings(); }; } + + private void Options_Paint(object sender, PaintEventArgs e) + { + Rectangle r = new Rectangle(mPanel.Location, mPanel.ClientSize); + //r.Offset(mPanel.Location); + r.X -= 1; + r.Y -= 1; + r.Width += 2 + SystemInformation.VerticalScrollBarWidth; + r.Height += 2; + ControlPaint.DrawBorder(e.Graphics, r, SystemColors.GrayText, ButtonBorderStyle.Solid); + } + + #region Prevent closing when editing + private IButtonControl mOldOptionsAcceptButton; + private IButtonControl mOldOptionsCancelButton; + private int mSavedOldOptionsAcceptButton = 0; + private int mSavedOldOptionsCancelButton = 0; + + private void SaveFormAcceptButton() + { + mSavedOldOptionsAcceptButton++; + if (sOptionsForm != null && mSavedOldOptionsAcceptButton == 1) + { + mOldOptionsAcceptButton = sOptionsForm.AcceptButton; + sOptionsForm.AcceptButton = null; + } + } + + private void RestoreFormAcceptButton() + { + if (mSavedOldOptionsAcceptButton > 0) + { + mSavedOldOptionsAcceptButton--; + if (sOptionsForm != null && mSavedOldOptionsAcceptButton == 0) + { + sOptionsForm.AcceptButton = mOldOptionsAcceptButton; + } + } + } + + private void SaveFormCancelButton() + { + mSavedOldOptionsCancelButton++; + if (sOptionsForm != null && mSavedOldOptionsCancelButton == 1) + { + mOldOptionsCancelButton = sOptionsForm.CancelButton; + sOptionsForm.CancelButton = null; + } + } + + private void RestoreFormCancelButton() + { + if (mSavedOldOptionsCancelButton > 0) + { + mSavedOldOptionsCancelButton--; + if (sOptionsForm != null && mSavedOldOptionsCancelButton == 0) + { + sOptionsForm.CancelButton = mOldOptionsCancelButton; + } + } + } + private void mAdditionalSequences_StartEdit(object sender, EventArgs e) + { + SaveFormAcceptButton(); + SaveFormCancelButton(); + + mPanel.ScrollControlIntoView(mAdditionalSequences); + } + + private void mAdditionalSequences_FinishEdit(object sender, EventArgs e) + { + RestoreFormAcceptButton(); + RestoreFormCancelButton(); + } + + private void mAdditionalSequences_SelectedIndexChanged(object sender, EventArgs e) + { + mPanel.ScrollControlIntoView(mAdditionalSequences); + } + + #endregion + + #region Additional sequence list focusing + private bool mAdditionalSequencesFocused = false; + private void mAdditionalSequences_Enter(object sender, EventArgs e) + { + if (mAdditionalSequencesFocused) return; + mAdditionalSequencesFocused = true; + + SaveFormAcceptButton(); + } + + private void mAdditionalSequences_Leave(object sender, EventArgs e) + { + if (!mAdditionalSequencesFocused) return; + mAdditionalSequencesFocused = false; + + RestoreFormAcceptButton(); + } + #endregion + + private void mAdditionalSequences_FinishEdit(object sender, FinishEditEventArgs e) + { + + } } } diff --git a/AutoTypeSearch/AutoTypeSearch.csproj b/AutoTypeSearch/AutoTypeSearch.csproj index 8572a12..a211b89 100755 --- a/AutoTypeSearch/AutoTypeSearch.csproj +++ b/AutoTypeSearch/AutoTypeSearch.csproj @@ -115,6 +115,9 @@ + + + IF $(ConfigurationName) == Release "$(ProjectDir)..\CreatePlgX.bat" diff --git a/AutoTypeSearch/Delete.png b/AutoTypeSearch/Delete.png new file mode 100644 index 0000000..9d61fb8 --- /dev/null +++ b/AutoTypeSearch/Delete.png Binary files differ diff --git a/AutoTypeSearch/Options.Designer.cs b/AutoTypeSearch/Options.Designer.cs index 4886b6d..8844dbd 100755 --- a/AutoTypeSearch/Options.Designer.cs +++ b/AutoTypeSearch/Options.Designer.cs @@ -1,4 +1,4 @@ -using KeePass.UI; +using KeePass.UI; namespace AutoTypeSearch { @@ -30,295 +30,394 @@ /// private void InitializeComponent() { - System.Windows.Forms.GroupBox searchOptionsGroup; - System.Windows.Forms.GroupBox searchInGroup; - System.Windows.Forms.GroupBox actionsGroup; - System.Windows.Forms.Label alternativeActionLabel; - System.Windows.Forms.Label defaultActionLabel; - this.mResolveReferences = new System.Windows.Forms.CheckBox(); - this.mExcludeExpired = new System.Windows.Forms.CheckBox(); - this.mCaseSensitive = new System.Windows.Forms.CheckBox(); - this.mSearchInTags = new System.Windows.Forms.CheckBox(); - this.mSearchInOtherFields = new System.Windows.Forms.CheckBox(); - this.mSearchInNotes = new System.Windows.Forms.CheckBox(); - this.mSearchInUrl = new System.Windows.Forms.CheckBox(); - this.mSearchInUserName = new System.Windows.Forms.CheckBox(); - this.mSearchInTitle = new System.Windows.Forms.CheckBox(); - this.mAlternativeAction = new System.Windows.Forms.ComboBox(); - this.mDefaultAction = new System.Windows.Forms.ComboBox(); - this.mShowHotKeyControl = new KeePass.UI.HotKeyControlEx(); - this.mShowSearchGroup = new System.Windows.Forms.GroupBox(); - this.mShowOnHotKey = new System.Windows.Forms.CheckBox(); - this.mShowOnIPC = new System.Windows.Forms.CheckBox(); - this.mShowOnFailedSearch = new System.Windows.Forms.CheckBox(); - searchOptionsGroup = new System.Windows.Forms.GroupBox(); - searchInGroup = new System.Windows.Forms.GroupBox(); - actionsGroup = new System.Windows.Forms.GroupBox(); - alternativeActionLabel = new System.Windows.Forms.Label(); - defaultActionLabel = new System.Windows.Forms.Label(); - searchOptionsGroup.SuspendLayout(); - searchInGroup.SuspendLayout(); - actionsGroup.SuspendLayout(); - this.mShowSearchGroup.SuspendLayout(); - this.SuspendLayout(); - // - // searchOptionsGroup - // - searchOptionsGroup.Controls.Add(this.mResolveReferences); - searchOptionsGroup.Controls.Add(this.mExcludeExpired); - searchOptionsGroup.Controls.Add(this.mCaseSensitive); - searchOptionsGroup.Location = new System.Drawing.Point(6, 189); - searchOptionsGroup.Name = "searchOptionsGroup"; - searchOptionsGroup.Size = new System.Drawing.Size(540, 45); - searchOptionsGroup.TabIndex = 2; - searchOptionsGroup.TabStop = false; - searchOptionsGroup.Text = "Search options"; - // - // mResolveReferences - // - this.mResolveReferences.AutoSize = true; - this.mResolveReferences.Location = new System.Drawing.Point(251, 20); - this.mResolveReferences.Name = "mResolveReferences"; - this.mResolveReferences.Size = new System.Drawing.Size(170, 17); - this.mResolveReferences.TabIndex = 2; - this.mResolveReferences.Text = "Resolve fiel&d references (slow)"; - this.mResolveReferences.UseVisualStyleBackColor = true; - // - // mExcludeExpired - // - this.mExcludeExpired.AutoSize = true; - this.mExcludeExpired.Location = new System.Drawing.Point(108, 20); - this.mExcludeExpired.Name = "mExcludeExpired"; - this.mExcludeExpired.Size = new System.Drawing.Size(135, 17); - this.mExcludeExpired.TabIndex = 1; - this.mExcludeExpired.Text = "Exclude &expired entries"; - this.mExcludeExpired.UseVisualStyleBackColor = true; - // - // mCaseSensitive - // - this.mCaseSensitive.AutoSize = true; - this.mCaseSensitive.Location = new System.Drawing.Point(10, 20); - this.mCaseSensitive.Name = "mCaseSensitive"; - this.mCaseSensitive.Size = new System.Drawing.Size(94, 17); - this.mCaseSensitive.TabIndex = 0; - this.mCaseSensitive.Text = "Case-sensiti&ve"; - this.mCaseSensitive.UseVisualStyleBackColor = true; - // - // searchInGroup - // - searchInGroup.Controls.Add(this.mSearchInTags); - searchInGroup.Controls.Add(this.mSearchInOtherFields); - searchInGroup.Controls.Add(this.mSearchInNotes); - searchInGroup.Controls.Add(this.mSearchInUrl); - searchInGroup.Controls.Add(this.mSearchInUserName); - searchInGroup.Controls.Add(this.mSearchInTitle); - searchInGroup.Location = new System.Drawing.Point(6, 136); - searchInGroup.Name = "searchInGroup"; - searchInGroup.Size = new System.Drawing.Size(540, 47); - searchInGroup.TabIndex = 1; - searchInGroup.TabStop = false; - searchInGroup.Text = "Search in"; - // - // mSearchInTags - // - this.mSearchInTags.AutoSize = true; - this.mSearchInTags.Location = new System.Drawing.Point(258, 19); - this.mSearchInTags.Name = "mSearchInTags"; - this.mSearchInTags.Size = new System.Drawing.Size(50, 17); - this.mSearchInTags.TabIndex = 4; - this.mSearchInTags.Text = "Ta&gs"; - this.mSearchInTags.UseVisualStyleBackColor = true; - // - // mSearchInOtherFields - // - this.mSearchInOtherFields.AutoSize = true; - this.mSearchInOtherFields.Location = new System.Drawing.Point(314, 19); - this.mSearchInOtherFields.Name = "mSearchInOtherFields"; - this.mSearchInOtherFields.Size = new System.Drawing.Size(139, 17); - this.mSearchInOtherFields.TabIndex = 5; - this.mSearchInOtherFields.Text = "&Other unprotected fields"; - this.mSearchInOtherFields.UseVisualStyleBackColor = true; - // - // mSearchInNotes - // - this.mSearchInNotes.AutoSize = true; - this.mSearchInNotes.Location = new System.Drawing.Point(198, 19); - this.mSearchInNotes.Name = "mSearchInNotes"; - this.mSearchInNotes.Size = new System.Drawing.Size(54, 17); - this.mSearchInNotes.TabIndex = 3; - this.mSearchInNotes.Text = "Note&s"; - this.mSearchInNotes.UseVisualStyleBackColor = true; - // - // mSearchInUrl - // - this.mSearchInUrl.AutoSize = true; - this.mSearchInUrl.Location = new System.Drawing.Point(144, 19); - this.mSearchInUrl.Name = "mSearchInUrl"; - this.mSearchInUrl.Size = new System.Drawing.Size(48, 17); - this.mSearchInUrl.TabIndex = 2; - this.mSearchInUrl.Text = "&URL"; - this.mSearchInUrl.UseVisualStyleBackColor = true; - // - // mSearchInUserName - // - this.mSearchInUserName.AutoSize = true; - this.mSearchInUserName.Location = new System.Drawing.Point(61, 19); - this.mSearchInUserName.Name = "mSearchInUserName"; - this.mSearchInUserName.Size = new System.Drawing.Size(77, 17); - this.mSearchInUserName.TabIndex = 1; - this.mSearchInUserName.Text = "User &name"; - this.mSearchInUserName.UseVisualStyleBackColor = true; - // - // mSearchInTitle - // - this.mSearchInTitle.AutoSize = true; - this.mSearchInTitle.Location = new System.Drawing.Point(9, 19); - this.mSearchInTitle.Name = "mSearchInTitle"; - this.mSearchInTitle.Size = new System.Drawing.Size(46, 17); - this.mSearchInTitle.TabIndex = 0; - this.mSearchInTitle.Text = "&Title"; - this.mSearchInTitle.UseVisualStyleBackColor = true; - // - // actionsGroup - // - actionsGroup.Controls.Add(this.mAlternativeAction); - actionsGroup.Controls.Add(this.mDefaultAction); - actionsGroup.Controls.Add(alternativeActionLabel); - actionsGroup.Controls.Add(defaultActionLabel); - actionsGroup.Location = new System.Drawing.Point(6, 241); - actionsGroup.Name = "actionsGroup"; - actionsGroup.Size = new System.Drawing.Size(540, 67); - actionsGroup.TabIndex = 3; - actionsGroup.TabStop = false; - actionsGroup.Text = "Actions"; - // - // mAlternativeAction - // - this.mAlternativeAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.mAlternativeAction.Location = new System.Drawing.Point(288, 37); - this.mAlternativeAction.Name = "mAlternativeAction"; - this.mAlternativeAction.Size = new System.Drawing.Size(240, 21); - this.mAlternativeAction.TabIndex = 3; - // - // mDefaultAction - // - this.mDefaultAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.mDefaultAction.Location = new System.Drawing.Point(11, 37); - this.mDefaultAction.Name = "mDefaultAction"; - this.mDefaultAction.Size = new System.Drawing.Size(240, 21); - this.mDefaultAction.TabIndex = 1; - // - // alternativeActionLabel - // - alternativeActionLabel.AutoSize = true; - alternativeActionLabel.Location = new System.Drawing.Point(285, 20); - alternativeActionLabel.Name = "alternativeActionLabel"; - alternativeActionLabel.Size = new System.Drawing.Size(159, 13); - alternativeActionLabel.TabIndex = 2; - alternativeActionLabel.Text = "A<ernative action (Shift + Enter):"; - // - // defaultActionLabel - // - defaultActionLabel.AutoSize = true; - defaultActionLabel.Location = new System.Drawing.Point(8, 20); - defaultActionLabel.Name = "defaultActionLabel"; - defaultActionLabel.Size = new System.Drawing.Size(110, 13); - defaultActionLabel.TabIndex = 0; - defaultActionLabel.Text = "De&fault action (Enter):"; - // - // mShowHotKeyControl - // - this.mShowHotKeyControl.Location = new System.Drawing.Point(30, 65); - this.mShowHotKeyControl.Name = "mShowHotKeyControl"; - this.mShowHotKeyControl.Size = new System.Drawing.Size(123, 20); - this.mShowHotKeyControl.TabIndex = 2; - // - // mShowSearchGroup - // - this.mShowSearchGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + System.Windows.Forms.GroupBox searchInGroup; + System.Windows.Forms.GroupBox actionsGroup; + System.Windows.Forms.Label alternativeActionLabel; + System.Windows.Forms.Label defaultActionLabel; + System.Windows.Forms.GroupBox searchOptionsGroup; + this.mSearchInTags = new System.Windows.Forms.CheckBox(); + this.mSearchInOtherFields = new System.Windows.Forms.CheckBox(); + this.mSearchInNotes = new System.Windows.Forms.CheckBox(); + this.mSearchInUrl = new System.Windows.Forms.CheckBox(); + this.mSearchInUserName = new System.Windows.Forms.CheckBox(); + this.mSearchInTitle = new System.Windows.Forms.CheckBox(); + this.mAlternativeAction = new System.Windows.Forms.ComboBox(); + this.mDefaultAction = new System.Windows.Forms.ComboBox(); + this.mResolveReferences = new System.Windows.Forms.CheckBox(); + this.mExcludeExpired = new System.Windows.Forms.CheckBox(); + this.mCaseSensitive = new System.Windows.Forms.CheckBox(); + this.mPanel = new System.Windows.Forms.Panel(); + this.mShowSearchGroup = new System.Windows.Forms.GroupBox(); + this.mShowOnHotKey = new System.Windows.Forms.CheckBox(); + this.mShowHotKeyControl = new KeePass.UI.HotKeyControlEx(); + this.mShowOnIPC = new System.Windows.Forms.CheckBox(); + this.mShowOnFailedSearch = new System.Windows.Forms.CheckBox(); + this.mCustomSequences = new System.Windows.Forms.GroupBox(); + this.mAdditionalSequences = new AutoTypeSearch.EditableStringList(); + this.mAdditionalSequencesTitle = new System.Windows.Forms.Label(); + this.mAllowCustomSequences = new System.Windows.Forms.CheckBox(); + searchInGroup = new System.Windows.Forms.GroupBox(); + actionsGroup = new System.Windows.Forms.GroupBox(); + alternativeActionLabel = new System.Windows.Forms.Label(); + defaultActionLabel = new System.Windows.Forms.Label(); + searchOptionsGroup = new System.Windows.Forms.GroupBox(); + searchInGroup.SuspendLayout(); + actionsGroup.SuspendLayout(); + searchOptionsGroup.SuspendLayout(); + this.mPanel.SuspendLayout(); + this.mShowSearchGroup.SuspendLayout(); + this.mCustomSequences.SuspendLayout(); + this.SuspendLayout(); + // + // searchInGroup + // + searchInGroup.Controls.Add(this.mSearchInTags); + searchInGroup.Controls.Add(this.mSearchInOtherFields); + searchInGroup.Controls.Add(this.mSearchInNotes); + searchInGroup.Controls.Add(this.mSearchInUrl); + searchInGroup.Controls.Add(this.mSearchInUserName); + searchInGroup.Controls.Add(this.mSearchInTitle); + searchInGroup.Location = new System.Drawing.Point(4, 197); + searchInGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchInGroup.Name = "searchInGroup"; + searchInGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchInGroup.Size = new System.Drawing.Size(764, 72); + searchInGroup.TabIndex = 1; + searchInGroup.TabStop = false; + searchInGroup.Text = "Search in"; + // + // mSearchInTags + // + this.mSearchInTags.AutoSize = true; + this.mSearchInTags.Location = new System.Drawing.Point(387, 29); + this.mSearchInTags.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInTags.Name = "mSearchInTags"; + this.mSearchInTags.Size = new System.Drawing.Size(70, 24); + this.mSearchInTags.TabIndex = 4; + this.mSearchInTags.Text = "Ta&gs"; + this.mSearchInTags.UseVisualStyleBackColor = true; + // + // mSearchInOtherFields + // + this.mSearchInOtherFields.AutoSize = true; + this.mSearchInOtherFields.Location = new System.Drawing.Point(471, 29); + this.mSearchInOtherFields.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInOtherFields.Name = "mSearchInOtherFields"; + this.mSearchInOtherFields.Size = new System.Drawing.Size(206, 24); + this.mSearchInOtherFields.TabIndex = 5; + this.mSearchInOtherFields.Text = "&Other unprotected fields"; + this.mSearchInOtherFields.UseVisualStyleBackColor = true; + // + // mSearchInNotes + // + this.mSearchInNotes.AutoSize = true; + this.mSearchInNotes.Location = new System.Drawing.Point(297, 29); + this.mSearchInNotes.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInNotes.Name = "mSearchInNotes"; + this.mSearchInNotes.Size = new System.Drawing.Size(77, 24); + this.mSearchInNotes.TabIndex = 3; + this.mSearchInNotes.Text = "Note&s"; + this.mSearchInNotes.UseVisualStyleBackColor = true; + // + // mSearchInUrl + // + this.mSearchInUrl.AutoSize = true; + this.mSearchInUrl.Location = new System.Drawing.Point(216, 29); + this.mSearchInUrl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInUrl.Name = "mSearchInUrl"; + this.mSearchInUrl.Size = new System.Drawing.Size(68, 24); + this.mSearchInUrl.TabIndex = 2; + this.mSearchInUrl.Text = "&URL"; + this.mSearchInUrl.UseVisualStyleBackColor = true; + // + // mSearchInUserName + // + this.mSearchInUserName.AutoSize = true; + this.mSearchInUserName.Location = new System.Drawing.Point(92, 29); + this.mSearchInUserName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInUserName.Name = "mSearchInUserName"; + this.mSearchInUserName.Size = new System.Drawing.Size(113, 24); + this.mSearchInUserName.TabIndex = 1; + this.mSearchInUserName.Text = "User &name"; + this.mSearchInUserName.UseVisualStyleBackColor = true; + // + // mSearchInTitle + // + this.mSearchInTitle.AutoSize = true; + this.mSearchInTitle.Location = new System.Drawing.Point(14, 29); + this.mSearchInTitle.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mSearchInTitle.Name = "mSearchInTitle"; + this.mSearchInTitle.Size = new System.Drawing.Size(64, 24); + this.mSearchInTitle.TabIndex = 0; + this.mSearchInTitle.Text = "&Title"; + this.mSearchInTitle.UseVisualStyleBackColor = true; + // + // actionsGroup + // + actionsGroup.Controls.Add(this.mAlternativeAction); + actionsGroup.Controls.Add(this.mDefaultAction); + actionsGroup.Controls.Add(alternativeActionLabel); + actionsGroup.Controls.Add(defaultActionLabel); + actionsGroup.Location = new System.Drawing.Point(4, 358); + actionsGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + actionsGroup.Name = "actionsGroup"; + actionsGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + actionsGroup.Size = new System.Drawing.Size(764, 103); + actionsGroup.TabIndex = 3; + actionsGroup.TabStop = false; + actionsGroup.Text = "Actions"; + // + // mAlternativeAction + // + this.mAlternativeAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.mAlternativeAction.Location = new System.Drawing.Point(392, 57); + this.mAlternativeAction.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mAlternativeAction.Name = "mAlternativeAction"; + this.mAlternativeAction.Size = new System.Drawing.Size(358, 28); + this.mAlternativeAction.TabIndex = 3; + // + // mDefaultAction + // + this.mDefaultAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.mDefaultAction.Location = new System.Drawing.Point(16, 57); + this.mDefaultAction.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mDefaultAction.Name = "mDefaultAction"; + this.mDefaultAction.Size = new System.Drawing.Size(358, 28); + this.mDefaultAction.TabIndex = 1; + // + // alternativeActionLabel + // + alternativeActionLabel.AutoSize = true; + alternativeActionLabel.Location = new System.Drawing.Point(388, 31); + alternativeActionLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + alternativeActionLabel.Name = "alternativeActionLabel"; + alternativeActionLabel.Size = new System.Drawing.Size(238, 20); + alternativeActionLabel.TabIndex = 2; + alternativeActionLabel.Text = "A<ernative action (Shift + Enter):"; + // + // defaultActionLabel + // + defaultActionLabel.AutoSize = true; + defaultActionLabel.Location = new System.Drawing.Point(12, 31); + defaultActionLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + defaultActionLabel.Name = "defaultActionLabel"; + defaultActionLabel.Size = new System.Drawing.Size(165, 20); + defaultActionLabel.TabIndex = 0; + defaultActionLabel.Text = "De&fault action (Enter):"; + // + // searchOptionsGroup + // + searchOptionsGroup.Controls.Add(this.mResolveReferences); + searchOptionsGroup.Controls.Add(this.mExcludeExpired); + searchOptionsGroup.Controls.Add(this.mCaseSensitive); + searchOptionsGroup.Location = new System.Drawing.Point(4, 279); + searchOptionsGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchOptionsGroup.Name = "searchOptionsGroup"; + searchOptionsGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + searchOptionsGroup.Size = new System.Drawing.Size(764, 69); + searchOptionsGroup.TabIndex = 2; + searchOptionsGroup.TabStop = false; + searchOptionsGroup.Text = "Search options"; + // + // mResolveReferences + // + this.mResolveReferences.AutoSize = true; + this.mResolveReferences.Location = new System.Drawing.Point(376, 31); + this.mResolveReferences.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mResolveReferences.Name = "mResolveReferences"; + this.mResolveReferences.Size = new System.Drawing.Size(250, 24); + this.mResolveReferences.TabIndex = 2; + this.mResolveReferences.Text = "Resolve fiel&d references (slow)"; + this.mResolveReferences.UseVisualStyleBackColor = true; + // + // mExcludeExpired + // + this.mExcludeExpired.AutoSize = true; + this.mExcludeExpired.Location = new System.Drawing.Point(162, 31); + this.mExcludeExpired.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mExcludeExpired.Name = "mExcludeExpired"; + this.mExcludeExpired.Size = new System.Drawing.Size(198, 24); + this.mExcludeExpired.TabIndex = 1; + this.mExcludeExpired.Text = "Exclude &expired entries"; + this.mExcludeExpired.UseVisualStyleBackColor = true; + // + // mCaseSensitive + // + this.mCaseSensitive.AutoSize = true; + this.mCaseSensitive.Location = new System.Drawing.Point(15, 31); + this.mCaseSensitive.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mCaseSensitive.Name = "mCaseSensitive"; + this.mCaseSensitive.Size = new System.Drawing.Size(138, 24); + this.mCaseSensitive.TabIndex = 0; + this.mCaseSensitive.Text = "Case-sensiti&ve"; + this.mCaseSensitive.UseVisualStyleBackColor = true; + // + // mPanel + // + this.mPanel.AutoScroll = true; + this.mPanel.Controls.Add(this.mShowSearchGroup); + this.mPanel.Controls.Add(this.mCustomSequences); + this.mPanel.Controls.Add(searchOptionsGroup); + this.mPanel.Controls.Add(actionsGroup); + this.mPanel.Controls.Add(searchInGroup); + this.mPanel.Location = new System.Drawing.Point(9, 18); + this.mPanel.Name = "mPanel"; + this.mPanel.Size = new System.Drawing.Size(808, 463); + this.mPanel.TabIndex = 5; + // + // mShowSearchGroup + // + this.mShowSearchGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.mShowSearchGroup.Controls.Add(this.mShowOnHotKey); - this.mShowSearchGroup.Controls.Add(this.mShowHotKeyControl); - this.mShowSearchGroup.Controls.Add(this.mShowOnIPC); - this.mShowSearchGroup.Controls.Add(this.mShowOnFailedSearch); - this.mShowSearchGroup.Location = new System.Drawing.Point(6, 12); - this.mShowSearchGroup.Name = "mShowSearchGroup"; - this.mShowSearchGroup.Size = new System.Drawing.Size(540, 118); - this.mShowSearchGroup.TabIndex = 0; - this.mShowSearchGroup.TabStop = false; - this.mShowSearchGroup.Text = "Show search window"; - // - // mShowOnHotKey - // - this.mShowOnHotKey.AutoSize = true; - this.mShowOnHotKey.Location = new System.Drawing.Point(10, 44); - this.mShowOnHotKey.Name = "mShowOnHotKey"; - this.mShowOnHotKey.Size = new System.Drawing.Size(233, 17); - this.mShowOnHotKey.TabIndex = 1; - this.mShowOnHotKey.Text = "Show when system-wide &hot key is pressed:"; - this.mShowOnHotKey.UseVisualStyleBackColor = true; - this.mShowOnHotKey.CheckedChanged += new System.EventHandler(this.mShowOnHotKey_CheckedChanged); - // - // mShowOnIPC - // - this.mShowOnIPC.AutoSize = true; - this.mShowOnIPC.Location = new System.Drawing.Point(10, 93); - this.mShowOnIPC.Name = "mShowOnIPC"; - this.mShowOnIPC.Size = new System.Drawing.Size(386, 17); - this.mShowOnIPC.TabIndex = 3; - this.mShowOnIPC.Text = "Show when \"/e1:AutoTypeSearch\" is passed as a ¶meter to KeePass.exe"; - this.mShowOnIPC.UseVisualStyleBackColor = true; - // - // mShowOnFailedSearch - // - this.mShowOnFailedSearch.AutoSize = true; - this.mShowOnFailedSearch.Location = new System.Drawing.Point(10, 21); - this.mShowOnFailedSearch.Name = "mShowOnFailedSearch"; - this.mShowOnFailedSearch.Size = new System.Drawing.Size(275, 17); - this.mShowOnFailedSearch.TabIndex = 0; - this.mShowOnFailedSearch.Text = "Show &automatically if global auto-type finds no match"; - this.mShowOnFailedSearch.UseVisualStyleBackColor = true; - // - // Options - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(actionsGroup); - this.Controls.Add(searchInGroup); - this.Controls.Add(searchOptionsGroup); - this.Controls.Add(this.mShowSearchGroup); - this.Name = "Options"; - this.Size = new System.Drawing.Size(551, 311); - searchOptionsGroup.ResumeLayout(false); - searchOptionsGroup.PerformLayout(); - searchInGroup.ResumeLayout(false); - searchInGroup.PerformLayout(); - actionsGroup.ResumeLayout(false); - actionsGroup.PerformLayout(); - this.mShowSearchGroup.ResumeLayout(false); - this.mShowSearchGroup.PerformLayout(); - this.ResumeLayout(false); + this.mShowSearchGroup.Controls.Add(this.mShowOnHotKey); + this.mShowSearchGroup.Controls.Add(this.mShowHotKeyControl); + this.mShowSearchGroup.Controls.Add(this.mShowOnIPC); + this.mShowSearchGroup.Controls.Add(this.mShowOnFailedSearch); + this.mShowSearchGroup.Location = new System.Drawing.Point(4, 5); + this.mShowSearchGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowSearchGroup.Name = "mShowSearchGroup"; + this.mShowSearchGroup.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowSearchGroup.Size = new System.Drawing.Size(764, 182); + this.mShowSearchGroup.TabIndex = 0; + this.mShowSearchGroup.TabStop = false; + this.mShowSearchGroup.Text = "Show search window"; + // + // mShowOnHotKey + // + this.mShowOnHotKey.AutoSize = true; + this.mShowOnHotKey.Location = new System.Drawing.Point(15, 68); + this.mShowOnHotKey.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnHotKey.Name = "mShowOnHotKey"; + this.mShowOnHotKey.Size = new System.Drawing.Size(343, 24); + this.mShowOnHotKey.TabIndex = 1; + this.mShowOnHotKey.Text = "Show when system-wide &hot key is pressed:"; + this.mShowOnHotKey.UseVisualStyleBackColor = true; + this.mShowOnHotKey.CheckedChanged += new System.EventHandler(this.mShowOnHotKey_CheckedChanged); + // + // mShowHotKeyControl + // + this.mShowHotKeyControl.Location = new System.Drawing.Point(45, 100); + this.mShowHotKeyControl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowHotKeyControl.Name = "mShowHotKeyControl"; + this.mShowHotKeyControl.Size = new System.Drawing.Size(182, 26); + this.mShowHotKeyControl.TabIndex = 2; + // + // mShowOnIPC + // + this.mShowOnIPC.AutoSize = true; + this.mShowOnIPC.Location = new System.Drawing.Point(15, 143); + this.mShowOnIPC.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnIPC.Name = "mShowOnIPC"; + this.mShowOnIPC.Size = new System.Drawing.Size(574, 24); + this.mShowOnIPC.TabIndex = 3; + this.mShowOnIPC.Text = "Show when \"/e1:AutoTypeSearch\" is passed as a ¶meter to KeePass.exe"; + this.mShowOnIPC.UseVisualStyleBackColor = true; + // + // mShowOnFailedSearch + // + this.mShowOnFailedSearch.AutoSize = true; + this.mShowOnFailedSearch.Location = new System.Drawing.Point(15, 32); + this.mShowOnFailedSearch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mShowOnFailedSearch.Name = "mShowOnFailedSearch"; + this.mShowOnFailedSearch.Size = new System.Drawing.Size(408, 24); + this.mShowOnFailedSearch.TabIndex = 0; + this.mShowOnFailedSearch.Text = "Show &automatically if global auto-type finds no match"; + this.mShowOnFailedSearch.UseVisualStyleBackColor = true; + // + // mCustomSequences + // + this.mCustomSequences.Controls.Add(this.mAdditionalSequences); + this.mCustomSequences.Controls.Add(this.mAdditionalSequencesTitle); + this.mCustomSequences.Controls.Add(this.mAllowCustomSequences); + this.mCustomSequences.Location = new System.Drawing.Point(4, 469); + this.mCustomSequences.Name = "mCustomSequences"; + this.mCustomSequences.Size = new System.Drawing.Size(764, 206); + this.mCustomSequences.TabIndex = 4; + this.mCustomSequences.TabStop = false; + this.mCustomSequences.Text = "Custom Sequences"; + // + // mAdditionalSequences + // + this.mAdditionalSequences.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.mAdditionalSequences.FormattingEnabled = true; + this.mAdditionalSequences.ItemHeight = 20; + this.mAdditionalSequences.Items.AddRange(new object[] { + "+ new sequence", + "+ new sequence"}); + this.mAdditionalSequences.Location = new System.Drawing.Point(6, 87); + this.mAdditionalSequences.Name = "mAdditionalSequences"; + this.mAdditionalSequences.Size = new System.Drawing.Size(744, 104); + this.mAdditionalSequences.TabIndex = 9; + this.mAdditionalSequences.StartEdit += new System.EventHandler(this.mAdditionalSequences_StartEdit); + this.mAdditionalSequences.FinishEdit += new AutoTypeSearch.FinishEditEventHandler(this.mAdditionalSequences_FinishEdit); + this.mAdditionalSequences.SelectedIndexChanged += new System.EventHandler(this.mAdditionalSequences_SelectedIndexChanged); + // + // mAdditionalSequencesTitle + // + this.mAdditionalSequencesTitle.AutoSize = true; + this.mAdditionalSequencesTitle.Location = new System.Drawing.Point(6, 61); + this.mAdditionalSequencesTitle.Name = "mAdditionalSequencesTitle"; + this.mAdditionalSequencesTitle.Size = new System.Drawing.Size(221, 20); + this.mAdditionalSequencesTitle.TabIndex = 8; + this.mAdditionalSequencesTitle.Text = "Add&itional custom sequences:"; + // + // mAllowCustomSequences + // + this.mAllowCustomSequences.AutoSize = true; + this.mAllowCustomSequences.Location = new System.Drawing.Point(7, 27); + this.mAllowCustomSequences.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.mAllowCustomSequences.Name = "mAllowCustomSequences"; + this.mAllowCustomSequences.Size = new System.Drawing.Size(281, 24); + this.mAllowCustomSequences.TabIndex = 6; + this.mAllowCustomSequences.Text = "Allow &custom auto-type sequences"; + this.mAllowCustomSequences.UseVisualStyleBackColor = true; + // + // Options + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.mPanel); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "Options"; + this.Size = new System.Drawing.Size(834, 499); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.Options_Paint); + searchInGroup.ResumeLayout(false); + searchInGroup.PerformLayout(); + actionsGroup.ResumeLayout(false); + actionsGroup.PerformLayout(); + searchOptionsGroup.ResumeLayout(false); + searchOptionsGroup.PerformLayout(); + this.mPanel.ResumeLayout(false); + this.mShowSearchGroup.ResumeLayout(false); + this.mShowSearchGroup.PerformLayout(); + this.mCustomSequences.ResumeLayout(false); + this.mCustomSequences.PerformLayout(); + this.ResumeLayout(false); } #endregion - private KeePass.UI.HotKeyControlEx mShowHotKeyControl; + private System.Windows.Forms.Panel mPanel; + private System.Windows.Forms.GroupBox mShowSearchGroup; private System.Windows.Forms.CheckBox mShowOnHotKey; + private HotKeyControlEx mShowHotKeyControl; private System.Windows.Forms.CheckBox mShowOnIPC; private System.Windows.Forms.CheckBox mShowOnFailedSearch; + private System.Windows.Forms.GroupBox mCustomSequences; + private System.Windows.Forms.Label mAdditionalSequencesTitle; + private System.Windows.Forms.CheckBox mAllowCustomSequences; + private System.Windows.Forms.CheckBox mResolveReferences; + private System.Windows.Forms.CheckBox mExcludeExpired; private System.Windows.Forms.CheckBox mCaseSensitive; + private System.Windows.Forms.ComboBox mAlternativeAction; + private System.Windows.Forms.ComboBox mDefaultAction; private System.Windows.Forms.CheckBox mSearchInTags; private System.Windows.Forms.CheckBox mSearchInOtherFields; private System.Windows.Forms.CheckBox mSearchInNotes; private System.Windows.Forms.CheckBox mSearchInUrl; private System.Windows.Forms.CheckBox mSearchInUserName; private System.Windows.Forms.CheckBox mSearchInTitle; - private System.Windows.Forms.CheckBox mResolveReferences; - private System.Windows.Forms.CheckBox mExcludeExpired; - private System.Windows.Forms.ComboBox mAlternativeAction; - private System.Windows.Forms.ComboBox mDefaultAction; - private System.Windows.Forms.GroupBox mShowSearchGroup; - + private EditableStringList mAdditionalSequences; } } diff --git a/AutoTypeSearch/Options.cs b/AutoTypeSearch/Options.cs index b99561c..85819b3 100755 --- a/AutoTypeSearch/Options.cs +++ b/AutoTypeSearch/Options.cs @@ -1,7 +1,10 @@ using System; using System.Configuration; using System.Diagnostics; +using System.Drawing; +using System.IO; using System.Linq; +using System.Net.NetworkInformation; using System.Windows.Forms; using AutoTypeSearch.Properties; using KeePass.Forms; @@ -29,7 +32,7 @@ // Read options mShowOnFailedSearch.Checked = Settings.Default.ShowOnFailedAutoType; - + if (NativeLib.IsUnix()) { mShowOnHotKey.Enabled = false; @@ -51,13 +54,26 @@ mSearchInNotes.Checked = Settings.Default.SearchNotes; mSearchInTags.Checked = Settings.Default.SearchTags; mSearchInOtherFields.Checked = Settings.Default.SearchCustomFields; - + mCaseSensitive.Checked = Settings.Default.CaseSensitive; mExcludeExpired.Checked = Settings.Default.ExcludeExpired; mResolveReferences.Checked = Settings.Default.ResolveReferences; mDefaultAction.SelectedIndex = (int)Settings.Default.DefaultAction; mAlternativeAction.SelectedIndex = (int)Settings.Default.AlternativeAction; + + mAdditionalSequences.BeginUpdate(); + mAdditionalSequences.Items.Clear(); + + if (Settings.Default.AdditionalCustomSequences != null) + { + foreach (string s in Settings.Default.AdditionalCustomSequences) + { + mAdditionalSequences.Items.Add(s); + } + } + + mAdditionalSequences.EndUpdate(); } private Keys ShowHotKey @@ -90,6 +106,15 @@ Settings.Default.AlternativeAction = (Actions)mAlternativeAction.SelectedIndex; Settings.Default.ShowHotKey = ShowHotKey; + Settings.Default.AdditionalCustomSequences = new System.Collections.Specialized.StringCollection(); + for (int i = 0; i < mAdditionalSequences.Items.Count; i++) + { + if (i != mAdditionalSequences.NewEntryIndex) + { + Settings.Default.AdditionalCustomSequences.Add(mAdditionalSequences.Items[i].ToString()); + } + } + ApplyHotKey(); } @@ -161,8 +186,10 @@ } #endregion + private static OptionsForm sOptionsForm; public static void AddToWindow(OptionsForm optionsForm) { + Options.sOptionsForm = optionsForm; var tabControl = optionsForm.Controls.Find("m_tabMain", false).FirstOrDefault() as TabControl; var okButton = optionsForm.Controls.Find("m_btnOK", false).FirstOrDefault() as Button; @@ -187,5 +214,110 @@ options.ApplySettings(); }; } + + private void Options_Paint(object sender, PaintEventArgs e) + { + Rectangle r = new Rectangle(mPanel.Location, mPanel.ClientSize); + //r.Offset(mPanel.Location); + r.X -= 1; + r.Y -= 1; + r.Width += 2 + SystemInformation.VerticalScrollBarWidth; + r.Height += 2; + ControlPaint.DrawBorder(e.Graphics, r, SystemColors.GrayText, ButtonBorderStyle.Solid); + } + + #region Prevent closing when editing + private IButtonControl mOldOptionsAcceptButton; + private IButtonControl mOldOptionsCancelButton; + private int mSavedOldOptionsAcceptButton = 0; + private int mSavedOldOptionsCancelButton = 0; + + private void SaveFormAcceptButton() + { + mSavedOldOptionsAcceptButton++; + if (sOptionsForm != null && mSavedOldOptionsAcceptButton == 1) + { + mOldOptionsAcceptButton = sOptionsForm.AcceptButton; + sOptionsForm.AcceptButton = null; + } + } + + private void RestoreFormAcceptButton() + { + if (mSavedOldOptionsAcceptButton > 0) + { + mSavedOldOptionsAcceptButton--; + if (sOptionsForm != null && mSavedOldOptionsAcceptButton == 0) + { + sOptionsForm.AcceptButton = mOldOptionsAcceptButton; + } + } + } + + private void SaveFormCancelButton() + { + mSavedOldOptionsCancelButton++; + if (sOptionsForm != null && mSavedOldOptionsCancelButton == 1) + { + mOldOptionsCancelButton = sOptionsForm.CancelButton; + sOptionsForm.CancelButton = null; + } + } + + private void RestoreFormCancelButton() + { + if (mSavedOldOptionsCancelButton > 0) + { + mSavedOldOptionsCancelButton--; + if (sOptionsForm != null && mSavedOldOptionsCancelButton == 0) + { + sOptionsForm.CancelButton = mOldOptionsCancelButton; + } + } + } + private void mAdditionalSequences_StartEdit(object sender, EventArgs e) + { + SaveFormAcceptButton(); + SaveFormCancelButton(); + + mPanel.ScrollControlIntoView(mAdditionalSequences); + } + + private void mAdditionalSequences_FinishEdit(object sender, EventArgs e) + { + RestoreFormAcceptButton(); + RestoreFormCancelButton(); + } + + private void mAdditionalSequences_SelectedIndexChanged(object sender, EventArgs e) + { + mPanel.ScrollControlIntoView(mAdditionalSequences); + } + + #endregion + + #region Additional sequence list focusing + private bool mAdditionalSequencesFocused = false; + private void mAdditionalSequences_Enter(object sender, EventArgs e) + { + if (mAdditionalSequencesFocused) return; + mAdditionalSequencesFocused = true; + + SaveFormAcceptButton(); + } + + private void mAdditionalSequences_Leave(object sender, EventArgs e) + { + if (!mAdditionalSequencesFocused) return; + mAdditionalSequencesFocused = false; + + RestoreFormAcceptButton(); + } + #endregion + + private void mAdditionalSequences_FinishEdit(object sender, FinishEditEventArgs e) + { + + } } } diff --git a/AutoTypeSearch/Options.resx b/AutoTypeSearch/Options.resx index 4601c27..34a3218 100755 --- a/AutoTypeSearch/Options.resx +++ b/AutoTypeSearch/Options.resx @@ -1,4 +1,4 @@ - +