diff --git a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs index 692f7ef6f..d02966c83 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs @@ -30,25 +30,14 @@ 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.pStats = new System.Windows.Forms.Panel(); - this.rtbStats = new System.Windows.Forms.RichTextBox(); - 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.pbThumbnail = new ShareX.HelpersLib.MyPictureBox(); - this.btnShowStats = new System.Windows.Forms.Button(); - this.lblMaxItemCount = new System.Windows.Forms.Label(); - this.gbFilters = new System.Windows.Forms.GroupBox(); + this.tscHistory = new System.Windows.Forms.ToolStripContainer(); + this.gbAdvancedSearch = new System.Windows.Forms.GroupBox(); + this.btnAdvancedSearchReset = new System.Windows.Forms.Button(); + this.btnAdvancedSearch = new System.Windows.Forms.Button(); 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(); - this.btnApplyFilters = new System.Windows.Forms.Button(); this.cbTypeFilterSelection = new System.Windows.Forms.ComboBox(); this.cbHostFilter = new System.Windows.Forms.CheckBox(); this.cbTypeFilter = new System.Windows.Forms.CheckBox(); @@ -58,140 +47,82 @@ 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.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.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.tsbAdvancedSearch = new System.Windows.Forms.ToolStripButton(); + this.tss1 = new System.Windows.Forms.ToolStripSeparator(); + this.tsbCopyStats = new System.Windows.Forms.ToolStripButton(); + this.tss2 = new System.Windows.Forms.ToolStripSeparator(); + this.tsbSettings = new System.Windows.Forms.ToolStripButton(); + this.scMain = new ShareX.HelpersLib.SplitContainerCustomSplitter(); + this.pbThumbnail = new ShareX.HelpersLib.MyPictureBox(); + this.tscHistory.ContentPanel.SuspendLayout(); + this.tscHistory.TopToolStripPanel.SuspendLayout(); + this.tscHistory.SuspendLayout(); + this.gbAdvancedSearch.SuspendLayout(); + this.tssHistory.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); this.scMain.Panel1.SuspendLayout(); this.scMain.Panel2.SuspendLayout(); this.scMain.SuspendLayout(); - this.pStats.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nudMaxItemCount)).BeginInit(); - 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.pStats); - this.scMain.Panel1.Controls.Add(this.lvHistory); + this.tscHistory.ContentPanel.Controls.Add(this.gbAdvancedSearch); + 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.nudMaxItemCount); - this.scMain.Panel2.Controls.Add(this.pbThumbnail); - this.scMain.Panel2.Controls.Add(this.btnShowStats); - 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); // - // pStats + // gbAdvancedSearch // - this.pStats.Controls.Add(this.rtbStats); - resources.ApplyResources(this.pStats, "pStats"); - this.pStats.Name = "pStats"; + this.gbAdvancedSearch.Controls.Add(this.btnAdvancedSearchReset); + this.gbAdvancedSearch.Controls.Add(this.btnAdvancedSearch); + this.gbAdvancedSearch.Controls.Add(this.lblURLFilter); + this.gbAdvancedSearch.Controls.Add(this.txtURLFilter); + this.gbAdvancedSearch.Controls.Add(this.lblFilenameFilter); + this.gbAdvancedSearch.Controls.Add(this.cbHostFilterSelection); + this.gbAdvancedSearch.Controls.Add(this.cbTypeFilterSelection); + this.gbAdvancedSearch.Controls.Add(this.cbHostFilter); + this.gbAdvancedSearch.Controls.Add(this.cbTypeFilter); + this.gbAdvancedSearch.Controls.Add(this.dtpFilterFrom); + this.gbAdvancedSearch.Controls.Add(this.lblFilterFrom); + this.gbAdvancedSearch.Controls.Add(this.lblFilterTo); + this.gbAdvancedSearch.Controls.Add(this.cbDateFilter); + this.gbAdvancedSearch.Controls.Add(this.dtpFilterTo); + this.gbAdvancedSearch.Controls.Add(this.txtFilenameFilter); + resources.ApplyResources(this.gbAdvancedSearch, "gbAdvancedSearch"); + this.gbAdvancedSearch.Name = "gbAdvancedSearch"; + this.gbAdvancedSearch.TabStop = false; // - // rtbStats + // btnAdvancedSearchReset // - this.rtbStats.BorderStyle = System.Windows.Forms.BorderStyle.None; - resources.ApplyResources(this.rtbStats, "rtbStats"); - this.rtbStats.Name = "rtbStats"; + resources.ApplyResources(this.btnAdvancedSearchReset, "btnAdvancedSearchReset"); + this.btnAdvancedSearchReset.Name = "btnAdvancedSearchReset"; + this.btnAdvancedSearchReset.UseVisualStyleBackColor = true; + this.btnAdvancedSearchReset.Click += new System.EventHandler(this.btnAdvancedSearchReset_Click); // - // lvHistory + // btnAdvancedSearch // - this.lvHistory.AllowColumnSort = true; - this.lvHistory.AutoFillColumn = true; - this.lvHistory.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.lvHistory.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.chIcon, - this.chDateTime, - this.chFilename, - this.chURL}); - resources.ApplyResources(this.lvHistory, "lvHistory"); - this.lvHistory.FullRowSelect = true; - this.lvHistory.HideSelection = false; - this.lvHistory.Name = "lvHistory"; - this.lvHistory.UseCompatibleStateImageBehavior = false; - this.lvHistory.View = System.Windows.Forms.View.Details; - this.lvHistory.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.lvHistory_ItemDrag); - this.lvHistory.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.lvHistory_ItemSelectionChanged); - this.lvHistory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvHistory_KeyDown); - this.lvHistory.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvHistory_MouseDoubleClick); - // - // chIcon - // - resources.ApplyResources(this.chIcon, "chIcon"); - // - // chDateTime - // - resources.ApplyResources(this.chDateTime, "chDateTime"); - // - // chFilename - // - resources.ApplyResources(this.chFilename, "chFilename"); - // - // chURL - // - resources.ApplyResources(this.chURL, "chURL"); - // - // nudMaxItemCount - // - 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); - // - // pbThumbnail - // - resources.ApplyResources(this.pbThumbnail, "pbThumbnail"); - this.pbThumbnail.BackColor = System.Drawing.SystemColors.Window; - this.pbThumbnail.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.pbThumbnail.DrawCheckeredBackground = true; - this.pbThumbnail.FullscreenOnClick = true; - this.pbThumbnail.Name = "pbThumbnail"; - this.pbThumbnail.PictureBoxBackColor = System.Drawing.SystemColors.Control; - this.pbThumbnail.ShowImageSizeLabel = true; - // - // btnShowStats - // - resources.ApplyResources(this.btnShowStats, "btnShowStats"); - this.btnShowStats.Name = "btnShowStats"; - this.btnShowStats.UseVisualStyleBackColor = true; - this.btnShowStats.Click += new System.EventHandler(this.BtnShowStats_Click); - // - // lblMaxItemCount - // - resources.ApplyResources(this.lblMaxItemCount, "lblMaxItemCount"); - this.lblMaxItemCount.Name = "lblMaxItemCount"; - // - // gbFilters - // - resources.ApplyResources(this.gbFilters, "gbFilters"); - this.gbFilters.Controls.Add(this.lblURLFilter); - this.gbFilters.Controls.Add(this.txtURLFilter); - this.gbFilters.Controls.Add(this.lblFilenameFilter); - this.gbFilters.Controls.Add(this.cbHostFilterSelection); - this.gbFilters.Controls.Add(this.btnRemoveFilters); - this.gbFilters.Controls.Add(this.btnApplyFilters); - this.gbFilters.Controls.Add(this.cbTypeFilterSelection); - this.gbFilters.Controls.Add(this.cbHostFilter); - this.gbFilters.Controls.Add(this.cbTypeFilter); - this.gbFilters.Controls.Add(this.dtpFilterFrom); - this.gbFilters.Controls.Add(this.lblFilterFrom); - this.gbFilters.Controls.Add(this.lblFilterTo); - this.gbFilters.Controls.Add(this.cbDateFilter); - this.gbFilters.Controls.Add(this.dtpFilterTo); - this.gbFilters.Controls.Add(this.txtFilenameFilter); - this.gbFilters.Name = "gbFilters"; - this.gbFilters.TabStop = false; + resources.ApplyResources(this.btnAdvancedSearch, "btnAdvancedSearch"); + this.btnAdvancedSearch.Name = "btnAdvancedSearch"; + this.btnAdvancedSearch.UseVisualStyleBackColor = true; + this.btnAdvancedSearch.Click += new System.EventHandler(this.btnAdvancedSearch_Click); // // lblURLFilter // @@ -215,20 +146,6 @@ private void InitializeComponent() resources.ApplyResources(this.cbHostFilterSelection, "cbHostFilterSelection"); this.cbHostFilterSelection.Name = "cbHostFilterSelection"; // - // btnRemoveFilters - // - resources.ApplyResources(this.btnRemoveFilters, "btnRemoveFilters"); - this.btnRemoveFilters.Name = "btnRemoveFilters"; - this.btnRemoveFilters.UseVisualStyleBackColor = true; - this.btnRemoveFilters.Click += new System.EventHandler(this.btnRemoveFilters_Click); - // - // btnApplyFilters - // - resources.ApplyResources(this.btnApplyFilters, "btnApplyFilters"); - this.btnApplyFilters.Name = "btnApplyFilters"; - this.btnApplyFilters.UseVisualStyleBackColor = true; - this.btnApplyFilters.Click += new System.EventHandler(this.btnApplyFilters_Click); - // // cbTypeFilterSelection // this.cbTypeFilterSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -280,6 +197,140 @@ private void InitializeComponent() this.txtFilenameFilter.Name = "txtFilenameFilter"; this.txtFilenameFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtFilenameFilter_KeyDown); // + // lvHistory + // + this.lvHistory.AllowColumnSort = true; + this.lvHistory.AutoFillColumn = true; + this.lvHistory.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.lvHistory.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chIcon, + this.chDateTime, + this.chFilename, + this.chURL}); + resources.ApplyResources(this.lvHistory, "lvHistory"); + this.lvHistory.FullRowSelect = true; + this.lvHistory.HideSelection = false; + this.lvHistory.Name = "lvHistory"; + this.lvHistory.UseCompatibleStateImageBehavior = false; + this.lvHistory.View = System.Windows.Forms.View.Details; + this.lvHistory.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.lvHistory_ItemDrag); + this.lvHistory.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.lvHistory_ItemSelectionChanged); + this.lvHistory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvHistory_KeyDown); + this.lvHistory.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvHistory_MouseDoubleClick); + // + // chIcon + // + resources.ApplyResources(this.chIcon, "chIcon"); + // + // chDateTime + // + resources.ApplyResources(this.chDateTime, "chDateTime"); + // + // chFilename + // + resources.ApplyResources(this.chFilename, "chFilename"); + // + // chURL + // + resources.ApplyResources(this.chURL, "chURL"); + // + // 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.tsbAdvancedSearch, + this.tss1, + this.tsbCopyStats, + this.tss2, + this.tsbSettings}); + this.tssHistory.Name = "tssHistory"; + // + // 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); + // + // tsbAdvancedSearch + // + this.tsbAdvancedSearch.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbAdvancedSearch.Image = global::ShareX.HistoryLib.Properties.Resources.magnifier__plus; + resources.ApplyResources(this.tsbAdvancedSearch, "tsbAdvancedSearch"); + this.tsbAdvancedSearch.Name = "tsbAdvancedSearch"; + this.tsbAdvancedSearch.Click += new System.EventHandler(this.tsbAdvancedSearch_Click); + // + // tss1 + // + this.tss1.Name = "tss1"; + resources.ApplyResources(this.tss1, "tss1"); + // + // tsbCopyStats + // + this.tsbCopyStats.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbCopyStats.Image = global::ShareX.HistoryLib.Properties.Resources.clipboard_list; + resources.ApplyResources(this.tsbCopyStats, "tsbCopyStats"); + this.tsbCopyStats.Name = "tsbCopyStats"; + this.tsbCopyStats.Click += new System.EventHandler(this.tsbCopyStats_Click); + // + // tss2 + // + this.tss2.Name = "tss2"; + resources.ApplyResources(this.tss2, "tss2"); + // + // tsbSettings + // + this.tsbSettings.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsbSettings.Image = global::ShareX.HistoryLib.Properties.Resources.gear; + 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.pbThumbnail); + 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); + // + // pbThumbnail + // + resources.ApplyResources(this.pbThumbnail, "pbThumbnail"); + this.pbThumbnail.BackColor = System.Drawing.SystemColors.Window; + this.pbThumbnail.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pbThumbnail.DrawCheckeredBackground = true; + this.pbThumbnail.FullscreenOnClick = true; + this.pbThumbnail.Name = "pbThumbnail"; + this.pbThumbnail.PictureBoxBackColor = System.Drawing.SystemColors.Control; + this.pbThumbnail.ShowImageSizeLabel = true; + // // HistoryForm // resources.ApplyResources(this, "$this"); @@ -291,15 +342,19 @@ 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.tscHistory.ContentPanel.ResumeLayout(false); + this.tscHistory.TopToolStripPanel.ResumeLayout(false); + this.tscHistory.TopToolStripPanel.PerformLayout(); + this.tscHistory.ResumeLayout(false); + this.tscHistory.PerformLayout(); + this.gbAdvancedSearch.ResumeLayout(false); + this.gbAdvancedSearch.PerformLayout(); + this.tssHistory.ResumeLayout(false); + this.tssHistory.PerformLayout(); this.scMain.Panel1.ResumeLayout(false); this.scMain.Panel2.ResumeLayout(false); - this.scMain.Panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit(); this.scMain.ResumeLayout(false); - this.pStats.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.nudMaxItemCount)).EndInit(); - this.gbFilters.ResumeLayout(false); - this.gbFilters.PerformLayout(); this.ResumeLayout(false); } @@ -313,10 +368,8 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader chIcon; private ShareX.HelpersLib.SplitContainerCustomSplitter scMain; private HelpersLib.MyPictureBox pbThumbnail; - private System.Windows.Forms.GroupBox gbFilters; + private System.Windows.Forms.GroupBox gbAdvancedSearch; private System.Windows.Forms.ComboBox cbHostFilterSelection; - private System.Windows.Forms.Button btnRemoveFilters; - private System.Windows.Forms.Button btnApplyFilters; private System.Windows.Forms.ComboBox cbTypeFilterSelection; private System.Windows.Forms.CheckBox cbHostFilter; private System.Windows.Forms.CheckBox cbTypeFilter; @@ -329,10 +382,17 @@ 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.Button btnShowStats; - private System.Windows.Forms.RichTextBox rtbStats; - private System.Windows.Forms.Panel pStats; - 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.ToolStripSeparator tss1; + private System.Windows.Forms.ToolStripButton tsbSettings; + private System.Windows.Forms.ToolStripButton tsbAdvancedSearch; + private System.Windows.Forms.Button btnAdvancedSearch; + private System.Windows.Forms.Button btnAdvancedSearchReset; + private System.Windows.Forms.ToolStripButton tsbCopyStats; + private System.Windows.Forms.ToolStripSeparator tss2; } } \ No newline at end of file diff --git a/ShareX.HistoryLib/Forms/HistoryForm.cs b/ShareX.HistoryLib/Forms/HistoryForm.cs index 6025d2541..fdce2954d 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.cs @@ -30,7 +30,6 @@ using System.IO; using System.Linq; using System.Text; -using System.Text.RegularExpressions; using System.Windows.Forms; namespace ShareX.HistoryLib @@ -39,13 +38,11 @@ public partial class HistoryForm : Form { public string HistoryPath { get; private set; } public HistorySettings Settings { get; private set; } - public bool SearchInTags { get; set; } = true; private HistoryManager history; private HistoryItemManager him; private HistoryItem[] allHistoryItems; private string defaultTitle; - private bool showingStats; public HistoryForm(string historyPath, HistorySettings settings, Action uploadFile = null, Action editImage = null) { @@ -80,72 +77,32 @@ public HistoryForm(string historyPath, HistorySettings settings, Action scMain.SplitterDistance = Settings.SplitterDistance; } - nudMaxItemCount.SetValue(Settings.MaxItemCount); - ShareXResources.ApplyTheme(this); Settings.WindowState.AutoHandleFormState(this); } - private void RefreshHistoryItems() + private void ResetFilters() { - allHistoryItems = GetHistoryItems(); - ApplyFiltersAndAdd(); + tstbSearch.Text = ""; + txtFilenameFilter.ResetText(); + txtURLFilter.ResetText(); + cbDateFilter.Checked = false; + dtpFilterFrom.ResetText(); + dtpFilterTo.ResetText(); + cbTypeFilter.Checked = false; + if (cbTypeFilterSelection.Items.Count > 0) + { + cbTypeFilterSelection.SelectedIndex = 0; + } + cbHostFilter.Checked = false; + cbHostFilterSelection.ResetText(); } - private void OutputStats(HistoryItem[] historyItems) + private void RefreshHistoryItems(bool mockData = false) { - rtbStats.ResetText(); - - rtbStats.SetFontBold(); - rtbStats.AppendLine(Resources.HistoryItemCounts); - rtbStats.SetFontRegular(); - rtbStats.AppendLine(Resources.HistoryStats_Total + " " + historyItems.Length); - - IEnumerable types = historyItems. - GroupBy(x => x.Type). - OrderByDescending(x => x.Count()). - Select(x => string.Format("{0}: {1} ({2:N0}%)", x.Key, x.Count(), x.Count() / (float)historyItems.Length * 100)); - - rtbStats.AppendLine(string.Join(Environment.NewLine, types)); - - rtbStats.AppendLine(); - rtbStats.SetFontBold(); - rtbStats.AppendLine(Resources.HistoryStats_YearlyUsages); - rtbStats.SetFontRegular(); - - IEnumerable yearlyUsages = historyItems. - GroupBy(x => x.DateTime.Year). - OrderByDescending(x => x.Key). - Select(x => string.Format("{0}: {1} ({2:N0}%)", x.Key, x.Count(), x.Count() / (float)historyItems.Length * 100)); - - rtbStats.AppendLine(string.Join(Environment.NewLine, yearlyUsages)); - - rtbStats.AppendLine(); - rtbStats.SetFontBold(); - rtbStats.AppendLine(Resources.HistoryStats_FileExtensions); - rtbStats.SetFontRegular(); - - IEnumerable fileExtensions = historyItems. - Where(x => !string.IsNullOrEmpty(x.FileName) && !x.FileName.EndsWith(")")). - Select(x => Helpers.GetFilenameExtension(x.FileName)). - GroupBy(x => x). - OrderByDescending(x => x.Count()). - Select(x => string.Format("{0} ({1})", x.Key, x.Count())); - - rtbStats.AppendLine(string.Join(Environment.NewLine, fileExtensions)); - - rtbStats.AppendLine(); - rtbStats.SetFontBold(); - rtbStats.AppendLine(Resources.HistoryStats_Hosts); - rtbStats.SetFontRegular(); - - IEnumerable hosts = historyItems. - GroupBy(x => x.Host). - OrderByDescending(x => x.Count()). - Select(x => string.Format("{0} ({1})", x.Key, x.Count())); - - rtbStats.AppendLine(string.Join(Environment.NewLine, hosts)); + allHistoryItems = GetHistoryItems(mockData); + ApplyFilterSimple(); } private HistoryItem[] him_GetHistoryItems() @@ -153,9 +110,13 @@ private HistoryItem[] him_GetHistoryItems() return lvHistory.SelectedItems.Cast().Select(x => x.Tag as HistoryItem).ToArray(); } - private HistoryItem[] GetHistoryItems() + private HistoryItem[] GetHistoryItems(bool mockData = false) { - if (history == null) + if (mockData) + { + history = new HistoryManagerMock(HistoryPath); + } + else { history = new HistoryManagerJSON(HistoryPath); } @@ -165,76 +126,44 @@ private HistoryItem[] GetHistoryItems() return historyItems.ToArray(); } - private void ApplyFiltersAndAdd() + private void ApplyFilter(HistoryFilter filter) { if (allHistoryItems != null && allHistoryItems.Length > 0) { - HistoryItem[] historyItems = ApplyFilters(allHistoryItems); + IEnumerable historyItems = filter.ApplyFilter(allHistoryItems); - if (Settings.MaxItemCount > 0 && historyItems.Length > Settings.MaxItemCount) - { - historyItems = historyItems.Take(Settings.MaxItemCount).ToArray(); - } - - AddHistoryItems(historyItems); + AddHistoryItems(historyItems.ToArray()); } } - private HistoryItem[] ApplyFilters(HistoryItem[] historyItems) + private void ApplyFilterSimple() { - if (!cbTypeFilter.Checked && !cbHostFilter.Checked && string.IsNullOrEmpty(txtFilenameFilter.Text) && string.IsNullOrEmpty(txtURLFilter.Text) && !cbDateFilter.Checked) + HistoryFilter filter = new HistoryFilter() { - return historyItems; - } + Filename = tstbSearch.Text, + MaxItemCount = Settings.MaxItemCount + }; - IEnumerable result = historyItems.AsEnumerable(); + ApplyFilter(filter); + } - if (cbTypeFilter.Checked) + private void ApplyFilterAdvanced() + { + HistoryFilter filter = new HistoryFilter() { - string type = cbTypeFilterSelection.Text; + Filename = txtFilenameFilter.Text, + URL = txtURLFilter.Text, + FilterDate = cbDateFilter.Checked, + FromDate = dtpFilterFrom.Value.Date, + ToDate = dtpFilterTo.Value.Date, + FilterType = cbTypeFilter.Checked, + Type = cbTypeFilterSelection.Text, + FilterHost = cbHostFilter.Checked, + Host = cbHostFilterSelection.Text, + MaxItemCount = Settings.MaxItemCount + }; - if (!string.IsNullOrEmpty(type)) - { - result = result.Where(x => !string.IsNullOrEmpty(x.Type) && x.Type.Equals(type, StringComparison.InvariantCultureIgnoreCase)); - } - } - - if (cbHostFilter.Checked) - { - string host = cbHostFilterSelection.Text; - - if (!string.IsNullOrEmpty(host)) - { - result = result.Where(x => !string.IsNullOrEmpty(x.Host) && x.Host.Contains(host, StringComparison.InvariantCultureIgnoreCase)); - } - } - - string filenameFilter = txtFilenameFilter.Text; - - if (!string.IsNullOrEmpty(filenameFilter)) - { - string pattern = Regex.Escape(filenameFilter).Replace("\\?", ".").Replace("\\*", ".*"); - Regex regex = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); - result = result.Where(x => (x.FileName != null && regex.IsMatch(x.FileName)) || - (SearchInTags && x.Tags != null && x.Tags.Any(tag => regex.IsMatch(tag.Value)))); - } - - string urlFilter = txtURLFilter.Text; - - if (!string.IsNullOrEmpty(urlFilter)) - { - result = result.Where(x => x.URL != null && x.URL.Contains(urlFilter, StringComparison.InvariantCultureIgnoreCase)); - } - - if (cbDateFilter.Checked) - { - DateTime fromDate = dtpFilterFrom.Value.Date; - DateTime toDate = dtpFilterTo.Value.Date; - - result = result.Where(x => x.DateTime.Date >= fromDate && x.DateTime.Date <= toDate); - } - - return result.ToArray(); + ApplyFilter(filter); } private void AddHistoryItems(HistoryItem[] historyItems) @@ -279,6 +208,11 @@ private void AddHistoryItems(HistoryItem[] historyItems) lvHistory.FillLastColumn(); lvHistory.Focus(); + if (lvHistory.Items.Count > 0) + { + lvHistory.Items[0].Selected = true; + } + Cursor = Cursors.Default; } @@ -347,6 +281,55 @@ private void UpdatePictureBox() } } + private string OutputStats(HistoryItem[] historyItems) + { + StringBuilder sb = new StringBuilder(); + + sb.AppendLine(Resources.HistoryItemCounts); + sb.AppendLine(Resources.HistoryStats_Total + " " + historyItems.Length); + + IEnumerable types = historyItems. + GroupBy(x => x.Type). + OrderByDescending(x => x.Count()). + Select(x => string.Format("{0}: {1} ({2:N0}%)", x.Key, x.Count(), x.Count() / (float)historyItems.Length * 100)); + + sb.AppendLine(string.Join(Environment.NewLine, types)); + + sb.AppendLine(); + sb.AppendLine(Resources.HistoryStats_YearlyUsages); + + IEnumerable yearlyUsages = historyItems. + GroupBy(x => x.DateTime.Year). + OrderByDescending(x => x.Key). + Select(x => string.Format("{0}: {1} ({2:N0}%)", x.Key, x.Count(), x.Count() / (float)historyItems.Length * 100)); + + sb.AppendLine(string.Join(Environment.NewLine, yearlyUsages)); + + sb.AppendLine(); + sb.AppendLine(Resources.HistoryStats_FileExtensions); + + IEnumerable fileExtensions = historyItems. + Where(x => !string.IsNullOrEmpty(x.FileName) && !x.FileName.EndsWith(")")). + Select(x => Helpers.GetFilenameExtension(x.FileName)). + GroupBy(x => x). + OrderByDescending(x => x.Count()). + Select(x => string.Format("{0} ({1})", x.Key, x.Count())); + + sb.AppendLine(string.Join(Environment.NewLine, fileExtensions)); + + sb.AppendLine(); + sb.AppendLine(Resources.HistoryStats_Hosts); + + IEnumerable hosts = historyItems. + GroupBy(x => x.Host). + OrderByDescending(x => x.Count()). + Select(x => string.Format("{0} ({1})", x.Key, x.Count())); + + sb.Append(string.Join(Environment.NewLine, hosts)); + + return sb.ToString(); + } + #region Form events private void HistoryForm_Shown(object sender, EventArgs e) @@ -357,18 +340,11 @@ private void HistoryForm_Shown(object sender, EventArgs e) if (lvHistory.Items.Count > 0) { - lvHistory.Items[0].Selected = true; - cbTypeFilterSelection.Items.Clear(); cbTypeFilterSelection.Items.AddRange(allHistoryItems.Select(x => x.Type).Distinct().Where(x => !string.IsNullOrEmpty(x)).ToArray()); - - if (cbTypeFilterSelection.Items.Count > 0) - { - cbTypeFilterSelection.SelectedIndex = 0; - } - cbHostFilterSelection.Items.Clear(); cbHostFilterSelection.Items.AddRange(allHistoryItems.Select(x => x.Host).Distinct().Where(x => !string.IsNullOrEmpty(x)).ToArray()); + ResetFilters(); } this.ForceActivate(); @@ -387,6 +363,12 @@ private void HistoryForm_KeyDown(object sender, KeyEventArgs e) RefreshHistoryItems(); e.Handled = true; break; +#if DEBUG + case Keys.Control | Keys.F5: + RefreshHistoryItems(true); + e.Handled = true; + break; +#endif } } @@ -395,13 +377,50 @@ private void scMain_SplitterMoved(object sender, SplitterEventArgs e) Settings.SplitterDistance = scMain.SplitterDistance; } + private void tstbSearch_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + e.Handled = true; + e.SuppressKeyPress = true; + ApplyFilterSimple(); + tstbSearch.Focus(); + } + } + + private void tsbSearch_Click(object sender, EventArgs e) + { + ApplyFilterSimple(); + } + + private void tsbAdvancedSearch_Click(object sender, EventArgs e) + { + gbAdvancedSearch.Visible = !gbAdvancedSearch.Visible; + } + + private void tsbCopyStats_Click(object sender, EventArgs e) + { + string stats = OutputStats(allHistoryItems); + ClipboardHelpers.CopyText(stats); + } + + 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) { e.Handled = true; e.SuppressKeyPress = true; - ApplyFiltersAndAdd(); + ApplyFilterAdvanced(); txtFilenameFilter.Focus(); } } @@ -412,45 +431,21 @@ private void txtURLFilter_KeyDown(object sender, KeyEventArgs e) { e.Handled = true; e.SuppressKeyPress = true; - ApplyFiltersAndAdd(); + ApplyFilterAdvanced(); txtURLFilter.Focus(); } } - private void btnApplyFilters_Click(object sender, EventArgs e) + private void btnAdvancedSearch_Click(object sender, EventArgs e) { - ApplyFiltersAndAdd(); + gbAdvancedSearch.Visible = false; + ApplyFilterAdvanced(); } - private void btnRemoveFilters_Click(object sender, EventArgs e) + private void btnAdvancedSearchReset_Click(object sender, EventArgs e) { - AddHistoryItems(allHistoryItems); - } - - private void BtnShowStats_Click(object sender, EventArgs e) - { - if (showingStats) - { - lvHistory.Visible = true; - pStats.Visible = false; - btnShowStats.Text = Resources.BtnShowStats_ShowStats; - showingStats = false; - } - else - { - pStats.Visible = true; - lvHistory.Visible = false; - btnShowStats.Text = Resources.BtnShowStats_HideStats; - Cursor = Cursors.WaitCursor; - OutputStats(allHistoryItems); - Cursor = Cursors.Default; - showingStats = true; - } - } - - private void nudMaxItemCount_ValueChanged(object sender, EventArgs e) - { - Settings.MaxItemCount = (int)nudMaxItemCount.Value; + ResetFilters(); + ApplyFilterAdvanced(); } private void lvHistory_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) diff --git a/ShareX.HistoryLib/Forms/HistoryForm.resx b/ShareX.HistoryLib/Forms/HistoryForm.resx index 2f2852f9b..e4e5614aa 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.resx +++ b/ShareX.HistoryLib/Forms/HistoryForm.resx @@ -117,73 +117,433 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill + + tscHistory.BottomToolStripPanel + + + System.Windows.Forms.ToolStripPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tscHistory + + + 4 - - 0, 0 + + 272, 176 - - Fill - - - Arial, 9.75pt - - - 3, 3 - - - 544, 635 + + 120, 24 - - 1 + + 22 - - + + Reset - - rtbStats + + btnAdvancedSearchReset - - System.Windows.Forms.RichTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - pStats + + gbAdvancedSearch - + 0 - - Fill + + + NoControl - - 0, 0 + + 144, 176 - - 3, 3, 3, 3 + + 120, 24 - - 550, 641 + + 21 - + + Search + + + btnAdvancedSearch + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 1 + + + True + + + NoControl + + + 13, 48 + + + 32, 13 + + + 20 + + + URL: + + + lblURLFilter + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + 2 - + + 96, 44 + + + 296, 20 + + + 19 + + + txtURLFilter + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 3 + + + True + + + NoControl + + + 13, 24 + + + 52, 13 + + + 17 + + + Filename: + + + lblFilenameFilter + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 4 + + + 168, 142 + + + 224, 21 + + + 16 + + + cbHostFilterSelection + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 5 + + + 168, 118 + + + 224, 21 + + + 11 + + + cbTypeFilterSelection + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 6 + + + True + + + NoControl + + + 16, 144 + + + 51, 17 + + + 12 + + + Host: + + + cbHostFilter + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 7 + + + True + + + NoControl + + + 16, 120 + + + 53, 17 + + + 10 + + + Type: + + + cbTypeFilter + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 8 + + + 168, 70 + + + 224, 20 + + + 2 + + + dtpFilterFrom + + + System.Windows.Forms.DateTimePicker, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 9 + + + True + + + NoControl + + + 93, 74 + + + 33, 13 + + + 1 + + + From: + + + lblFilterFrom + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 10 + + + True + + + NoControl + + + 93, 98 + + + 23, 13 + + + 3 + + + To: + + + lblFilterTo + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 11 + + + True + + + NoControl + + + 16, 72 + + + 52, 17 + + + 0 + + + Date: + + + cbDateFilter + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 12 + + + 168, 94 + + + 224, 20 + + + 4 + + + dtpFilterTo + + + System.Windows.Forms.DateTimePicker, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 13 + + + 96, 20 + + + 296, 20 + + + 6 + + + txtFilenameFilter + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbAdvancedSearch + + + 14 + + + 71, 3 + + + 409, 213 + + + 4 + + + Advanced search + + False - - pStats + + gbAdvancedSearch - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - scMain.Panel1 + + tscHistory.ContentPanel - + 0 @@ -217,7 +577,7 @@ 0, 0 - 550, 641 + 550, 616 0 @@ -229,11 +589,176 @@ ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.5.1.0, Culture=neutral, PublicKeyToken=null - scMain.Panel1 + tscHistory.ContentPanel 1 + + 550, 616 + + + tscHistory.ContentPanel + + + System.Windows.Forms.ToolStripContentPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tscHistory + + + 0 + + + Fill + + + tscHistory.LeftToolStripPanel + + + System.Windows.Forms.ToolStripPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tscHistory + + + 1 + + + 0, 0 + + + tscHistory.RightToolStripPanel + + + System.Windows.Forms.ToolStripPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tscHistory + + + 2 + + + 550, 641 + + + 2 + + + toolStripContainer1 + + + 17, 17 + + + None + + + 45, 22 + + + Search: + + + Segoe UI, 9pt + + + 300, 25 + + + Magenta + + + 23, 22 + + + Search + + + Magenta + + + 23, 22 + + + Advanced search... + + + 6, 25 + + + Magenta + + + 23, 22 + + + Copy stats + + + 6, 25 + + + Magenta + + + 23, 22 + + + Settings... + + + 3, 0 + + + 454, 25 + + + 0 + + + tssHistory + + + System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tscHistory.TopToolStripPanel + + + 0 + + + tscHistory.TopToolStripPanel + + + System.Windows.Forms.ToolStripPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tscHistory + + + 3 + + + tscHistory + + + System.Windows.Forms.ToolStripContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + scMain.Panel1 + + + 0 + + + Fill + + + 0, 0 + scMain.Panel1 @@ -249,33 +774,6 @@ 100 - - Bottom, Left - - - 224, 576 - - - 80, 20 - - - 7 - - - Center - - - nudMaxItemCount - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - scMain.Panel2 - - - 0 - Top, Bottom, Left, Right @@ -283,7 +781,7 @@ 8, 8 - 402, 352 + 406, 352 3 @@ -298,485 +796,8 @@ scMain.Panel2 - 1 - - - Bottom, Left - - - NoControl - - - 8, 604 - - - 144, 24 - - - 5 - - - Show stats - - - btnShowStats - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - scMain.Panel2 - - - 2 - - - Bottom, Left - - - True - - - 5, 580 - - - 96, 13 - - - 6 - - - Maximum item limit: - - - lblMaxItemCount - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - scMain.Panel2 - - - 3 - - - Bottom, Left - - - True - - - NoControl - - - 13, 48 - - - 32, 13 - - - 20 - - - URL: - - - lblURLFilter - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - 0 - - 96, 44 - - - 296, 20 - - - 19 - - - txtURLFilter - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 1 - - - True - - - NoControl - - - 13, 24 - - - 52, 13 - - - 17 - - - Filename: - - - lblFilenameFilter - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 2 - - - 168, 142 - - - 224, 21 - - - 16 - - - cbHostFilterSelection - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 3 - - - NoControl - - - 168, 168 - - - 144, 24 - - - 15 - - - Remove filters - - - btnRemoveFilters - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 4 - - - NoControl - - - 16, 168 - - - 144, 24 - - - 14 - - - Apply filters - - - btnApplyFilters - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 5 - - - 168, 118 - - - 224, 21 - - - 11 - - - cbTypeFilterSelection - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 6 - - - True - - - NoControl - - - 16, 144 - - - 51, 17 - - - 12 - - - Host: - - - cbHostFilter - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 7 - - - True - - - NoControl - - - 16, 120 - - - 53, 17 - - - 10 - - - Type: - - - cbTypeFilter - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 8 - - - 168, 70 - - - 224, 20 - - - 2 - - - dtpFilterFrom - - - System.Windows.Forms.DateTimePicker, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 9 - - - True - - - NoControl - - - 93, 74 - - - 33, 13 - - - 1 - - - From: - - - lblFilterFrom - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 10 - - - True - - - NoControl - - - 93, 98 - - - 23, 13 - - - 3 - - - To: - - - lblFilterTo - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 11 - - - True - - - NoControl - - - 16, 72 - - - 52, 17 - - - 0 - - - Date: - - - cbDateFilter - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 12 - - - 168, 94 - - - 224, 20 - - - 4 - - - dtpFilterTo - - - System.Windows.Forms.DateTimePicker, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 13 - - - 96, 20 - - - 296, 20 - - - 6 - - - txtFilenameFilter - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbFilters - - - 14 - - - 8, 368 - - - 404, 200 - - - 4 - - - Filters - - - gbFilters - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - scMain.Panel2 - - - 4 - scMain.Panel2 @@ -858,6 +879,54 @@ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tslSearch + + + System.Windows.Forms.ToolStripLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tstbSearch + + + System.Windows.Forms.ToolStripTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tsbSearch + + + System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tsbAdvancedSearch + + + System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tss1 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tsbCopyStats + + + System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tss2 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tsbSettings + + + System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + HistoryForm diff --git a/ShareX.HistoryLib/Forms/HistorySettingsForm.Designer.cs b/ShareX.HistoryLib/Forms/HistorySettingsForm.Designer.cs new file mode 100644 index 000000000..655b4f12e --- /dev/null +++ b/ShareX.HistoryLib/Forms/HistorySettingsForm.Designer.cs @@ -0,0 +1,74 @@ + +namespace ShareX.HistoryLib +{ + partial class HistorySettingsForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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; + } +} \ No newline at end of file diff --git a/ShareX.HistoryLib/Forms/HistorySettingsForm.cs b/ShareX.HistoryLib/Forms/HistorySettingsForm.cs new file mode 100644 index 000000000..518d1ee19 --- /dev/null +++ b/ShareX.HistoryLib/Forms/HistorySettingsForm.cs @@ -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 . +*/ + +#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; + } + } +} \ No newline at end of file diff --git a/ShareX.HistoryLib/Forms/HistorySettingsForm.resx b/ShareX.HistoryLib/Forms/HistorySettingsForm.resx new file mode 100644 index 000000000..45b4734a7 --- /dev/null +++ b/ShareX.HistoryLib/Forms/HistorySettingsForm.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + + + 13, 16 + + + 96, 13 + + + 0 + + + Maximum item limit: + + + lblMaximumItemLimit + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 16, 32 + + + 64, 20 + + + 1 + + + + Center + + + nudMaximumItemLimit + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 96, 96 + + + 305, 191 + + + CenterScreen + + + ShareX - History settings + + + HistorySettingsForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShareX.HistoryLib/Forms/ImageHistorySettingsForm.Designer.cs b/ShareX.HistoryLib/Forms/ImageHistorySettingsForm.Designer.cs index fd07dd618..936dfec07 100644 --- a/ShareX.HistoryLib/Forms/ImageHistorySettingsForm.Designer.cs +++ b/ShareX.HistoryLib/Forms/ImageHistorySettingsForm.Designer.cs @@ -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); diff --git a/ShareX.HistoryLib/Forms/ImageHistorySettingsForm.resx b/ShareX.HistoryLib/Forms/ImageHistorySettingsForm.resx index d4a5b7da7..fd9d424c3 100644 --- a/ShareX.HistoryLib/Forms/ImageHistorySettingsForm.resx +++ b/ShareX.HistoryLib/Forms/ImageHistorySettingsForm.resx @@ -123,7 +123,7 @@ - 5, 8 + 13, 16 62, 13 @@ -150,7 +150,7 @@ True - 5, 56 + 13, 64 80, 13 @@ -177,7 +177,7 @@ True - 5, 104 + 13, 112 105, 13 @@ -201,7 +201,7 @@ 6 - 8, 24 + 16, 32 120, 21 @@ -222,7 +222,7 @@ 5 - 8, 72 + 16, 80 64, 20 @@ -247,7 +247,7 @@ 4 - 8, 120 + 16, 128 64, 20 @@ -274,7 +274,7 @@ True - 77, 76 + 85, 84 18, 13 @@ -304,7 +304,7 @@ NoControl - 8, 176 + 16, 184 138, 17 @@ -331,7 +331,7 @@ True - 8, 152 + 16, 160 106, 17 @@ -358,10 +358,10 @@ True - 6, 13 + 96, 96 - 344, 226 + 344, 218 CenterScreen diff --git a/ShareX.HistoryLib/HistoryFilter.cs b/ShareX.HistoryLib/HistoryFilter.cs new file mode 100644 index 000000000..68c5a5c07 --- /dev/null +++ b/ShareX.HistoryLib/HistoryFilter.cs @@ -0,0 +1,91 @@ +#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 . +*/ + +#endregion License Information (GPL v3) + +using ShareX.HelpersLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; + +namespace ShareX.HistoryLib +{ + public class HistoryFilter + { + public string Filename { get; set; } + public string URL { get; set; } + public bool FilterDate { get; set; } + public DateTime FromDate { get; set; } + public DateTime ToDate { get; set; } + public bool FilterType { get; set; } + public string Type { get; set; } + public bool FilterHost { get; set; } + public string Host { get; set; } + + public int MaxItemCount { get; set; } + public bool SearchInTags { get; set; } = true; + + public HistoryFilter() + { + } + + public IEnumerable ApplyFilter(IEnumerable historyItems) + { + if (FilterType && !string.IsNullOrEmpty(Type)) + { + historyItems = historyItems.Where(x => !string.IsNullOrEmpty(x.Type) && x.Type.Equals(Type, StringComparison.InvariantCultureIgnoreCase)); + } + + if (FilterHost && !string.IsNullOrEmpty(Host)) + { + historyItems = historyItems.Where(x => !string.IsNullOrEmpty(x.Host) && x.Host.Contains(Host, StringComparison.InvariantCultureIgnoreCase)); + } + + if (!string.IsNullOrEmpty(Filename)) + { + 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)))); + } + + if (!string.IsNullOrEmpty(URL)) + { + historyItems = historyItems.Where(x => x.URL != null && x.URL.Contains(URL, StringComparison.InvariantCultureIgnoreCase)); + } + + if (FilterDate) + { + historyItems = historyItems.Where(x => x.DateTime.Date >= FromDate && x.DateTime.Date <= ToDate); + } + + if (MaxItemCount > 0) + { + historyItems = historyItems.Take(MaxItemCount); + } + + return historyItems; + } + } +} \ No newline at end of file diff --git a/ShareX.HistoryLib/HistoryManagerMock.cs b/ShareX.HistoryLib/HistoryManagerMock.cs new file mode 100644 index 000000000..1fbf5d255 --- /dev/null +++ b/ShareX.HistoryLib/HistoryManagerMock.cs @@ -0,0 +1,79 @@ +#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 . +*/ + +#endregion License Information (GPL v3) + +using ShareX.HelpersLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ShareX.HistoryLib +{ + public class HistoryManagerMock : HistoryManager + { + private int itemCount = 10000; + + public HistoryManagerMock(string filePath) : base(filePath) + { + } + + protected override List Load(string filePath) + { + List items = new List(); + + for (int i = 0; i < itemCount; i++) + { + items.Add(CreateMockHistoryItem()); + } + + return items.OrderBy(x => x.DateTime).ToList(); + } + + private HistoryItem CreateMockHistoryItem() + { + string fileName = $"ShareX_{Helpers.GetRandomAlphanumeric(10)}.png"; + + HistoryItem historyItem = new HistoryItem() + { + FileName = fileName, + FilePath = @"..\..\..\ShareX.HelpersLib\Resources\ShareX_Logo.png", + DateTime = DateTime.Now.AddSeconds(-RandomFast.Next(0, 1000000)), + Type = "Image", + Host = "Amazon S3", + URL = "https://i.example.com/" + fileName, + ThumbnailURL = "https://t.example.com/" + fileName, + DeletionURL = "https://d.example.com/" + fileName, + ShortenedURL = "https://s.example.com/" + fileName + }; + + return historyItem; + } + + protected override bool Append(string filePath, IEnumerable historyItems) + { + return true; + } + } +} \ No newline at end of file diff --git a/ShareX.HistoryLib/Properties/Resources.Designer.cs b/ShareX.HistoryLib/Properties/Resources.Designer.cs index 38d630d26..1c13d29c3 100644 --- a/ShareX.HistoryLib/Properties/Resources.Designer.cs +++ b/ShareX.HistoryLib/Properties/Resources.Designer.cs @@ -71,20 +71,12 @@ internal class Resources { } /// - /// Looks up a localized string similar to Hide stats. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static string BtnShowStats_HideStats { + internal static System.Drawing.Bitmap clipboard_list { get { - return ResourceManager.GetString("BtnShowStats_HideStats", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Show stats. - /// - internal static string BtnShowStats_ShowStats { - get { - return ResourceManager.GetString("BtnShowStats_ShowStats", resourceCulture); + object obj = ResourceManager.GetObject("clipboard-list", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); } } @@ -97,6 +89,16 @@ internal class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap gear { + get { + object obj = ResourceManager.GetObject("gear", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -433,6 +435,16 @@ internal class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap magnifier__plus { + get { + object obj = ResourceManager.GetObject("magnifier--plus", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShareX.HistoryLib/Properties/Resources.resx b/ShareX.HistoryLib/Properties/Resources.resx index 2ae66cc58..bbd196a62 100644 --- a/ShareX.HistoryLib/Properties/Resources.resx +++ b/ShareX.HistoryLib/Properties/Resources.resx @@ -117,33 +117,45 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Error + + + ..\Resources\magnifier.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Thumbnail URL + + File path + + + Hosts: + + + History item counts: + Image preview... File - - Image + + Filtered: {0} + + + Shortened URL Markdown link + + File extensions: + Folder - - URL - - - - ..\Resources\globe.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + File name File name with extension @@ -151,6 +163,9 @@ Copy + + Forum (BBCode) image + HTML image @@ -160,8 +175,11 @@ Total: {0} - - Filtered: {0} + + ..\Resources\globe.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\clipboard-list.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Open @@ -169,6 +187,9 @@ More info... + + ..\Resources\magnifier--plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + HTML link @@ -181,67 +202,49 @@ HTML linked image + + Edit image... + + + Error + + + Total: + Forum (BBCode) linked image Deletion URL - - Forum (BBCode) image + + Upload file Text + + Image + ..\Resources\image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\application-block.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Shortened URL - - - File name - - - File path - - - Forum (BBCode) link - - - ..\Resources\magnifier.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Upload file - - - Edit image... - - - Show stats - - - Hide stats - - - History item counts: - - - Total: + + Error occured while reading history file: Yearly usages: - - File extensions: + + URL - - Hosts: + + Forum (BBCode) link - - Error occured while reading history file: + + ..\Resources\gear.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/ShareX.HistoryLib/Resources/clipboard-list.png b/ShareX.HistoryLib/Resources/clipboard-list.png new file mode 100644 index 000000000..fa14de3fd Binary files /dev/null and b/ShareX.HistoryLib/Resources/clipboard-list.png differ diff --git a/ShareX.HistoryLib/Resources/gear.png b/ShareX.HistoryLib/Resources/gear.png new file mode 100644 index 000000000..815146391 Binary files /dev/null and b/ShareX.HistoryLib/Resources/gear.png differ diff --git a/ShareX.HistoryLib/Resources/magnifier--plus.png b/ShareX.HistoryLib/Resources/magnifier--plus.png new file mode 100644 index 000000000..7343b1402 Binary files /dev/null and b/ShareX.HistoryLib/Resources/magnifier--plus.png differ diff --git a/ShareX.HistoryLib/ShareX.HistoryLib.csproj b/ShareX.HistoryLib/ShareX.HistoryLib.csproj index c76e3a8fc..be136d21e 100644 --- a/ShareX.HistoryLib/ShareX.HistoryLib.csproj +++ b/ShareX.HistoryLib/ShareX.HistoryLib.csproj @@ -86,6 +86,13 @@ Properties\SharedAssemblyInfo.cs + + Form + + + HistorySettingsForm.cs + + Form @@ -100,6 +107,7 @@ ImageHistorySettingsForm.cs + @@ -246,6 +254,9 @@ HistoryItemInfoForm.cs + + HistorySettingsForm.cs + ImageHistoryForm.cs @@ -379,6 +390,15 @@ + + + + + + + + +