Skip to content

Commit

Permalink
Add item group info to the breached entries list.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-schofield committed Apr 7, 2017
1 parent dd27087 commit 7c37dc1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.
Binary file modified HaveIBeenPwned.plgx
Binary file not shown.
19 changes: 10 additions & 9 deletions HaveIBeenPwned/BreachedEntriesDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions HaveIBeenPwned/BreachedEntriesDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using KeePassLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Windows.Forms;

Expand All @@ -20,6 +21,13 @@ public BreachedEntriesDialog(IPluginHost pluginHost)
public void AddBreaches(IList<BreachedEntry> breaches)
{
breachedEntryList.Items.Clear();
breachedEntryList.Groups.Clear();
var groupNames = breaches.Select(b => b.Entry.ParentGroup.GetFullPath(" - ", false)).Distinct();
foreach(var group in groupNames)
{
breachedEntryList.Groups.Add(new ListViewGroup(group, HorizontalAlignment.Left));
}
breachedEntryList.ShowGroups = true;
foreach (var breach in breaches)
{
var newItem = new ListViewItem(new[]
Expand All @@ -34,6 +42,14 @@ public void AddBreaches(IList<BreachedEntry> breaches)
{
Tag = breach.Entry
};

foreach(ListViewGroup group in breachedEntryList.Groups)
{
if (group.Header == breach.Entry.ParentGroup.GetFullPath(" - ", false))
{
newItem.Group = group;
}
}
breachedEntryList.Items.Add(newItem);
}
}
Expand Down
4 changes: 2 additions & 2 deletions HaveIBeenPwned/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.6.0")]
[assembly: AssemblyFileVersion("0.2.6.0")]
[assembly: AssemblyVersion("0.2.7.0")]
[assembly: AssemblyFileVersion("0.2.7.0")]
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
:
HaveIBeenPwned checker:0.2.6
HaveIBeenPwned checker:0.2.7
:
Binary file modified mono/HaveIBeenPwned.dll
Binary file not shown.

0 comments on commit 7c37dc1

Please sign in to comment.