diff --git a/ShareX.HistoryLib/HistoryForm.Designer.cs b/ShareX.HistoryLib/HistoryForm.Designer.cs
index efc60598b..5d073333e 100644
--- a/ShareX.HistoryLib/HistoryForm.Designer.cs
+++ b/ShareX.HistoryLib/HistoryForm.Designer.cs
@@ -40,7 +40,6 @@ private void InitializeComponent()
this.pbThumbnail = new ShareX.HelpersLib.MyPictureBox();
this.gbFilters = new System.Windows.Forms.GroupBox();
this.btnRemoveFilters = new System.Windows.Forms.Button();
- this.txtHostFilter = new System.Windows.Forms.TextBox();
this.cbTypeFilterSelection = new System.Windows.Forms.ComboBox();
this.cbHostFilter = new System.Windows.Forms.CheckBox();
this.cbTypeFilter = new System.Windows.Forms.CheckBox();
@@ -52,6 +51,7 @@ private void InitializeComponent()
this.dtpFilterTo = new System.Windows.Forms.DateTimePicker();
this.txtFilenameFilter = new System.Windows.Forms.TextBox();
this.cbFilenameFilterMethod = new System.Windows.Forms.ComboBox();
+ this.cbHostFilterSelection = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout();
@@ -132,9 +132,9 @@ private void InitializeComponent()
// gbFilters
//
resources.ApplyResources(this.gbFilters, "gbFilters");
+ this.gbFilters.Controls.Add(this.cbHostFilterSelection);
this.gbFilters.Controls.Add(this.btnRemoveFilters);
this.gbFilters.Controls.Add(this.btnApplyFilters);
- this.gbFilters.Controls.Add(this.txtHostFilter);
this.gbFilters.Controls.Add(this.cbTypeFilterSelection);
this.gbFilters.Controls.Add(this.cbHostFilter);
this.gbFilters.Controls.Add(this.cbTypeFilter);
@@ -156,20 +156,10 @@ private void InitializeComponent()
this.btnRemoveFilters.UseVisualStyleBackColor = true;
this.btnRemoveFilters.Click += new System.EventHandler(this.btnRemoveFilters_Click);
//
- // txtHostFilter
- //
- resources.ApplyResources(this.txtHostFilter, "txtHostFilter");
- this.txtHostFilter.Name = "txtHostFilter";
- //
// cbTypeFilterSelection
//
this.cbTypeFilterSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbTypeFilterSelection.FormattingEnabled = true;
- this.cbTypeFilterSelection.Items.AddRange(new object[] {
- resources.GetString("cbTypeFilterSelection.Items"),
- resources.GetString("cbTypeFilterSelection.Items1"),
- resources.GetString("cbTypeFilterSelection.Items2"),
- resources.GetString("cbTypeFilterSelection.Items3")});
resources.ApplyResources(this.cbTypeFilterSelection, "cbTypeFilterSelection");
this.cbTypeFilterSelection.Name = "cbTypeFilterSelection";
//
@@ -235,6 +225,12 @@ private void InitializeComponent()
resources.ApplyResources(this.cbFilenameFilterMethod, "cbFilenameFilterMethod");
this.cbFilenameFilterMethod.Name = "cbFilenameFilterMethod";
//
+ // cbHostFilterSelection
+ //
+ this.cbHostFilterSelection.FormattingEnabled = true;
+ resources.ApplyResources(this.cbHostFilterSelection, "cbHostFilterSelection");
+ this.cbHostFilterSelection.Name = "cbHostFilterSelection";
+ //
// HistoryForm
//
this.AcceptButton = this.btnApplyFilters;
@@ -277,8 +273,8 @@ private void InitializeComponent()
private System.Windows.Forms.ComboBox cbTypeFilterSelection;
private System.Windows.Forms.CheckBox cbHostFilter;
private System.Windows.Forms.CheckBox cbTypeFilter;
- private System.Windows.Forms.TextBox txtHostFilter;
private System.Windows.Forms.ColumnHeader chIcon;
private ShareX.HelpersLib.SplitContainerCustomSplitter scMain;
+ private System.Windows.Forms.ComboBox cbHostFilterSelection;
}
}
\ No newline at end of file
diff --git a/ShareX.HistoryLib/HistoryForm.cs b/ShareX.HistoryLib/HistoryForm.cs
index 73fdbdc05..5adffa4a8 100644
--- a/ShareX.HistoryLib/HistoryForm.cs
+++ b/ShareX.HistoryLib/HistoryForm.cs
@@ -67,7 +67,6 @@ public HistoryForm(string historyPath, int splitterDistance = 0, int maxItemCoun
pbThumbnail.Reset();
cbFilenameFilterMethod.SelectedIndex = 0; // Contains
- cbTypeFilterSelection.SelectedIndex = 0; // Image
lvHistory.FillLastColumn();
if (splitterDistance > 0)
@@ -128,31 +127,17 @@ private HistoryItem[] ApplyFilters(HistoryItem[] historyItems)
if (cbTypeFilter.Checked)
{
- string type;
+ string type = cbTypeFilterSelection.Text;
- switch (cbTypeFilterSelection.SelectedIndex)
+ if (!string.IsNullOrEmpty(type))
{
- case 0:
- type = "Image";
- break;
- case 1:
- type = "Text";
- break;
- case 2:
- type = "File";
- break;
- default:
- case 3:
- type = "URL";
- break;
+ result = result.Where(x => !string.IsNullOrEmpty(x.Type) && x.Type.Equals(type, StringComparison.InvariantCultureIgnoreCase));
}
-
- result = result.Where(x => !string.IsNullOrEmpty(x.Type) && x.Type.Equals(type, StringComparison.InvariantCultureIgnoreCase));
}
if (cbHostFilter.Checked)
{
- string host = txtHostFilter.Text;
+ string host = cbHostFilterSelection.Text;
if (!string.IsNullOrEmpty(host))
{
@@ -241,13 +226,14 @@ private void AddHistoryItems(HistoryItem[] historyItems)
private void UpdateTitle(HistoryItem[] historyItems = null)
{
- string title = "ShareX - " + string.Format(Resources.HistoryForm_HistoryForm_History_, HistoryPath);
+ // TODO: Translate
+ string title = "ShareX - History";
if (historyItems != null)
{
StringBuilder status = new StringBuilder();
- status.Append(" - ");
+ status.Append(" (");
status.AppendFormat(Resources.HistoryForm_UpdateItemCount_Total___0_, allHistoryItems.Length.ToString("N0"));
if (allHistoryItems.Length > historyItems.Length)
@@ -259,7 +245,6 @@ private void UpdateTitle(HistoryItem[] historyItems = null)
group hi by hi.Type
into t
let count = t.Count()
- orderby t.Key
select string.Format(" - {0}: {1:N0}", t.Key, count);
foreach (string type in types)
@@ -267,6 +252,7 @@ orderby t.Key
status.Append(type);
}
+ status.Append(")");
title += status.ToString();
}
@@ -316,11 +302,23 @@ protected void OnSplitterDistanceChanged(int splitterDistance)
private void HistoryForm_Shown(object sender, EventArgs e)
{
Refresh();
+
RefreshHistoryItems();
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());
}
this.ShowActivate();
diff --git a/ShareX.HistoryLib/HistoryForm.de.resx b/ShareX.HistoryLib/HistoryForm.de.resx
index 99d6f0668..a87a090cd 100644
--- a/ShareX.HistoryLib/HistoryForm.de.resx
+++ b/ShareX.HistoryLib/HistoryForm.de.resx
@@ -150,15 +150,6 @@
Dateitypfilter:
-
- Bild
-
-
- Datei
-
-
- Text
-
Datum & Uhrzeit
diff --git a/ShareX.HistoryLib/HistoryForm.es.resx b/ShareX.HistoryLib/HistoryForm.es.resx
index db1cd225d..e9c26a778 100644
--- a/ShareX.HistoryLib/HistoryForm.es.resx
+++ b/ShareX.HistoryLib/HistoryForm.es.resx
@@ -135,15 +135,6 @@
Termina con
-
- Imagen
-
-
- Archivo
-
-
- Texto
-
Fecha y hora
diff --git a/ShareX.HistoryLib/HistoryForm.fr.resx b/ShareX.HistoryLib/HistoryForm.fr.resx
index cd4bcb2db..feee25ecf 100644
--- a/ShareX.HistoryLib/HistoryForm.fr.resx
+++ b/ShareX.HistoryLib/HistoryForm.fr.resx
@@ -135,9 +135,6 @@
Correspondance exacte
-
- Fichier
-
Filtre du type de fichier:
@@ -159,9 +156,6 @@
Filtre d'hôte:
-
- Image
-
Supprimer les filtres
@@ -171,7 +165,4 @@
À:
-
- Texte
-
\ No newline at end of file
diff --git a/ShareX.HistoryLib/HistoryForm.hu.resx b/ShareX.HistoryLib/HistoryForm.hu.resx
index ba8dc8f05..88a94043e 100644
--- a/ShareX.HistoryLib/HistoryForm.hu.resx
+++ b/ShareX.HistoryLib/HistoryForm.hu.resx
@@ -150,15 +150,6 @@
Fájltípus szűrő:
-
- Kép
-
-
- Fájl
-
-
- Szöveg
-
Dátum & idő
diff --git a/ShareX.HistoryLib/HistoryForm.ko-KR.resx b/ShareX.HistoryLib/HistoryForm.ko-KR.resx
index d87f99f1f..3cdc208cf 100644
--- a/ShareX.HistoryLib/HistoryForm.ko-KR.resx
+++ b/ShareX.HistoryLib/HistoryForm.ko-KR.resx
@@ -159,15 +159,6 @@
파일 종류 필터:
-
- 이미지
-
-
- 파일
-
-
- 텍스트
-
날짜 및 시각
diff --git a/ShareX.HistoryLib/HistoryForm.nl-NL.resx b/ShareX.HistoryLib/HistoryForm.nl-NL.resx
index 2f5d0f005..d18d294ef 100644
--- a/ShareX.HistoryLib/HistoryForm.nl-NL.resx
+++ b/ShareX.HistoryLib/HistoryForm.nl-NL.resx
@@ -150,15 +150,6 @@
Bestandstype filter:
-
- Afbeelding
-
-
- Bestand
-
-
- Tekst
-
Datum & tijd
diff --git a/ShareX.HistoryLib/HistoryForm.pt-BR.resx b/ShareX.HistoryLib/HistoryForm.pt-BR.resx
index 1cb77fa95..7ba90afd3 100644
--- a/ShareX.HistoryLib/HistoryForm.pt-BR.resx
+++ b/ShareX.HistoryLib/HistoryForm.pt-BR.resx
@@ -150,15 +150,6 @@
Filtro de tipo de arquivo:
-
- Imagem
-
-
- Arquivo
-
-
- Texto
-
Data e hora
diff --git a/ShareX.HistoryLib/HistoryForm.resx b/ShareX.HistoryLib/HistoryForm.resx
index 83886b2c9..82b0fee52 100644
--- a/ShareX.HistoryLib/HistoryForm.resx
+++ b/ShareX.HistoryLib/HistoryForm.resx
@@ -145,7 +145,7 @@
gbFilters
- 1
+ 2
Fill
@@ -199,7 +199,7 @@
8, 8
- 414, 368
+ 412, 368
1
@@ -219,6 +219,27 @@
Bottom, Left, Right
+
+ 168, 176
+
+
+ 144, 21
+
+
+ 16
+
+
+ cbHostFilterSelection
+
+
+ System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ gbFilters
+
+
+ 0
+
NoControl
@@ -244,41 +265,8 @@
gbFilters
- 0
+ 1
-
- 168, 177
-
-
- 144, 20
-
-
- 13
-
-
- txtHostFilter
-
-
- System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- gbFilters
-
-
- 2
-
-
- Image
-
-
- Text
-
-
- File
-
-
- URL
- @Invariant
168, 150
@@ -580,7 +568,7 @@
8, 384
- 414, 250
+ 412, 250
2
diff --git a/ShareX.HistoryLib/HistoryForm.ru.resx b/ShareX.HistoryLib/HistoryForm.ru.resx
index aae81e24d..498a6d201 100644
--- a/ShareX.HistoryLib/HistoryForm.ru.resx
+++ b/ShareX.HistoryLib/HistoryForm.ru.resx
@@ -150,15 +150,6 @@
По типу файла:
-
- Картинка
-
-
- Файл
-
-
- Текст
-
По хосту:
diff --git a/ShareX.HistoryLib/HistoryForm.tr.resx b/ShareX.HistoryLib/HistoryForm.tr.resx
index 6c2b3552d..35b826b1b 100644
--- a/ShareX.HistoryLib/HistoryForm.tr.resx
+++ b/ShareX.HistoryLib/HistoryForm.tr.resx
@@ -166,15 +166,6 @@
Filtreleri kaldır
-
- Resim
-
-
- Dosya
-
-
- Yazı
-
95, 17
diff --git a/ShareX.HistoryLib/HistoryForm.vi-VN.resx b/ShareX.HistoryLib/HistoryForm.vi-VN.resx
index 98ff8e877..0f95619e2 100644
--- a/ShareX.HistoryLib/HistoryForm.vi-VN.resx
+++ b/ShareX.HistoryLib/HistoryForm.vi-VN.resx
@@ -132,12 +132,6 @@
Tới:
-
- Ảnh
-
-
- Tệp
-
Tên tệp
@@ -153,9 +147,6 @@
Lịch sử
-
- Văn bản
-
Kết thúc với
diff --git a/ShareX.HistoryLib/HistoryForm.zh-CN.resx b/ShareX.HistoryLib/HistoryForm.zh-CN.resx
index 964a7eb17..b3bdeda2a 100644
--- a/ShareX.HistoryLib/HistoryForm.zh-CN.resx
+++ b/ShareX.HistoryLib/HistoryForm.zh-CN.resx
@@ -150,15 +150,6 @@
文件类型过滤器:
-
- 图像
-
-
- 文件
-
-
- 文本
-
日期时间
diff --git a/ShareX.HistoryLib/Properties/Resources.Designer.cs b/ShareX.HistoryLib/Properties/Resources.Designer.cs
index bc6e3306c..23f119520 100644
--- a/ShareX.HistoryLib/Properties/Resources.Designer.cs
+++ b/ShareX.HistoryLib/Properties/Resources.Designer.cs
@@ -80,15 +80,6 @@ internal static System.Drawing.Bitmap globe {
}
}
- ///
- /// Looks up a localized string similar to History: {0}.
- ///
- internal static string HistoryForm_HistoryForm_History_ {
- get {
- return ResourceManager.GetString("HistoryForm_HistoryForm_History_", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Filtered: {0}.
///
diff --git a/ShareX.HistoryLib/Properties/Resources.de.resx b/ShareX.HistoryLib/Properties/Resources.de.resx
index 94eeaa4a9..2dc1cd2b3 100644
--- a/ShareX.HistoryLib/Properties/Resources.de.resx
+++ b/ShareX.HistoryLib/Properties/Resources.de.resx
@@ -117,9 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Chronik: {0}
-
Gefiltert: {0}
diff --git a/ShareX.HistoryLib/Properties/Resources.es.resx b/ShareX.HistoryLib/Properties/Resources.es.resx
index c26a92d92..ea11413de 100644
--- a/ShareX.HistoryLib/Properties/Resources.es.resx
+++ b/ShareX.HistoryLib/Properties/Resources.es.resx
@@ -117,9 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Historial: {0}
-
Total: {0}
diff --git a/ShareX.HistoryLib/Properties/Resources.fr.resx b/ShareX.HistoryLib/Properties/Resources.fr.resx
index a5574aadc..ed060d31f 100644
--- a/ShareX.HistoryLib/Properties/Resources.fr.resx
+++ b/ShareX.HistoryLib/Properties/Resources.fr.resx
@@ -156,9 +156,6 @@
Image liée pour forum (BBCode)
-
- Historique: {0}
-
Image HTML
diff --git a/ShareX.HistoryLib/Properties/Resources.hu.resx b/ShareX.HistoryLib/Properties/Resources.hu.resx
index 6dc087aa3..6f31e7b53 100644
--- a/ShareX.HistoryLib/Properties/Resources.hu.resx
+++ b/ShareX.HistoryLib/Properties/Resources.hu.resx
@@ -117,9 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Előzmények: {0}
-
Szűrve: {0}
diff --git a/ShareX.HistoryLib/Properties/Resources.ko-KR.resx b/ShareX.HistoryLib/Properties/Resources.ko-KR.resx
index 9f7e7969d..759cdae22 100644
--- a/ShareX.HistoryLib/Properties/Resources.ko-KR.resx
+++ b/ShareX.HistoryLib/Properties/Resources.ko-KR.resx
@@ -201,9 +201,6 @@
값
-
- 히스토리: {0}
-
HTML 링크 ({0})
diff --git a/ShareX.HistoryLib/Properties/Resources.nl-NL.resx b/ShareX.HistoryLib/Properties/Resources.nl-NL.resx
index f8641bd94..bd1bd80d1 100644
--- a/ShareX.HistoryLib/Properties/Resources.nl-NL.resx
+++ b/ShareX.HistoryLib/Properties/Resources.nl-NL.resx
@@ -117,9 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Geschiedenis: {0}
-
Gefilterd: {0}
diff --git a/ShareX.HistoryLib/Properties/Resources.pt-BR.resx b/ShareX.HistoryLib/Properties/Resources.pt-BR.resx
index e255a2e1e..17b5ef052 100644
--- a/ShareX.HistoryLib/Properties/Resources.pt-BR.resx
+++ b/ShareX.HistoryLib/Properties/Resources.pt-BR.resx
@@ -117,9 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Histórico: {0}
-
Filtrados: {0}
diff --git a/ShareX.HistoryLib/Properties/Resources.resx b/ShareX.HistoryLib/Properties/Resources.resx
index 29ccbd0ba..9b119ffd9 100644
--- a/ShareX.HistoryLib/Properties/Resources.resx
+++ b/ShareX.HistoryLib/Properties/Resources.resx
@@ -129,9 +129,6 @@
Copy value
-
- History: {0}
-
Open
diff --git a/ShareX.HistoryLib/Properties/Resources.ru.resx b/ShareX.HistoryLib/Properties/Resources.ru.resx
index 9e3630c47..926850556 100644
--- a/ShareX.HistoryLib/Properties/Resources.ru.resx
+++ b/ShareX.HistoryLib/Properties/Resources.ru.resx
@@ -117,9 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- История: {0}
-
Отфильтровано: {0}
diff --git a/ShareX.HistoryLib/Properties/Resources.tr.resx b/ShareX.HistoryLib/Properties/Resources.tr.resx
index dc0608798..39cfe6032 100644
--- a/ShareX.HistoryLib/Properties/Resources.tr.resx
+++ b/ShareX.HistoryLib/Properties/Resources.tr.resx
@@ -120,9 +120,6 @@
Göster
-
- Geçmiş: {0}
-
Filtrelenmiş: {0}
diff --git a/ShareX.HistoryLib/Properties/Resources.vi-VN.resx b/ShareX.HistoryLib/Properties/Resources.vi-VN.resx
index da4b0ec36..2204c3e93 100644
--- a/ShareX.HistoryLib/Properties/Resources.vi-VN.resx
+++ b/ShareX.HistoryLib/Properties/Resources.vi-VN.resx
@@ -162,9 +162,6 @@
Ảnh kèm đường dẫn cho Forum (BBCode)
-
- Lịch sử: {0}
-
Đã lọc: {0}
diff --git a/ShareX.HistoryLib/Properties/Resources.zh-CN.resx b/ShareX.HistoryLib/Properties/Resources.zh-CN.resx
index 98058656c..d1552b68d 100644
--- a/ShareX.HistoryLib/Properties/Resources.zh-CN.resx
+++ b/ShareX.HistoryLib/Properties/Resources.zh-CN.resx
@@ -117,9 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 历史: {0}
-
过滤: {0}