Added history settings form

This commit is contained in:
Jaex 2021-07-25 07:17:10 +03:00
parent 5927686e24
commit 6b5a055084
10 changed files with 490 additions and 200 deletions

View file

@ -30,15 +30,21 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HistoryForm));
this.scMain = new ShareX.HelpersLib.SplitContainerCustomSplitter();
this.tscHistory = new System.Windows.Forms.ToolStripContainer();
this.lvHistory = new ShareX.HelpersLib.MyListView();
this.chIcon = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chDateTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chFilename = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chURL = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.nudMaxItemCount = new System.Windows.Forms.NumericUpDown();
this.tssHistory = new System.Windows.Forms.ToolStrip();
this.tslSearch = new System.Windows.Forms.ToolStripLabel();
this.tstbSearch = new System.Windows.Forms.ToolStripTextBox();
this.tsbSearch = new System.Windows.Forms.ToolStripButton();
this.tss1 = new System.Windows.Forms.ToolStripSeparator();
this.tsbSettings = new System.Windows.Forms.ToolStripButton();
this.scMain = new ShareX.HelpersLib.SplitContainerCustomSplitter();
this.btnCopyStats = new System.Windows.Forms.Button();
this.pbThumbnail = new ShareX.HelpersLib.MyPictureBox();
this.lblMaxItemCount = new System.Windows.Forms.Label();
this.gbFilters = new System.Windows.Forms.GroupBox();
this.lblURLFilter = new System.Windows.Forms.Label();
this.txtURLFilter = new System.Windows.Forms.TextBox();
@ -55,44 +61,30 @@ 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.tscHistory = new System.Windows.Forms.ToolStripContainer();
this.tssHistory = new System.Windows.Forms.ToolStrip();
this.tslSearch = new System.Windows.Forms.ToolStripLabel();
this.tstbSearch = new System.Windows.Forms.ToolStripTextBox();
this.tsbSearch = new System.Windows.Forms.ToolStripButton();
this.btnCopyStats = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout();
this.scMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudMaxItemCount)).BeginInit();
this.gbFilters.SuspendLayout();
this.tscHistory.ContentPanel.SuspendLayout();
this.tscHistory.TopToolStripPanel.SuspendLayout();
this.tscHistory.SuspendLayout();
this.tssHistory.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout();
this.scMain.SuspendLayout();
this.gbFilters.SuspendLayout();
this.SuspendLayout();
//
// scMain
// tscHistory
//
resources.ApplyResources(this.scMain, "scMain");
this.scMain.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.scMain.Name = "scMain";
//
// scMain.Panel1
// tscHistory.ContentPanel
//
this.scMain.Panel1.Controls.Add(this.tscHistory);
this.tscHistory.ContentPanel.Controls.Add(this.lvHistory);
resources.ApplyResources(this.tscHistory.ContentPanel, "tscHistory.ContentPanel");
resources.ApplyResources(this.tscHistory, "tscHistory");
this.tscHistory.Name = "tscHistory";
//
// scMain.Panel2
// tscHistory.TopToolStripPanel
//
this.scMain.Panel2.Controls.Add(this.btnCopyStats);
this.scMain.Panel2.Controls.Add(this.nudMaxItemCount);
this.scMain.Panel2.Controls.Add(this.pbThumbnail);
this.scMain.Panel2.Controls.Add(this.lblMaxItemCount);
this.scMain.Panel2.Controls.Add(this.gbFilters);
this.scMain.SplitterColor = System.Drawing.Color.White;
this.scMain.SplitterLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(189)))), ((int)(((byte)(189)))));
this.scMain.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.scMain_SplitterMoved);
this.tscHistory.TopToolStripPanel.Controls.Add(this.tssHistory);
//
// lvHistory
//
@ -131,16 +123,76 @@ private void InitializeComponent()
//
resources.ApplyResources(this.chURL, "chURL");
//
// nudMaxItemCount
// tssHistory
//
resources.ApplyResources(this.nudMaxItemCount, "nudMaxItemCount");
this.nudMaxItemCount.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.nudMaxItemCount.Name = "nudMaxItemCount";
this.nudMaxItemCount.ValueChanged += new System.EventHandler(this.nudMaxItemCount_ValueChanged);
resources.ApplyResources(this.tssHistory, "tssHistory");
this.tssHistory.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tssHistory.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tslSearch,
this.tstbSearch,
this.tsbSearch,
this.tss1,
this.tsbSettings});
this.tssHistory.Name = "tssHistory";
this.tssHistory.ShowItemToolTips = false;
//
// tslSearch
//
this.tslSearch.Name = "tslSearch";
resources.ApplyResources(this.tslSearch, "tslSearch");
//
// tstbSearch
//
this.tstbSearch.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
resources.ApplyResources(this.tstbSearch, "tstbSearch");
this.tstbSearch.Name = "tstbSearch";
this.tstbSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tstbSearch_KeyDown);
//
// tsbSearch
//
this.tsbSearch.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSearch.Image = global::ShareX.HistoryLib.Properties.Resources.magnifier;
resources.ApplyResources(this.tsbSearch, "tsbSearch");
this.tsbSearch.Name = "tsbSearch";
this.tsbSearch.Click += new System.EventHandler(this.tsbSearch_Click);
//
// tss1
//
this.tss1.Name = "tss1";
resources.ApplyResources(this.tss1, "tss1");
//
// tsbSettings
//
this.tsbSettings.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
resources.ApplyResources(this.tsbSettings, "tsbSettings");
this.tsbSettings.Name = "tsbSettings";
this.tsbSettings.Click += new System.EventHandler(this.tsbSettings_Click);
//
// scMain
//
resources.ApplyResources(this.scMain, "scMain");
this.scMain.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.scMain.Name = "scMain";
//
// scMain.Panel1
//
this.scMain.Panel1.Controls.Add(this.tscHistory);
//
// scMain.Panel2
//
this.scMain.Panel2.Controls.Add(this.btnCopyStats);
this.scMain.Panel2.Controls.Add(this.pbThumbnail);
this.scMain.Panel2.Controls.Add(this.gbFilters);
this.scMain.SplitterColor = System.Drawing.Color.White;
this.scMain.SplitterLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(189)))), ((int)(((byte)(189)))));
this.scMain.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.scMain_SplitterMoved);
//
// btnCopyStats
//
resources.ApplyResources(this.btnCopyStats, "btnCopyStats");
this.btnCopyStats.Name = "btnCopyStats";
this.btnCopyStats.UseVisualStyleBackColor = true;
this.btnCopyStats.Click += new System.EventHandler(this.btnCopyStats_Click);
//
// pbThumbnail
//
@ -153,11 +205,6 @@ private void InitializeComponent()
this.pbThumbnail.PictureBoxBackColor = System.Drawing.SystemColors.Control;
this.pbThumbnail.ShowImageSizeLabel = true;
//
// lblMaxItemCount
//
resources.ApplyResources(this.lblMaxItemCount, "lblMaxItemCount");
this.lblMaxItemCount.Name = "lblMaxItemCount";
//
// gbFilters
//
resources.ApplyResources(this.gbFilters, "gbFilters");
@ -266,58 +313,6 @@ private void InitializeComponent()
this.txtFilenameFilter.Name = "txtFilenameFilter";
this.txtFilenameFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtFilenameFilter_KeyDown);
//
// tscHistory
//
//
// tscHistory.ContentPanel
//
this.tscHistory.ContentPanel.Controls.Add(this.lvHistory);
resources.ApplyResources(this.tscHistory.ContentPanel, "tscHistory.ContentPanel");
resources.ApplyResources(this.tscHistory, "tscHistory");
this.tscHistory.Name = "tscHistory";
//
// tscHistory.TopToolStripPanel
//
this.tscHistory.TopToolStripPanel.Controls.Add(this.tssHistory);
//
// tssHistory
//
resources.ApplyResources(this.tssHistory, "tssHistory");
this.tssHistory.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tssHistory.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tslSearch,
this.tstbSearch,
this.tsbSearch});
this.tssHistory.Name = "tssHistory";
this.tssHistory.ShowItemToolTips = false;
//
// tslSearch
//
this.tslSearch.Name = "tslSearch";
resources.ApplyResources(this.tslSearch, "tslSearch");
//
// tstbSearch
//
this.tstbSearch.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
resources.ApplyResources(this.tstbSearch, "tstbSearch");
this.tstbSearch.Name = "tstbSearch";
this.tstbSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tstbSearch_KeyDown);
//
// tsbSearch
//
this.tsbSearch.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSearch.Image = global::ShareX.HistoryLib.Properties.Resources.magnifier;
resources.ApplyResources(this.tsbSearch, "tsbSearch");
this.tsbSearch.Name = "tsbSearch";
this.tsbSearch.Click += new System.EventHandler(this.tsbSearch_Click);
//
// btnCopyStats
//
resources.ApplyResources(this.btnCopyStats, "btnCopyStats");
this.btnCopyStats.Name = "btnCopyStats";
this.btnCopyStats.UseVisualStyleBackColor = true;
this.btnCopyStats.Click += new System.EventHandler(this.btnCopyStats_Click);
//
// HistoryForm
//
resources.ApplyResources(this, "$this");
@ -329,14 +324,6 @@ private void InitializeComponent()
this.Shown += new System.EventHandler(this.HistoryForm_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.HistoryForm_KeyDown);
this.Resize += new System.EventHandler(this.HistoryForm_Resize);
this.scMain.Panel1.ResumeLayout(false);
this.scMain.Panel2.ResumeLayout(false);
this.scMain.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
this.scMain.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.nudMaxItemCount)).EndInit();
this.gbFilters.ResumeLayout(false);
this.gbFilters.PerformLayout();
this.tscHistory.ContentPanel.ResumeLayout(false);
this.tscHistory.TopToolStripPanel.ResumeLayout(false);
this.tscHistory.TopToolStripPanel.PerformLayout();
@ -344,6 +331,12 @@ private void InitializeComponent()
this.tscHistory.PerformLayout();
this.tssHistory.ResumeLayout(false);
this.tssHistory.PerformLayout();
this.scMain.Panel1.ResumeLayout(false);
this.scMain.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
this.scMain.ResumeLayout(false);
this.gbFilters.ResumeLayout(false);
this.gbFilters.PerformLayout();
this.ResumeLayout(false);
}
@ -373,13 +366,13 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblFilenameFilter;
private System.Windows.Forms.Label lblURLFilter;
private System.Windows.Forms.TextBox txtURLFilter;
private System.Windows.Forms.Label lblMaxItemCount;
private System.Windows.Forms.NumericUpDown nudMaxItemCount;
private System.Windows.Forms.ToolStripContainer tscHistory;
private System.Windows.Forms.ToolStrip tssHistory;
private System.Windows.Forms.ToolStripLabel tslSearch;
private System.Windows.Forms.ToolStripTextBox tstbSearch;
private System.Windows.Forms.ToolStripButton tsbSearch;
private System.Windows.Forms.Button btnCopyStats;
private System.Windows.Forms.ToolStripSeparator tss1;
private System.Windows.Forms.ToolStripButton tsbSettings;
}
}

View file

@ -77,8 +77,6 @@ public HistoryForm(string historyPath, HistorySettings settings, Action<string>
scMain.SplitterDistance = Settings.SplitterDistance;
}
nudMaxItemCount.SetValue(Settings.MaxItemCount);
ShareXResources.ApplyTheme(this);
Settings.WindowState.AutoHandleFormState(this);
@ -121,7 +119,7 @@ private void ApplyFilterSimple()
{
HistoryFilter filter = new HistoryFilter()
{
FileName = tstbSearch.Text,
Filename = tstbSearch.Text,
MaxItemCount = Settings.MaxItemCount
};
@ -132,7 +130,7 @@ private void ApplyFilterAdvanced()
{
HistoryFilter filter = new HistoryFilter()
{
FileName = txtFilenameFilter.Text,
Filename = txtFilenameFilter.Text,
URL = txtURLFilter.Text,
FilterDate = cbDateFilter.Checked,
FromDate = dtpFilterFrom.Value.Date,
@ -372,6 +370,16 @@ private void tsbSearch_Click(object sender, EventArgs e)
ApplyFilterSimple();
}
private void tsbSettings_Click(object sender, EventArgs e)
{
using (HistorySettingsForm form = new HistorySettingsForm(Settings))
{
form.ShowDialog();
}
RefreshHistoryItems();
}
private void txtFilenameFilter_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
@ -404,11 +412,6 @@ private void btnRemoveFilters_Click(object sender, EventArgs e)
AddHistoryItems(allHistoryItems);
}
private void nudMaxItemCount_ValueChanged(object sender, EventArgs e)
{
Settings.MaxItemCount = (int)nudMaxItemCount.Value;
}
private void btnCopyStats_Click(object sender, EventArgs e)
{
string stats = OutputStats(allHistoryItems);

View file

@ -117,14 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="scMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="scMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;tscHistory.BottomToolStripPanel.Name" xml:space="preserve">
<value>tscHistory.BottomToolStripPanel</value>
</data>
@ -162,9 +154,11 @@
<data name="chURL.Width" type="System.Int32, mscorlib">
<value>230</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="lvHistory.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="lvHistory.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
@ -264,11 +258,23 @@
<data name="tsbSearch.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 22</value>
</data>
<data name="tss1.Size" type="System.Drawing.Size, System.Drawing">
<value>6, 25</value>
</data>
<data name="tsbSettings.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
<data name="tsbSettings.Size" type="System.Drawing.Size, System.Drawing">
<value>62, 22</value>
</data>
<data name="tsbSettings.Text" xml:space="preserve">
<value>Settings...</value>
</data>
<data name="tssHistory.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 0</value>
</data>
<data name="tssHistory.Size" type="System.Drawing.Size, System.Drawing">
<value>373, 25</value>
<value>441, 25</value>
</data>
<data name="tssHistory.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -309,6 +315,12 @@
<data name="&gt;&gt;tscHistory.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="scMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="scMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;scMain.Panel1.Name" xml:space="preserve">
<value>scMain.Panel1</value>
</data>
@ -351,33 +363,6 @@
<data name="&gt;&gt;btnCopyStats.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="nudMaxItemCount.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
</data>
<data name="nudMaxItemCount.Location" type="System.Drawing.Point, System.Drawing">
<value>224, 576</value>
</data>
<data name="nudMaxItemCount.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 20</value>
</data>
<data name="nudMaxItemCount.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="nudMaxItemCount.TextAlign" type="System.Windows.Forms.HorizontalAlignment, System.Windows.Forms">
<value>Center</value>
</data>
<data name="&gt;&gt;nudMaxItemCount.Name" xml:space="preserve">
<value>nudMaxItemCount</value>
</data>
<data name="&gt;&gt;nudMaxItemCount.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;nudMaxItemCount.Parent" xml:space="preserve">
<value>scMain.Panel2</value>
</data>
<data name="&gt;&gt;nudMaxItemCount.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="pbThumbnail.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
</data>
@ -385,7 +370,7 @@
<value>8, 8</value>
</data>
<data name="pbThumbnail.Size" type="System.Drawing.Size, System.Drawing">
<value>400, 352</value>
<value>406, 352</value>
</data>
<data name="pbThumbnail.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@ -400,37 +385,7 @@
<value>scMain.Panel2</value>
</data>
<data name="&gt;&gt;pbThumbnail.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="lblMaxItemCount.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
</data>
<data name="lblMaxItemCount.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblMaxItemCount.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 580</value>
</data>
<data name="lblMaxItemCount.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 13</value>
</data>
<data name="lblMaxItemCount.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="lblMaxItemCount.Text" xml:space="preserve">
<value>Maximum item limit:</value>
</data>
<data name="&gt;&gt;lblMaxItemCount.Name" xml:space="preserve">
<value>lblMaxItemCount</value>
</data>
<data name="&gt;&gt;lblMaxItemCount.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblMaxItemCount.Parent" xml:space="preserve">
<value>scMain.Panel2</value>
</data>
<data name="&gt;&gt;lblMaxItemCount.ZOrder" xml:space="preserve">
<value>3</value>
<value>1</value>
</data>
<data name="gbFilters.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
@ -829,7 +784,7 @@
<value>8, 368</value>
</data>
<data name="gbFilters.Size" type="System.Drawing.Size, System.Drawing">
<value>404, 200</value>
<value>408, 200</value>
</data>
<data name="gbFilters.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
@ -847,7 +802,7 @@
<value>scMain.Panel2</value>
</data>
<data name="&gt;&gt;gbFilters.ZOrder" xml:space="preserve">
<value>4</value>
<value>2</value>
</data>
<data name="&gt;&gt;scMain.Panel2.Name" xml:space="preserve">
<value>scMain.Panel2</value>
@ -948,6 +903,18 @@
<data name="&gt;&gt;tsbSearch.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tss1.Name" xml:space="preserve">
<value>tss1</value>
</data>
<data name="&gt;&gt;tss1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsbSettings.Name" xml:space="preserve">
<value>tsbSettings</value>
</data>
<data name="&gt;&gt;tsbSettings.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>HistoryForm</value>
</data>

View file

@ -0,0 +1,74 @@

namespace ShareX.HistoryLib
{
partial class HistorySettingsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HistorySettingsForm));
this.lblMaximumItemLimit = new System.Windows.Forms.Label();
this.nudMaximumItemLimit = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.nudMaximumItemLimit)).BeginInit();
this.SuspendLayout();
//
// lblMaximumItemLimit
//
resources.ApplyResources(this.lblMaximumItemLimit, "lblMaximumItemLimit");
this.lblMaximumItemLimit.Name = "lblMaximumItemLimit";
//
// nudMaximumItemLimit
//
resources.ApplyResources(this.nudMaximumItemLimit, "nudMaximumItemLimit");
this.nudMaximumItemLimit.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.nudMaximumItemLimit.Name = "nudMaximumItemLimit";
this.nudMaximumItemLimit.ValueChanged += new System.EventHandler(this.nudMaximumItemLimit_ValueChanged);
//
// HistorySettingsForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.nudMaximumItemLimit);
this.Controls.Add(this.lblMaximumItemLimit);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "HistorySettingsForm";
((System.ComponentModel.ISupportInitialize)(this.nudMaximumItemLimit)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblMaximumItemLimit;
private System.Windows.Forms.NumericUpDown nudMaximumItemLimit;
}
}

View file

@ -0,0 +1,50 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2020 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Windows.Forms;
namespace ShareX.HistoryLib
{
public partial class HistorySettingsForm : Form
{
public HistorySettings Settings { get; private set; }
public HistorySettingsForm(HistorySettings settings)
{
InitializeComponent();
ShareXResources.ApplyTheme(this);
Settings = settings;
nudMaximumItemLimit.SetValue(Settings.MaxItemCount);
}
private void nudMaximumItemLimit_ValueChanged(object sender, EventArgs e)
{
Settings.MaxItemCount = (int)nudMaximumItemLimit.Value;
}
}
}

View file

@ -0,0 +1,195 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="lblMaximumItemLimit.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="lblMaximumItemLimit.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 16</value>
</data>
<data name="lblMaximumItemLimit.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 13</value>
</data>
<data name="lblMaximumItemLimit.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="lblMaximumItemLimit.Text" xml:space="preserve">
<value>Maximum item limit:</value>
</data>
<data name="&gt;&gt;lblMaximumItemLimit.Name" xml:space="preserve">
<value>lblMaximumItemLimit</value>
</data>
<data name="&gt;&gt;lblMaximumItemLimit.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblMaximumItemLimit.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;lblMaximumItemLimit.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="nudMaximumItemLimit.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 32</value>
</data>
<data name="nudMaximumItemLimit.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 20</value>
</data>
<data name="nudMaximumItemLimit.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="nudMaximumItemLimit.TextAlign" type="System.Windows.Forms.HorizontalAlignment, System.Windows.Forms">
<value>Center</value>
</data>
<data name="&gt;&gt;nudMaximumItemLimit.Name" xml:space="preserve">
<value>nudMaximumItemLimit</value>
</data>
<data name="&gt;&gt;nudMaximumItemLimit.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;nudMaximumItemLimit.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;nudMaximumItemLimit.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>305, 191</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>ShareX - History settings</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>HistorySettingsForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View file

@ -119,7 +119,6 @@ private void InitializeComponent()
// ImageHistorySettingsForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.SystemColors.Window;
this.Controls.Add(this.cbFilterMissingFiles);

View file

@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="lblViewMode.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 8</value>
<value>13, 16</value>
</data>
<data name="lblViewMode.Size" type="System.Drawing.Size, System.Drawing">
<value>62, 13</value>
@ -150,7 +150,7 @@
<value>True</value>
</data>
<data name="lblThumbnailSize.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 56</value>
<value>13, 64</value>
</data>
<data name="lblThumbnailSize.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 13</value>
@ -177,7 +177,7 @@
<value>True</value>
</data>
<data name="lblMaximumImageLimit.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 104</value>
<value>13, 112</value>
</data>
<data name="lblMaximumImageLimit.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 13</value>
@ -201,7 +201,7 @@
<value>6</value>
</data>
<data name="cbViewMode.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 24</value>
<value>16, 32</value>
</data>
<data name="cbViewMode.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value>
@ -222,7 +222,7 @@
<value>5</value>
</data>
<data name="nudThumbnailSize.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 72</value>
<value>16, 80</value>
</data>
<data name="nudThumbnailSize.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 20</value>
@ -247,7 +247,7 @@
<value>4</value>
</data>
<data name="nudMaximumImageLimit.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 120</value>
<value>16, 128</value>
</data>
<data name="nudMaximumImageLimit.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 20</value>
@ -274,7 +274,7 @@
<value>True</value>
</data>
<data name="lblThumbnailSizeUnit.Location" type="System.Drawing.Point, System.Drawing">
<value>77, 76</value>
<value>85, 84</value>
</data>
<data name="lblThumbnailSizeUnit.Size" type="System.Drawing.Size, System.Drawing">
<value>18, 13</value>
@ -304,7 +304,7 @@
<value>NoControl</value>
</data>
<data name="cbRememberSearchText.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 176</value>
<value>16, 184</value>
</data>
<data name="cbRememberSearchText.Size" type="System.Drawing.Size, System.Drawing">
<value>138, 17</value>
@ -331,7 +331,7 @@
<value>True</value>
</data>
<data name="cbFilterMissingFiles.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 152</value>
<value>16, 160</value>
</data>
<data name="cbFilterMissingFiles.Size" type="System.Drawing.Size, System.Drawing">
<value>106, 17</value>
@ -358,10 +358,10 @@
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
<value>96, 96</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>344, 226</value>
<value>344, 218</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>

View file

@ -33,7 +33,7 @@ namespace ShareX.HistoryLib
{
public class HistoryFilter
{
public string FileName { get; set; }
public string Filename { get; set; }
public string URL { get; set; }
public bool FilterDate { get; set; }
public DateTime FromDate { get; set; }
@ -62,9 +62,9 @@ public IEnumerable<HistoryItem> ApplyFilter(IEnumerable<HistoryItem> historyItem
historyItems = historyItems.Where(x => !string.IsNullOrEmpty(x.Host) && x.Host.Contains(Host, StringComparison.InvariantCultureIgnoreCase));
}
if (!string.IsNullOrEmpty(FileName))
if (!string.IsNullOrEmpty(Filename))
{
string pattern = Regex.Escape(FileName).Replace("\\?", ".").Replace("\\*", ".*");
string pattern = Regex.Escape(Filename).Replace("\\?", ".").Replace("\\*", ".*");
Regex regex = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
historyItems = historyItems.Where(x => (x.FileName != null && regex.IsMatch(x.FileName)) ||
(SearchInTags && x.Tags != null && x.Tags.Any(tag => regex.IsMatch(tag.Value))));

View file

@ -86,6 +86,12 @@
<Compile Include="..\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Forms\HistorySettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\HistorySettingsForm.Designer.cs">
<DependentUpon>HistorySettingsForm.cs</DependentUpon>
</Compile>
<Compile Include="HistoryFilter.cs" />
<Compile Include="HistoryItemManager_ContextMenu.cs" />
<Compile Include="Forms\ImageHistoryForm.cs">
@ -247,6 +253,9 @@
<EmbeddedResource Include="Forms\HistoryItemInfoForm.zh-TW.resx">
<DependentUpon>HistoryItemInfoForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\HistorySettingsForm.resx">
<DependentUpon>HistorySettingsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ImageHistoryForm.de.resx">
<DependentUpon>ImageHistoryForm.cs</DependentUpon>
</EmbeddedResource>