diff --git a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs index bf70bf103..ddfd6b571 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs @@ -39,6 +39,8 @@ private void InitializeComponent() this.panel1 = new System.Windows.Forms.Panel(); this.pbThumbnail = new ShareX.HelpersLib.MyPictureBox(); this.gbFilters = new System.Windows.Forms.GroupBox(); + this.lblURLFilter = new System.Windows.Forms.Label(); + this.txtURLFilter = new System.Windows.Forms.TextBox(); this.lblFilenameFilter = new System.Windows.Forms.Label(); this.cbHostFilterSelection = new System.Windows.Forms.ComboBox(); this.btnRemoveFilters = new System.Windows.Forms.Button(); @@ -52,9 +54,6 @@ private void InitializeComponent() this.cbDateFilter = new System.Windows.Forms.CheckBox(); this.dtpFilterTo = new System.Windows.Forms.DateTimePicker(); this.txtFilenameFilter = new System.Windows.Forms.TextBox(); - this.cbFilenameFilterMethod = new System.Windows.Forms.ComboBox(); - this.txtURLFilter = new System.Windows.Forms.TextBox(); - this.lblURLFilter = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); this.scMain.Panel1.SuspendLayout(); this.scMain.Panel2.SuspendLayout(); @@ -151,10 +150,19 @@ private void InitializeComponent() this.gbFilters.Controls.Add(this.cbDateFilter); this.gbFilters.Controls.Add(this.dtpFilterTo); this.gbFilters.Controls.Add(this.txtFilenameFilter); - this.gbFilters.Controls.Add(this.cbFilenameFilterMethod); this.gbFilters.Name = "gbFilters"; this.gbFilters.TabStop = false; // + // lblURLFilter + // + resources.ApplyResources(this.lblURLFilter, "lblURLFilter"); + this.lblURLFilter.Name = "lblURLFilter"; + // + // txtURLFilter + // + resources.ApplyResources(this.txtURLFilter, "txtURLFilter"); + this.txtURLFilter.Name = "txtURLFilter"; + // // lblFilenameFilter // resources.ApplyResources(this.lblFilenameFilter, "lblFilenameFilter"); @@ -230,28 +238,6 @@ private void InitializeComponent() resources.ApplyResources(this.txtFilenameFilter, "txtFilenameFilter"); this.txtFilenameFilter.Name = "txtFilenameFilter"; // - // cbFilenameFilterMethod - // - this.cbFilenameFilterMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbFilenameFilterMethod.FormattingEnabled = true; - this.cbFilenameFilterMethod.Items.AddRange(new object[] { - resources.GetString("cbFilenameFilterMethod.Items"), - resources.GetString("cbFilenameFilterMethod.Items1"), - resources.GetString("cbFilenameFilterMethod.Items2"), - resources.GetString("cbFilenameFilterMethod.Items3")}); - resources.ApplyResources(this.cbFilenameFilterMethod, "cbFilenameFilterMethod"); - this.cbFilenameFilterMethod.Name = "cbFilenameFilterMethod"; - // - // txtURLFilter - // - resources.ApplyResources(this.txtURLFilter, "txtURLFilter"); - this.txtURLFilter.Name = "txtURLFilter"; - // - // lblURLFilter - // - resources.ApplyResources(this.lblURLFilter, "lblURLFilter"); - this.lblURLFilter.Name = "lblURLFilter"; - // // HistoryForm // resources.ApplyResources(this, "$this"); @@ -297,7 +283,6 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbDateFilter; private System.Windows.Forms.DateTimePicker dtpFilterTo; private System.Windows.Forms.TextBox txtFilenameFilter; - private System.Windows.Forms.ComboBox cbFilenameFilterMethod; private System.Windows.Forms.Label lblFilenameFilter; private System.Windows.Forms.Label lblURLFilter; private System.Windows.Forms.TextBox txtURLFilter; diff --git a/ShareX.HistoryLib/Forms/HistoryForm.cs b/ShareX.HistoryLib/Forms/HistoryForm.cs index a8e246be5..f1ce0a688 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.cs @@ -69,7 +69,6 @@ public HistoryForm(string historyPath, HistorySettings settings, Action him.GetHistoryItems += him_GetHistoryItems; pbThumbnail.Reset(); - cbFilenameFilterMethod.SelectedIndex = 0; // Contains lvHistory.FillLastColumn(); if (Settings.SplitterDistance > 0) @@ -150,24 +149,7 @@ private HistoryItem[] ApplyFilters(HistoryItem[] historyItems) if (!string.IsNullOrEmpty(filenameFilter)) { - StringComparison filenameRule = StringComparison.InvariantCultureIgnoreCase; - - switch (cbFilenameFilterMethod.SelectedIndex) - { - default: - case 0: // Contains - result = result.Where(x => x.Filename.Contains(filenameFilter, filenameRule)); - break; - case 1: // Starts with - result = result.Where(x => x.Filename.StartsWith(filenameFilter, filenameRule)); - break; - case 2: // Ends with - result = result.Where(x => x.Filename.EndsWith(filenameFilter, filenameRule)); - break; - case 3: // Exact match - result = result.Where(x => x.Filename.Equals(filenameFilter, filenameRule)); - break; - } + result = result.Where(x => x.Filename != null && x.Filename.Contains(filenameFilter, StringComparison.InvariantCultureIgnoreCase)); } string urlFilter = txtURLFilter.Text; @@ -190,6 +172,8 @@ private HistoryItem[] ApplyFilters(HistoryItem[] historyItems) private void AddHistoryItems(HistoryItem[] historyItems) { + Cursor = Cursors.WaitCursor; + UpdateTitle(historyItems); lvHistory.Items.Clear(); @@ -227,6 +211,8 @@ private void AddHistoryItems(HistoryItem[] historyItems) lvHistory.Items.AddRange(listViewItems); lvHistory.FillLastColumn(); lvHistory.Focus(); + + Cursor = Cursors.Default; } private void UpdateTitle(HistoryItem[] historyItems = null) diff --git a/ShareX.HistoryLib/Forms/HistoryForm.resx b/ShareX.HistoryLib/Forms/HistoryForm.resx index 1d012143f..7219222fa 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.resx +++ b/ShareX.HistoryLib/Forms/HistoryForm.resx @@ -196,7 +196,7 @@ 8, 8 - 408, 352 + 408, 384 3 @@ -220,7 +220,7 @@ True - 13, 203 + 13, 48 32, 13 @@ -244,10 +244,10 @@ 0 - 168, 199 + 96, 44 - 144, 20 + 216, 20 19 @@ -292,7 +292,7 @@ 2 - 168, 174 + 168, 168 144, 21 @@ -316,7 +316,7 @@ NoControl - 168, 232 + 168, 200 144, 24 @@ -343,7 +343,7 @@ NoControl - 16, 232 + 16, 200 144, 24 @@ -367,7 +367,7 @@ 5 - 168, 150 + 168, 142 144, 21 @@ -394,7 +394,7 @@ NoControl - 16, 176 + 16, 170 51, 17 @@ -424,7 +424,7 @@ NoControl - 16, 152 + 16, 144 53, 17 @@ -448,10 +448,10 @@ 8 - 88, 94 + 96, 92 - 224, 20 + 216, 20 2 @@ -475,7 +475,7 @@ NoControl - 13, 98 + 13, 96 33, 13 @@ -505,7 +505,7 @@ NoControl - 13, 122 + 13, 120 23, 13 @@ -559,10 +559,10 @@ 12 - 88, 118 + 96, 116 - 224, 20 + 216, 20 4 @@ -580,10 +580,10 @@ 13 - 16, 46 + 96, 20 - 296, 20 + 216, 20 6 @@ -600,44 +600,11 @@ 14 - - Contains - - - Starts with - - - Ends with - - - Exact match - - - 168, 20 - - - 144, 21 - - - 7 - - - cbFilenameFilterMethod - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 15 - - 8, 368 + 8, 400 - 408, 266 + 408, 234 4