From 1ef21480ebd00dea27c5995efa3abbcb27ce96d0 Mon Sep 17 00:00:00 2001 From: Max Stebner Date: Fri, 17 Aug 2018 16:39:07 +0200 Subject: [PATCH] Removed Apply to existing lines checkbox --- src/images/notes.png | Bin 0 -> 8032 bytes src/lw_common/filter/filter.cs | 120 +++++------------- src/lw_common/filter/filter_row.cs | 11 +- src/lw_common/filter/raw_filter_row.cs | 18 +-- src/lw_common/ui/filter_ctrl.Designer.cs | 21 +-- src/lw_common/ui/filter_ctrl.cs | 59 ++------- src/lw_common/ui/filter_ctrl.resx | 2 +- src/lw_common/ui/log_view/log_view.cs | 11 +- src/lw_common/ui/log_view/log_view_parent.cs | 2 +- .../ui/log_view/log_view_right_click.cs | 31 +---- .../ui/log_view/match/log_view_data_source.cs | 11 +- src/lw_common/ui/note_ctrl.cs | 4 +- src/lw_common/ui/search/search_for.cs | 6 +- .../log_wizard_serializable_classes.cs | 3 - src/lw_common/util/util.cs | 2 +- src/ui/log_wizard.cs | 21 +-- 16 files changed, 89 insertions(+), 233 deletions(-) create mode 100644 src/images/notes.png diff --git a/src/images/notes.png b/src/images/notes.png new file mode 100644 index 0000000000000000000000000000000000000000..0abd1bccebcf7042be952a03cbd521be48550fa2 GIT binary patch literal 8032 zcmeHsX;e~s`?j4dGb>9gD;1iQw9-n;Qp85f5r>=yDl=2VAtxMwQX8z4%G6Ag%z1)R z0fo{~Q`4h#oNz*LL`4M$L_y&7y#Hsd=ls7t>;3vZAFg%p-(GvIz1O|3`@ZfW!N&Uf z_N@oD%E-uUH@k7wPDW+}U>$Q?Hm~0?bMvCDn++j$*DuT9+SR7k53)X&tS-sOe8niN z-QKi*mJhn&5+WnBqyBGfXbLR6Dw zYk#h7_?Ga>YRj=Znm^v0q3(RAWOG9!<8+1E&Z-}GzEYq3;T8OqnkeikN}IFqb`YP@ z1J9(dN*`5BEcu6pb?X^l$%yXW@aS}`+@lNYs6K&^gojwz?haehPK=e4Nt!wl%Z5pX zPHXZ9#Ia>&UT;|!y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%4SBTY)E?J~Z82YYQ;|!|BZCsEk@<(!lDjGeh^@sya`p zTMaSlPS?@O2c?}JP0{oS*l0O{ZPC;s@W0QeeTK-x%lOqNprU-QY5(M`QqSu>S%{hb zGgj>?7`>Zn(TN=Aj)KVOf}61gJrR9j+r)O?p?Y-p+9oCiPnZ{5p4$cPuL@br%9hs^46cp`k{;_5^i3Bx4y1>!aBiHR9O$vIv8mrR39kXixC8a-p&?lcg% zzuQDXl*{yd$+i;Zqf|ZI#tntU;{@;YBF+Q%XG1>4C+i8;MRK&s%=9R?x7Gf0bRQAf zO9?#6dXv$YtUFP@>9S!vV`e4k_1l_3r_GIB3-03g`>P|TFP^a-^R8(7`AI!V{rEu9 z(T(l=R#K2Pb0SddRo#5YBM#a#vZfyePn5Xyg1RBP%T{7XPq*;xb||31d@Z@)vVj(V zOkLMLA6F5q9))#u3ym&th%E?jFRB3$(83QQqPM7Jo;^qUm>fCsD=@UmEIY8fhFQz! z?k*d5<-AXCyy#1GVLn)$>O5}73ufC6|}wcrt0<4?FB^-+r(cdmXW3ftLhkw$n@94 zkS7_HG1VR5{EmIc98>tWY*Ix+6@Z1^!v~f zw5IT`8Mbv{>AS@=DQ2V_KT7%5s_UFOFWyftnFihC8%~Jy1Gx?26LdoRR4Tpc&d}b| z5p5-N^Lml_tm@E!orRB=*0v4UTY}v+W95ij0O$X`f%xY(LdMHOAjJ*ttyA<(vRL1W P%a~oWzKXkiEB5~Y;l~S` literal 0 HcmV?d00001 diff --git a/src/lw_common/filter/filter.cs b/src/lw_common/filter/filter.cs index 3aaaede..96874f1 100644 --- a/src/lw_common/filter/filter.cs +++ b/src/lw_common/filter/filter.cs @@ -28,9 +28,9 @@ using System.Linq; using System.Threading; using System.Windows.Forms; +using lw_common.ui; namespace lw_common { - class filter : IDisposable { private static log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); @@ -47,21 +47,6 @@ public class match { // (so that we don't return null) public readonly int line_idx = 0; - // returns true if at least one "include" filter matches this (or, if we don't have any include filters) - public bool has_matches_via_include(filter f) { - if (!f.has_include_filters) - // in this case, we match all - return true; - if (matches.Count == 0) - return false; - // it needs to match at least one include filter! - for (int idx = 0; idx < matches.Count; ++idx) - if (matches[idx]) - if (f.is_include_filter(idx)) - return true; - return false; - } - public match(BitArray matches, font_info font, line line, int line_idx) { this.matches = matches; this.font = font; @@ -106,7 +91,7 @@ public int count { // in case we're asking for an invalid line, just return something that is fully empty // next time, the log view will see that we've updated - public match match_at(int idx) { + private match match_at(int idx) { lock (this) { if (show_elements_in_reverse_order) idx = matches_.Count - idx - 1; @@ -201,6 +186,7 @@ private Tuple care_about_reverse_order(Tuple result) { return result; } + public match this[int i] => match_at(i); } @@ -235,8 +221,11 @@ private Tuple care_about_reverse_order(Tuple result) { public enum change_type { new_lines, changed_filter, file_rewritten } + public delegate void on_change_func(change_type change); + public on_change_func on_change; + public status_ctrl status; private bool file_rewritten_ = false; @@ -281,23 +270,6 @@ public void clear() { } } - public bool has_include_filters { - get { - lock (this) { - if (rows_.Count == 0) - return false; // optimization - - var first = rows_.FirstOrDefault(x => !x.apply_to_existing_lines); - return first != null; - } - } - } - - public bool is_include_filter(int row_idx) { - lock (this) - return !rows_[row_idx].apply_to_existing_lines; - } - public int row_count { get { lock (this) return rows_.Count; } } @@ -306,14 +278,12 @@ public bool rows_changed { get { lock (this) return rows_changed_; } } - public int match_count { - get { return matches_.count; } - } + public int match_count => matches_.count; public int full_count { get { lock (this) { - return new_log_ != null ? new_log_.line_count : 0; + return new_log_?.line_count ?? 0; } } } @@ -329,7 +299,7 @@ public DateTime last_change { // note: the only time this can return null is this: since we're refreshing on another thread, // we might at some point get a match_count, and while we're retrieving the items, the matches array clears public match match_at(int idx) { - return matches_.match_at(idx); + return matches_[idx]; } // this will return the log we last read the matches from @@ -494,7 +464,7 @@ private void compute_matches_thread() { continue; } - // the reason I do this here - I need to let the main thread know htat the log was fully set (and the matches are from This log) + // the reason I do this here - I need to let the main thread know that the log was fully set (and the matches are from This log) // ONLY after I have read from it at least once lock (this) old_log_ = new_; @@ -507,8 +477,10 @@ private void compute_matches_thread() { if (new_lines_found) { bool raise_event = file_rewritten || (old_count != new_count); - if (raise_event) + if (raise_event) { on_change(file_rewritten ? change_type.file_rewritten : change_type.new_lines); + status?.set_status("Done!", status_ctrl.status_type.msg, 1000); + } } else if (needs_recompute && (old_count != 0 || new_count != 0)) on_change(change_type.changed_filter); } @@ -572,72 +544,38 @@ private void compute_matches_impl(log_reader new_log, log_reader old_log) { row.compute_line_matches(new_log); if (has_new_lines) { + status?.set_status("Computing filters... This might take a moment", status_ctrl.status_type.msg, 10000); bool is_full_log = row_count < 1; int expected_capacity = is_full_log ? (new_log.line_count - old_line_count) : (new_log.line_count - old_line_count) / 5; // the filter matches - memory_optimized_list new_matches = new memory_optimized_list() { min_capacity = expected_capacity, name = "temp_m " + name, increase_percentage = .7 }; + memory_optimized_list new_matches = new memory_optimized_list { min_capacity = expected_capacity, name = "temp_m " + name, increase_percentage = .7 }; // from old_lines to log.line_count -> these need recomputing int old_match_count = matches_.count; - BitArray matches = new BitArray(rows.Count); + bool[] row_matches_filter = new bool[rows.Count]; // handle the case where all the filters are disabled (thus, show all lines) int run_filter_count = rows.Count(x => x.enabled); for (int line_idx = old_line_count; line_idx < new_log.line_count; ++line_idx) { bool any_match = false; - bool any_non_apply_to_existing_lines_filters = false; - // 1.0.69 added "apply to existing filters" - for (int filter_idx = 0; filter_idx < matches.Length; ++filter_idx) { + // Go through all filters + for (int filter_idx = 0; filter_idx < row_matches_filter.Length; ++filter_idx) { var row = rows[filter_idx]; - if (row.enabled && !row.apply_to_existing_lines) { - matches[filter_idx] = row.line_matches.Contains(line_idx); - any_non_apply_to_existing_lines_filters = true; - } else - matches[filter_idx] = false; - if (matches[filter_idx]) + if (row.enabled && row.line_matches.Contains(line_idx)) { + row_matches_filter[filter_idx] = true; any_match = true; - } - if (!any_non_apply_to_existing_lines_filters) - // in this case - all filters apply to existing lines - thus, by default, we show all the lines - any_match = true; - - // 1.0.69 "apply to existing filters" is applied afterwards - font_info existing_filter_font = null; - if (any_match) - for (int filter_idx = 0; filter_idx < matches.Length && any_match; ++filter_idx) { - var row = rows[filter_idx]; - if (row.enabled && row.apply_to_existing_lines) { - bool is_font_only = row.has_font_info; - if (row.line_matches.Contains(line_idx)) { - if (existing_filter_font == null && is_font_only) { - // in this case, use the font from "apply to existing filters" - only if the user has specifically set it - existing_filter_font = row.get_match(line_idx).font; - matches[filter_idx] = true; - } - } else if (!is_font_only) - // we're filtering this line out - any_match = false; - } } + } if (any_match) { - font_info font = (existing_filter_font ?? font_info.default_font).copy(); + font_info font = font_info.default_font.copy(); + // 1.3.29g+ apply and merge all enabled filters + for (int filter_idx = 0; filter_idx < row_matches_filter.Length; ++filter_idx) + if (row_matches_filter[filter_idx]) + font.merge(rows[filter_idx].get_match(line_idx).font); - int enabled_idx = -1; - for (int filter_idx = 0; filter_idx < matches.Length && enabled_idx < 0; ++filter_idx) - if (matches[filter_idx] && rows[filter_idx].enabled) - enabled_idx = filter_idx; - - if (enabled_idx >= 0) { - // 1.3.29g+ apply and merge all enabled filters - for (int filter_idx = 0; filter_idx < matches.Length; ++filter_idx) - if (matches[filter_idx] && rows[filter_idx].enabled) - font.merge(rows[filter_idx].get_match(line_idx).font); - - } - - new_matches.Add(new_match(new BitArray(matches), new_log.line_at(line_idx), line_idx, font)); + new_matches.Add(new_match(new BitArray(row_matches_filter), new_log.line_at(line_idx), line_idx, font)); continue; } @@ -670,6 +608,8 @@ private void compute_matches_impl(log_reader new_log, log_reader old_log) { bool is_up_to_date = new_log.up_to_date; lock (this) is_up_to_date_ = is_up_to_date; + + } @@ -690,7 +630,7 @@ private void apply_additions(int old_match_count, log_reader log, List additions = new Dictionary(); int new_match_count = matches_.count; for (int match_idx = old_match_count; match_idx < new_match_count; ++match_idx) { - int line_idx = matches_.match_at(match_idx).line_idx; + int line_idx = matches_[match_idx].line_idx; var match = match_at(match_idx); int matched_filter = -1; diff --git a/src/lw_common/filter/filter_row.cs b/src/lw_common/filter/filter_row.cs index dca6825..e293389 100644 --- a/src/lw_common/filter/filter_row.cs +++ b/src/lw_common/filter/filter_row.cs @@ -33,7 +33,7 @@ namespace lw_common { public class filter_row : raw_filter_row { private static log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - public filter_row(string text, bool apply_to_existing_lines) : base(text, apply_to_existing_lines) { + public filter_row(string text) : base(text) { } public filter_row(raw_filter_row other) : base(other) { @@ -60,8 +60,13 @@ public void refresh() { old_line_count_ = 0; } } - - // computes the line matches - does not care about colors or the additions - just to know which lines actually match + + /// + /// Computes the line matches - + /// sets this.line_matches to a valid value + /// - does not care about colors or the additions - just to know which lines actually match + /// + /// public void compute_line_matches(log_reader log) { log.refresh(); if (old_line_matches_log_ != log) { diff --git a/src/lw_common/filter/raw_filter_row.cs b/src/lw_common/filter/raw_filter_row.cs index 752c490..bdeb554 100644 --- a/src/lw_common/filter/raw_filter_row.cs +++ b/src/lw_common/filter/raw_filter_row.cs @@ -68,8 +68,7 @@ public override int GetHashCode() { // if it is, we can keep the cached information (about line matches) public bool same(raw_filter_row other) { //return Enumerable.SequenceEqual(items_, other.items_) && Enumerable.SequenceEqual(additions_, other.additions_) && apply_to_existing_lines == other.apply_to_existing_lines; - return unique_id == other.unique_id && apply_to_existing_lines == other.apply_to_existing_lines && - font_ == other.font_; + return unique_id == other.unique_id && font_ == other.font_; } //////////////////////////////////////////////////////////////////////////////////////////////// @@ -83,12 +82,6 @@ public bool same(raw_filter_row other) { protected readonly font_info font_ = null; - // if true, this is applied after the normal filters - // - // it can : filter out lines from what the normal filters yielded and/or - // give a different color to the lines - public readonly bool apply_to_existing_lines = false; - protected readonly string unique_id_; // 1.2.20+ useful to find a filter by id @@ -141,8 +134,8 @@ public static string merge_lines(string old_text, string new_text) { // note : we don't care about apply-to-existing-lines - we know it's the same amongst old/new filter row // what I care about is the colors (line color and merge color) bool apply_to_existing_lines = false; - var old_row = new raw_filter_row(old_text, apply_to_existing_lines); - var new_row = new raw_filter_row(new_text, apply_to_existing_lines); + var old_row = new raw_filter_row(old_text); + var new_row = new raw_filter_row(new_text); // old lines - not trimmed (so that we can insert them as they were - if needed); new lines -> trimmed var old_lines = old_row.lines_.Where(x => !filter_line.is_color_or_font_line(x) && !x.Trim().StartsWith("#") && x.Trim() != "" ).ToList(); @@ -167,7 +160,6 @@ public raw_filter_row(raw_filter_row other) { items_ = other.items_.ToList(); lines_ = other.lines_.ToArray(); additions_ = other.additions.ToList(); - apply_to_existing_lines = other.apply_to_existing_lines; unique_id_ = other.unique_id_; valid_ = other.valid_; enabled_ = other.enabled; @@ -176,8 +168,7 @@ public raw_filter_row(raw_filter_row other) { update_font(); } - public raw_filter_row(string text, bool apply_to_existing_lines) { - this.apply_to_existing_lines = apply_to_existing_lines; + public raw_filter_row(string text) { List lines = new List(); List additions = new List(); lines_ = text.Split(new string[] {"\r\n"}, StringSplitOptions.RemoveEmptyEntries); @@ -199,7 +190,6 @@ public raw_filter_row(string text, bool apply_to_existing_lines) { valid_ = false; } } - unique_id_ += "" + apply_to_existing_lines; font_ = font_info.default_font.copy(); init(lines, additions); diff --git a/src/lw_common/ui/filter_ctrl.Designer.cs b/src/lw_common/ui/filter_ctrl.Designer.cs index b4f3058..ea40db6 100644 --- a/src/lw_common/ui/filter_ctrl.Designer.cs +++ b/src/lw_common/ui/filter_ctrl.Designer.cs @@ -30,7 +30,6 @@ private void InitializeComponent() { this.enabledCol = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.filterCol = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.foundCol = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); - this.applyToExistingLines = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); this.delFilter = new System.Windows.Forms.Button(); this.filterLabel = new System.Windows.Forms.Label(); @@ -128,6 +127,7 @@ private void InitializeComponent() { // enabledCol // this.enabledCol.AspectName = "enabled"; + this.enabledCol.CellPadding = null; this.enabledCol.CheckBoxes = true; this.enabledCol.HeaderTextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.enabledCol.Text = "Enabled"; @@ -140,33 +140,20 @@ private void InitializeComponent() { this.filterCol.AspectName = "name"; this.filterCol.AutoCompleteEditor = false; this.filterCol.AutoCompleteEditorMode = System.Windows.Forms.AutoCompleteMode.None; + this.filterCol.CellPadding = null; this.filterCol.FillsFreeSpace = true; this.filterCol.Text = "Filter"; // // foundCol // this.foundCol.AspectName = "found_count"; + this.foundCol.CellPadding = null; this.foundCol.HeaderTextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.foundCol.IsEditable = false; this.foundCol.Text = "Found"; this.foundCol.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.foundCol.ToolTipText = "Shows how many log lines this specific filter has found"; // - // applyToExistingLines - // - this.applyToExistingLines.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.applyToExistingLines.AutoSize = true; - this.applyToExistingLines.Location = new System.Drawing.Point(3, 488); - this.applyToExistingLines.Name = "applyToExistingLines"; - this.applyToExistingLines.Size = new System.Drawing.Size(126, 17); - this.applyToExistingLines.TabIndex = 33; - this.applyToExistingLines.TabStop = false; - this.applyToExistingLines.Text = "Apply to existing lines"; - this.applyToExistingLines.UseVisualStyleBackColor = true; - this.applyToExistingLines.CheckedChanged += new System.EventHandler(this.applyToExistingLines_CheckedChanged); - this.applyToExistingLines.Leave += new System.EventHandler(this.applyToExistingLines_Leave); - // // label1 // this.label1.AutoSize = true; @@ -414,7 +401,6 @@ private void InitializeComponent() { this.Controls.Add(this.viewFromClipboard); this.Controls.Add(this.viewToClipboard); this.Controls.Add(this.filterCtrl); - this.Controls.Add(this.applyToExistingLines); this.Controls.Add(this.label1); this.Controls.Add(this.filterBox); this.Controls.Add(this.delFilter); @@ -440,7 +426,6 @@ private void InitializeComponent() { private BrightIdeasSoftware.OLVColumn enabledCol; private BrightIdeasSoftware.OLVColumn filterCol; private BrightIdeasSoftware.OLVColumn foundCol; - private System.Windows.Forms.CheckBox applyToExistingLines; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button delFilter; private System.Windows.Forms.Label filterLabel; diff --git a/src/lw_common/ui/filter_ctrl.cs b/src/lw_common/ui/filter_ctrl.cs index 25b6f34..30c7c24 100644 --- a/src/lw_common/ui/filter_ctrl.cs +++ b/src/lw_common/ui/filter_ctrl.cs @@ -101,20 +101,15 @@ public string text { set { filter_.text = value; } } - public bool apply_to_existing_lines { - get { return filter_.apply_to_existing_lines; } - set { filter_.apply_to_existing_lines = value; } - } - public string filter_id { get { - raw_filter_row row = new raw_filter_row(filter_.text, filter_.apply_to_existing_lines); + raw_filter_row row = new raw_filter_row(filter_.text); return row.filter_id; } } public string unique_id { get { - raw_filter_row row = new raw_filter_row(filter_.text, filter_.apply_to_existing_lines); + raw_filter_row row = new raw_filter_row(filter_.text); return row.unique_id; } } @@ -172,7 +167,7 @@ public List to_filter_row_list() { int count = filterCtrl.GetItemCount(); for (int idx = 0; idx < count; ++idx) { filter_item i = filterCtrl.GetItem(idx).RowObject as filter_item; - raw_filter_row filt = new raw_filter_row(i.text, i.apply_to_existing_lines) { enabled = i.enabled }; + raw_filter_row filt = new raw_filter_row(i.text) { enabled = i.enabled }; if (filt.is_valid) lvf.Add(filt); @@ -204,6 +199,7 @@ public void toggle_enabled(OLVListItem item = null) { on_save(); ui_to_view(view_idx_); on_rerun_view(view_idx_); + on_refresh_view(view_idx_); } @@ -227,7 +223,6 @@ public void view_to_ui(ui_view view, int view_idx) { filterCtrl.SetObjects(items); filterBox.Text = ""; - applyToExistingLines.Checked = false; --ignore_change_; ui_to_view(view_idx_); @@ -250,7 +245,6 @@ private void filterCtrl_SelectedIndexChanged(object sender, EventArgs e) { if (sel <= 0) { ++ignore_change_; filterBox.ResetText(); - applyToExistingLines.Checked = false; --ignore_change_; mark_match(-1); @@ -258,11 +252,8 @@ private void filterCtrl_SelectedIndexChanged(object sender, EventArgs e) { } filter_item i = filterCtrl.GetItem(sel).RowObject as filter_item; - ++ignore_change_; - applyToExistingLines.Checked = i.apply_to_existing_lines; - --ignore_change_; - raw_filter_row filt = new raw_filter_row(i.text, i.apply_to_existing_lines); + raw_filter_row filt = new raw_filter_row(i.text); if (filt.is_valid) { /* var lv = ensure_we_have_log_view_for_tab(sel_view); @@ -318,7 +309,7 @@ private void filterCtrl_SelectionChanged(object sender, EventArgs e) { delFilter.Enabled = filterCtrl.SelectedIndices.Count >= 1; cancelFilter.Enabled = filterCtrl.SelectedIndices.Count == 1; if (sel != null) { - var row = new raw_filter_row(sel.text, sel.apply_to_existing_lines); + var row = new raw_filter_row(sel.text); filterLabel.BackColor = row.bg; filterLabel.ForeColor = row.fg; } else { @@ -344,7 +335,7 @@ private void filterBox_TextChanged(object sender, EventArgs e) { return; - var row = new raw_filter_row(filterBox.Text, applyToExistingLines.Checked); + var row = new raw_filter_row(filterBox.Text); // Realtime text change to list object if (filterCtrl.SelectedObject is filter_item sel && row.is_valid) { if (sel.text != filterBox.Text) { @@ -382,37 +373,20 @@ private void filterBox_TextChanged(object sender, EventArgs e) { addFilter.Enabled = filterBox.Text.Trim() != "" && row.is_valid; } - private void applyToExistingLines_CheckedChanged(object sender, EventArgs e) { - if (ignore_change_ > 0) - return; - if (filterCtrl.GetItemCount() == 0) - return; - - if (!(filterCtrl.SelectedObject is filter_item sel)) - return; - - if (sel.apply_to_existing_lines != applyToExistingLines.Checked) { - sel.apply_to_existing_lines = applyToExistingLines.Checked; - filterCtrl.RefreshObject(sel); - needs_save_ = true; - on_save(); - } - } - private void addFilter_Click(object sender, EventArgs e) { if (view_ == null) { Debug.Assert(false); return; } - var row = new raw_filter_row(filterBox.Text, applyToExistingLines.Checked); + var row = new raw_filter_row(filterBox.Text); if (!row.is_valid) { status.set_status("Failed to save the filter. Please check the syntax!", status_ctrl.status_type.err, 1000); return; } if (sel < 0) { - var new_ui = new ui_filter { enabled = true, text = filterBox.Text, apply_to_existing_lines = applyToExistingLines.Checked }; + var new_ui = new ui_filter { enabled = true, text = filterBox.Text }; var new_ = new filter_item(new_ui); view_.filters.Add(new_ui); @@ -674,7 +648,7 @@ private void moveToBottomToolStripMenuItem_Click(object sender, EventArgs e) { private void save_if_user_left() { if (needs_save_) { var focus = win32.focused_ctrl(); - bool is_ours = focus == filterBox || focus == applyToExistingLines || focus == filterCtrl || focus == addFilter || focus == delFilter; + bool is_ours = focus == filterBox || focus == filterCtrl || focus == addFilter || focus == delFilter; if (!is_ours) { needs_save_ = false; on_save(); @@ -693,11 +667,6 @@ private void filter_ctrl_SizeChanged(object sender, EventArgs e) { logger.Info("filter pane =" + Width + " x" + Height); } - private void applyToExistingLines_Leave(object sender, EventArgs e) { - if (needs_save_) - util.postpone(save_if_user_left, 10); - } - private void filterCtrl_Leave(object sender, EventArgs e) { if (needs_save_) util.postpone(save_if_user_left, 10); @@ -742,10 +711,10 @@ private void filterCtrl_CellClick(object sender, BrightIdeasSoftware.CellClickEv } - public void update_filter_row(string id, string filter_str, bool apply_to_existing_lines) { + public void update_filter_row(string id, string filter_str) { bool updated = false; bool was_selected = false; - string unique_id = new raw_filter_row(filter_str, apply_to_existing_lines).unique_id; + string unique_id = new raw_filter_row(filter_str).unique_id; for (int idx = 0; idx < filterCtrl.GetItemCount(); ++idx) { var i = filterCtrl.GetItem(idx).RowObject as filter_item; bool is_same = i.filter_id == id; @@ -763,7 +732,7 @@ public void update_filter_row(string id, string filter_str, bool apply_to_existi if (!updated) { // new filter - ui_filter new_ui = new ui_filter { enabled = true, text = filter_str, apply_to_existing_lines = apply_to_existing_lines }; + ui_filter new_ui = new ui_filter { enabled = true, text = filter_str }; filter_item new_ = new filter_item(new_ui); view_.filters.Add(new_ui); @@ -833,7 +802,7 @@ private void update_color(OLVListItem olv_row) { bg = app.inst.bg; } else { filter_item i = olv_row.RowObject as filter_item; - var row = new raw_filter_row(i.text, i.apply_to_existing_lines); + var row = new raw_filter_row(i.text); fg = row.fg; bg = row.bg; diff --git a/src/lw_common/ui/filter_ctrl.resx b/src/lw_common/ui/filter_ctrl.resx index 44e4fe9..296abc3 100644 --- a/src/lw_common/ui/filter_ctrl.resx +++ b/src/lw_common/ui/filter_ctrl.resx @@ -121,6 +121,6 @@ 17, 17 - 465, 17 + 83, 17 \ No newline at end of file diff --git a/src/lw_common/ui/log_view/log_view.cs b/src/lw_common/ui/log_view/log_view.cs index 0320afe..fb8ae8b 100644 --- a/src/lw_common/ui/log_view/log_view.cs +++ b/src/lw_common/ui/log_view/log_view.cs @@ -42,6 +42,7 @@ public partial class log_view : UserControl, IDisposable { public const string ALL_VIEWS = "__all_views__"; private Form parent; + public status_ctrl status { get; set; } private readonly filter filter_; private log_reader log_ = null; @@ -119,7 +120,10 @@ public log_view(Form parent, string name) { Debug.Assert(parent is log_view_parent); logger.Debug("new log view " + name); - filter_ = new filter(this.create_match_object) { on_change = on_change }; + filter_ = new filter(this.create_match_object) { + on_change = on_change, + status = status + }; InitializeComponent(); this.parent = parent; @@ -463,10 +467,6 @@ public string search_status { } } - public void rerun_filters() { - model_.reapply_quick_filter(); - } - private filter.match create_match_object(BitArray matches, font_info font, line line, int line_idx) { return is_full_log ? new full_log_match_item(matches, font, line, line_idx, this) : new match_item(matches, font, line, line_idx, this); } @@ -1249,6 +1249,7 @@ public void refresh() { lv_parent.after_set_filter_update(); } + list.UpdateVirtualListSize(); list.Refresh(); if (needs_scroll_ && more_items && !needs_ui_update) go_last(); diff --git a/src/lw_common/ui/log_view/log_view_parent.cs b/src/lw_common/ui/log_view/log_view_parent.cs index bf377ac..f17900d 100644 --- a/src/lw_common/ui/log_view/log_view_parent.cs +++ b/src/lw_common/ui/log_view/log_view_parent.cs @@ -55,7 +55,7 @@ public interface log_view_parent { void simple_action(log_view_right_click.simple_action simple); - void add_or_edit_filter(string filter_str, string filter_id, bool apply_to_existing_lines); + void add_or_edit_filter(string filter_str, string filter_id); // called after we've searched to something (thus, changed the current line) void sel_changed(log_view_sel_change_type change); diff --git a/src/lw_common/ui/log_view/log_view_right_click.cs b/src/lw_common/ui/log_view/log_view_right_click.cs index ab25696..b657e2d 100644 --- a/src/lw_common/ui/log_view/log_view_right_click.cs +++ b/src/lw_common/ui/log_view/log_view_right_click.cs @@ -127,11 +127,6 @@ private void append_filter_include_actions(List actions) { // at this time (1.2), we only care about filtering the message column return; - bool does_belong_to_view = parent_.sel.has_matches_via_include(parent_.filter) ; - bool allow_include = parent_.is_full_log || !parent_.filter.has_include_filters || !does_belong_to_view; - if (!allow_include) - return; - // if this is a view with no filters so far, append ONLY to the "Include" message bool is_only = !parent_.is_full_log && parent_.filter.row_count == 0; string only = is_only ? "ONLY " : ""; @@ -161,11 +156,6 @@ private void append_current_view_filter_actions(List actions) { if (parent_.sel_col_idx != parent_.msgCol.fixed_index()) // at this time (1.2), we only care about filtering the message column return; - // 1.4.2 - allow excluding lines: this should work at all times - if it's matched by the filter, - // or i don't have any include filters (thus, by default, all lines are included) - bool belongs_to_view = parent_.sel.has_matches_via_include(parent_.filter); - if (!belongs_to_view) - return; bool sel_at_start = parent_.sel_subitem_text.StartsWith(sel); if (sel_at_start) { @@ -253,21 +243,6 @@ private void append_filter_actions(List actions) { append_filter_include_actions(actions); append_current_view_filter_actions(actions); } - - if (!parent_.is_full_log) { - // 1.7.2+ - if we don't have any filter selected, allow color filters - //bool belongs_to_view = parent_.sel.matches.Count > 0; - bool belongs_to_view = parent_.sel.has_matches_via_include(parent_.filter); - if (belongs_to_view) { - var i = parent_.sel; - Debug.Assert(i != null); - bool is_default = i.match.font.fg == font_info.default_font.fg; - if (is_default) - append_filter_create_actions(actions); - else - append_filter_existing_actions(actions); - } - } } else append_filter_disabled_actions(actions); @@ -504,11 +479,7 @@ private void do_add_filter(string filter_str, string filter_description, bool is string id = easy_filter_prefix(is_color_filter, is_include_lines_filter, is_exclude_lines_filter); filter_str = id + "\r\n## " + filter_description + "\r\n" + filter_str; - bool apply_to_existing_lines = is_color_filter || is_exclude_lines_filter; - if (is_include_lines_filter) - apply_to_existing_lines = false; - - parent_.lv_parent.add_or_edit_filter(filter_str, id, apply_to_existing_lines); + parent_.lv_parent.add_or_edit_filter(filter_str, id); } // this is an easy way for me to later find the filter - in case it needs changing diff --git a/src/lw_common/ui/log_view/match/log_view_data_source.cs b/src/lw_common/ui/log_view/match/log_view_data_source.cs index d5c5da3..c0d6246 100644 --- a/src/lw_common/ui/log_view/match/log_view_data_source.cs +++ b/src/lw_common/ui/log_view/match/log_view_data_source.cs @@ -79,7 +79,7 @@ internal class log_view_data_source : AbstractVirtualListDataSource, IDisposable public log_view_data_source(VirtualObjectListView lv, log_view parent ) : base(lv) { lv_ = lv; parent_ = parent; - items_ = parent.filter.matches ; + items_ = parent.filter.matches; change_event_.current_thread_is_owner(); new Thread(update_filter_thread) {IsBackground = true}.Start(); @@ -172,10 +172,10 @@ internal match_item item_at(int idx) { if (!is_filtering) { // not filtered if ( !show_full_log) - return items_.match_at(idx) as match_item; + return items_[idx] as match_item; // it's showing all items - however, if item is in current view as well, preserve it (color and everything) - var i = full_log_items.match_at(idx) as match_item; + var i = full_log_items[idx] as match_item; if (items_.binary_search(i.line_idx).Item1 is match_item in_cur_view) i = in_cur_view; return i; @@ -194,6 +194,7 @@ internal match_item item_at(int idx) { // we prefer finding from the current view - so we actually preserve colors and such var found_in_items = items_.binary_search(line_index).Item1; var found = found_in_items ?? full_log_items.binary_search(line_index).Item1; + Debug.WriteLine(found.line.part(info_type.msg)); return found as match_item; } @@ -337,11 +338,11 @@ private void run_filter(bool run_on_full_log) { for (int idx = 0; idx < count; ++idx) { match_item i; if (!run_on_full_log) - i = items.match_at(idx) as match_item; + i = items[idx] as match_item; else { // at this point - we're run on the full log - however, if we find an item that exists in current view, use that // (so that we can reference the matches) - i = items.match_at(idx) as match_item; + i = items[idx] as match_item; var in_cur_view = items_.binary_search(i.line_idx).Item1 as match_item; if (in_cur_view != null) i = in_cur_view; diff --git a/src/lw_common/ui/note_ctrl.cs b/src/lw_common/ui/note_ctrl.cs index 8db1991..9f5c6b8 100644 --- a/src/lw_common/ui/note_ctrl.cs +++ b/src/lw_common/ui/note_ctrl.cs @@ -398,9 +398,7 @@ public Color line_fg { private int ignore_change_ = 0; - private line cur_line { - get { return lines_[cur_line_id_]; } - } + private line cur_line => lines_[cur_line_id_]; private bool dirty_ = false; diff --git a/src/lw_common/ui/search/search_for.cs b/src/lw_common/ui/search/search_for.cs index 6783ae7..59145ba 100644 --- a/src/lw_common/ui/search/search_for.cs +++ b/src/lw_common/ui/search/search_for.cs @@ -171,14 +171,12 @@ public class filter_info { // the filter itself public readonly string text ; public readonly string id ; - public readonly bool apply_to_existing_lines ; public readonly Color fg, bg; - public filter_info(string text, string id, bool apply_to_existing_lines, Color fg, Color bg) { + public filter_info(string text, string id, Color fg, Color bg) { this.text = text; this.id = id; - this.apply_to_existing_lines = apply_to_existing_lines; this.fg = fg; this.bg = bg; } @@ -216,7 +214,7 @@ public filter_info to_filter() { filter_str += "match_color " + util.color_to_str(fg) + " " + (bg != util.transparent ? util.color_to_str(bg) : "") + "\r\n"; bool apply_to_existing_lines = is_color_filter || is_exclude_filter; - return new filter_info(filter_str, id, apply_to_existing_lines, fg, bg); + return new filter_info(filter_str, id, fg, bg); } diff --git a/src/lw_common/ui_helpers/log_wizard_serializable_classes.cs b/src/lw_common/ui_helpers/log_wizard_serializable_classes.cs index 39f6925..34a6757 100644 --- a/src/lw_common/ui_helpers/log_wizard_serializable_classes.cs +++ b/src/lw_common/ui_helpers/log_wizard_serializable_classes.cs @@ -36,12 +36,9 @@ public class ui_filter { // if true, it's enabled public bool enabled = true; - public bool apply_to_existing_lines = false; - internal void load_save(bool load, string prefix) { app.load_save(load, ref text, prefix + "text"); app.load_save(load, ref enabled, prefix + "enabled", true); - app.load_save(load, ref apply_to_existing_lines,prefix + "apply_to_existing_lines", false); } public void load(string prefix) { diff --git a/src/lw_common/util/util.cs b/src/lw_common/util/util.cs index 02c9241..51e3393 100644 --- a/src/lw_common/util/util.cs +++ b/src/lw_common/util/util.cs @@ -739,7 +739,7 @@ public static Encoding file_encoding(FileStream file) { byte[] buff = new byte[len]; file.Read(buff, 0, (int) len); - var detected = EncodingTools.DetectInputCodepage(buff); + var detected = EncodingTools.DetectInputCodepage(buff) as Encoding; if (!detected.Equals(Encoding.Default) && !detected.Equals(Encoding.ASCII)) return detected; diff --git a/src/ui/log_wizard.cs b/src/ui/log_wizard.cs index 405ab4c..32b5c43 100644 --- a/src/ui/log_wizard.cs +++ b/src/ui/log_wizard.cs @@ -122,10 +122,12 @@ public log_wizard() { ++ignore_change_; - full_log_ctrl_ = new log_view(this, log_view.FULLLOG_NAME); - full_log_ctrl_.Dock = DockStyle.Fill; + full_log_ctrl_ = new log_view(this, log_view.FULLLOG_NAME) { + Dock = DockStyle.Fill, + show_name = false, + status = status + }; filteredLeft.Panel2.Controls.Add(full_log_ctrl_); - full_log_ctrl_.show_name = false; full_log_ctrl_.show_view(true); filtCtrl.status = status; @@ -134,9 +136,8 @@ public log_wizard() { filtCtrl.ui_to_view = (view_idx) => log_view_for_tab(view_idx).set_filter(filtCtrl.to_filter_row_list()); filtCtrl.on_rerun_view = (view_idx) => refreshToolStripMenuItem1_Click(null, null); filtCtrl.on_refresh_view = (view_idx) => { - log_view_for_tab(view_idx).rerun_filters(); - log_view_for_tab(view_idx).Refresh(); - full_log.list.Refresh(); + log_view_for_tab(view_idx).refresh(); + full_log.refresh(); }; filtCtrl.mark_match = (filter_idx) => { var lv = log_view_for_tab(viewsTab.SelectedIndex); @@ -1131,8 +1132,8 @@ public void simple_action(log_view_right_click.simple_action simple) { } } - public void add_or_edit_filter(string filter_str, string filter_id, bool apply_to_existing_lines) { - filtCtrl.update_filter_row(filter_id, filter_str, apply_to_existing_lines); + public void add_or_edit_filter(string filter_str, string filter_id) { + filtCtrl.update_filter_row(filter_id, filter_str); last_edited_filter_id_ = filter_id; selected_view().clear_edit(); selected_view().update_edit(); @@ -1572,7 +1573,7 @@ private void update_non_active_filter(int idx) { ui_context ctx = cur_context(); List lvf = new List(); foreach (ui_filter filt in ctx.views[idx].filters) { - var row = new raw_filter_row(filt.text, filt.apply_to_existing_lines) { enabled = filt.enabled }; + var row = new raw_filter_row(filt.text) { enabled = filt.enabled }; if (row.is_valid) lvf.Add(row); } @@ -2565,7 +2566,7 @@ private void handle_action(action_type action) { if (searcher.wants_to_filter) { var filt = searcher.search.to_filter(); - add_or_edit_filter(filt.text, filt.id, filt.apply_to_existing_lines); + add_or_edit_filter(filt.text, filt.id); } else { lv.set_search_for_text(searcher.search); lv.search_for_text_first();