diff --git a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs index 3bf109669..017e51706 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs @@ -47,12 +47,12 @@ private void InitializeComponent() this.cbTypeFilter = new System.Windows.Forms.CheckBox(); this.dtpFilterFrom = new System.Windows.Forms.DateTimePicker(); this.lblFilterFrom = new System.Windows.Forms.Label(); - this.cbFilenameFilter = new System.Windows.Forms.CheckBox(); this.lblFilterTo = new System.Windows.Forms.Label(); 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.lblFilenameFilter = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); this.scMain.Panel1.SuspendLayout(); this.scMain.Panel2.SuspendLayout(); @@ -134,6 +134,7 @@ private void InitializeComponent() // gbFilters // resources.ApplyResources(this.gbFilters, "gbFilters"); + this.gbFilters.Controls.Add(this.lblFilenameFilter); this.gbFilters.Controls.Add(this.cbHostFilterSelection); this.gbFilters.Controls.Add(this.btnRemoveFilters); this.gbFilters.Controls.Add(this.btnApplyFilters); @@ -142,7 +143,6 @@ private void InitializeComponent() this.gbFilters.Controls.Add(this.cbTypeFilter); this.gbFilters.Controls.Add(this.dtpFilterFrom); this.gbFilters.Controls.Add(this.lblFilterFrom); - this.gbFilters.Controls.Add(this.cbFilenameFilter); this.gbFilters.Controls.Add(this.lblFilterTo); this.gbFilters.Controls.Add(this.cbDateFilter); this.gbFilters.Controls.Add(this.dtpFilterTo); @@ -200,12 +200,6 @@ private void InitializeComponent() resources.ApplyResources(this.lblFilterFrom, "lblFilterFrom"); this.lblFilterFrom.Name = "lblFilterFrom"; // - // cbFilenameFilter - // - resources.ApplyResources(this.cbFilenameFilter, "cbFilenameFilter"); - this.cbFilenameFilter.Name = "cbFilenameFilter"; - this.cbFilenameFilter.UseVisualStyleBackColor = true; - // // lblFilterTo // resources.ApplyResources(this.lblFilterTo, "lblFilterTo"); @@ -226,7 +220,6 @@ private void InitializeComponent() // resources.ApplyResources(this.txtFilenameFilter, "txtFilenameFilter"); this.txtFilenameFilter.Name = "txtFilenameFilter"; - this.txtFilenameFilter.TextChanged += new System.EventHandler(this.txtFilenameFilter_TextChanged); // // cbFilenameFilterMethod // @@ -240,6 +233,11 @@ private void InitializeComponent() resources.ApplyResources(this.cbFilenameFilterMethod, "cbFilenameFilterMethod"); this.cbFilenameFilterMethod.Name = "cbFilenameFilterMethod"; // + // lblFilenameFilter + // + resources.ApplyResources(this.lblFilenameFilter, "lblFilenameFilter"); + this.lblFilenameFilter.Name = "lblFilenameFilter"; + // // HistoryForm // resources.ApplyResources(this, "$this"); @@ -281,11 +279,11 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbTypeFilter; private System.Windows.Forms.DateTimePicker dtpFilterFrom; private System.Windows.Forms.Label lblFilterFrom; - private System.Windows.Forms.CheckBox cbFilenameFilter; private System.Windows.Forms.Label lblFilterTo; 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; } } \ No newline at end of file diff --git a/ShareX.HistoryLib/Forms/HistoryForm.cs b/ShareX.HistoryLib/Forms/HistoryForm.cs index 3057a146c..a1ea96264 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.cs @@ -119,7 +119,7 @@ private void ApplyFiltersAndAdd() private HistoryItem[] ApplyFilters(HistoryItem[] historyItems) { - if (!cbTypeFilter.Checked && !cbHostFilter.Checked && !cbFilenameFilter.Checked && !cbDateFilter.Checked) + if (!cbTypeFilter.Checked && !cbHostFilter.Checked && string.IsNullOrEmpty(txtFilenameFilter.Text) && !cbDateFilter.Checked) { return historyItems; } @@ -146,13 +146,13 @@ private HistoryItem[] ApplyFilters(HistoryItem[] historyItems) } } - if (cbFilenameFilter.Checked) + if (!string.IsNullOrEmpty(txtFilenameFilter.Text)) { string filenameFilter = txtFilenameFilter.Text; if (!string.IsNullOrEmpty(filenameFilter)) { - StringComparison filenameRule = StringComparison.CurrentCultureIgnoreCase; + StringComparison filenameRule = StringComparison.InvariantCultureIgnoreCase; switch (cbFilenameFilterMethod.SelectedIndex) { @@ -411,11 +411,6 @@ private void lvHistory_ItemDrag(object sender, ItemDragEventArgs e) } } - private void txtFilenameFilter_TextChanged(object sender, EventArgs e) - { - cbFilenameFilter.Checked = txtFilenameFilter.TextLength > 0; - } - #endregion Form events } } \ No newline at end of file diff --git a/ShareX.HistoryLib/Forms/HistoryForm.resx b/ShareX.HistoryLib/Forms/HistoryForm.resx index 81dd2263d..ca83c2d83 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.resx +++ b/ShareX.HistoryLib/Forms/HistoryForm.resx @@ -166,7 +166,7 @@ lvHistory - ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=12.3.0.0, Culture=neutral, PublicKeyToken=null scMain.Panel1 @@ -205,7 +205,7 @@ pbThumbnail - ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=12.3.0.0, Culture=neutral, PublicKeyToken=null panel1 @@ -216,6 +216,33 @@ Bottom, Left, Right + + True + + + 13, 24 + + + 74, 13 + + + 17 + + + Filename filter: + + + lblFilenameFilter + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFilters + + + 0 + 168, 176 @@ -235,7 +262,7 @@ gbFilters - 0 + 1 NoControl @@ -262,7 +289,7 @@ gbFilters - 1 + 2 NoControl @@ -289,7 +316,7 @@ gbFilters - 2 + 3 168, 150 @@ -310,7 +337,7 @@ gbFilters - 3 + 4 True @@ -340,7 +367,7 @@ gbFilters - 4 + 5 True @@ -370,10 +397,10 @@ gbFilters - 5 + 6 - 88, 46 + 88, 94 224, 20 @@ -391,7 +418,7 @@ gbFilters - 6 + 7 True @@ -400,7 +427,7 @@ NoControl - 13, 50 + 13, 98 33, 13 @@ -421,36 +448,6 @@ gbFilters - 7 - - - True - - - NoControl - - - 16, 96 - - - 93, 17 - - - 5 - - - Filename filter: - - - cbFilenameFilter - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - 8 @@ -460,7 +457,7 @@ NoControl - 13, 74 + 13, 122 23, 13 @@ -490,7 +487,7 @@ NoControl - 16, 24 + 16, 72 74, 17 @@ -514,7 +511,7 @@ 10 - 88, 70 + 88, 118 224, 20 @@ -535,7 +532,7 @@ 11 - 16, 121 + 16, 46 296, 20 @@ -568,7 +565,7 @@ Exact match - 168, 96 + 168, 20 144, 21 @@ -667,7 +664,7 @@ scMain - ShareX.HelpersLib.SplitContainerCustomSplitter, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + ShareX.HelpersLib.SplitContainerCustomSplitter, ShareX.HelpersLib, Version=12.3.0.0, Culture=neutral, PublicKeyToken=null $this diff --git a/ShareX.HistoryLib/Forms/ImageHistoryForm.cs b/ShareX.HistoryLib/Forms/ImageHistoryForm.cs index 3d9fb659f..b61fe614f 100644 --- a/ShareX.HistoryLib/Forms/ImageHistoryForm.cs +++ b/ShareX.HistoryLib/Forms/ImageHistoryForm.cs @@ -112,7 +112,7 @@ private IEnumerable GetHistoryItems() HistoryItem hi = historyItems[i]; if (!string.IsNullOrEmpty(hi.Filepath) && Helpers.IsImageFile(hi.Filepath) && - (string.IsNullOrEmpty(SearchText) || Helpers.GetFilenameSafe(hi.Filepath).Contains(SearchText, StringComparison.InvariantCultureIgnoreCase))) + (string.IsNullOrEmpty(SearchText) || hi.Filename.Contains(SearchText, StringComparison.InvariantCultureIgnoreCase))) { filteredHistoryItems.Add(hi);