diff --git a/LoadEntriesWindow.xaml b/LoadEntriesWindow.xaml
index 545c6f5..1f91911 100644
--- a/LoadEntriesWindow.xaml
+++ b/LoadEntriesWindow.xaml
@@ -28,11 +28,13 @@
+
-
+
+
diff --git a/LoadEntriesWindow.xaml.cs b/LoadEntriesWindow.xaml.cs
index 39c3b22..fc3e2cf 100644
--- a/LoadEntriesWindow.xaml.cs
+++ b/LoadEntriesWindow.xaml.cs
@@ -1,9 +1,11 @@
using System;
+using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Windows;
using Microsoft.Win32;
using EDJournal;
+using EliteBGS.BGS;
using EliteBGS.Util;
namespace EliteBGS {
@@ -73,5 +75,36 @@ namespace EliteBGS {
} catch (Exception) {
}
}
+
+ private void DeleteUnimportant_Click(object sender, RoutedEventArgs e) {
+ string lines = Lines.Text.Trim();
+ if (lines.Length <= 0) {
+ return;
+ }
+
+ try {
+ List entries = new List();
+
+ foreach (string line in lines.Split('\n')) {
+ Entry entry = Entry.Parse(line);
+ if (Report.IsRelevant(entry)) {
+ entries.Add(entry);
+ }
+ }
+
+ if (entries.Count <= 0) {
+ return;
+ }
+
+ string[] text = entries
+ .ConvertAll(x => x.JSON.ToString(Newtonsoft.Json.Formatting.None))
+ .ToArray()
+ ;
+ Lines.Text = string.Join("\n", text).Trim();
+ } catch (Exception exception) {
+ MessageBox.Show(string.Format("There was an error while parsing the JSON: {0}",
+ exception.ToString()));
+ }
+ }
}
}