mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Added "Show stats" button to history form
This commit is contained in:
parent
f937a5d093
commit
1f9bcaf902
5 changed files with 197 additions and 19 deletions
|
@ -694,5 +694,20 @@ public static void DoubleBuffered(this DataGridView dgv, bool value)
|
||||||
PropertyInfo pi = dgv.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
PropertyInfo pi = dgv.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||||
pi.SetValue(dgv, value, null);
|
pi.SetValue(dgv, value, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void AppendLine(this RichTextBox rtb, string value = "")
|
||||||
|
{
|
||||||
|
rtb.AppendText(value + Environment.NewLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetFontRegular(this RichTextBox rtb)
|
||||||
|
{
|
||||||
|
rtb.SelectionFont = new Font(rtb.Font, FontStyle.Regular);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetFontBold(this RichTextBox rtb)
|
||||||
|
{
|
||||||
|
rtb.SelectionFont = new Font(rtb.Font, FontStyle.Bold);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
22
ShareX.HistoryLib/Forms/HistoryForm.Designer.cs
generated
22
ShareX.HistoryLib/Forms/HistoryForm.Designer.cs
generated
|
@ -31,12 +31,14 @@ private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HistoryForm));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HistoryForm));
|
||||||
this.scMain = new ShareX.HelpersLib.SplitContainerCustomSplitter();
|
this.scMain = new ShareX.HelpersLib.SplitContainerCustomSplitter();
|
||||||
|
this.rtbStats = new System.Windows.Forms.RichTextBox();
|
||||||
this.lvHistory = new ShareX.HelpersLib.MyListView();
|
this.lvHistory = new ShareX.HelpersLib.MyListView();
|
||||||
this.chIcon = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.chIcon = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.chDateTime = ((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.chFilename = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.chURL = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.chURL = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.panel1 = new System.Windows.Forms.Panel();
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
|
this.btnShowStats = new System.Windows.Forms.Button();
|
||||||
this.pbThumbnail = new ShareX.HelpersLib.MyPictureBox();
|
this.pbThumbnail = new ShareX.HelpersLib.MyPictureBox();
|
||||||
this.gbFilters = new System.Windows.Forms.GroupBox();
|
this.gbFilters = new System.Windows.Forms.GroupBox();
|
||||||
this.lblURLFilter = new System.Windows.Forms.Label();
|
this.lblURLFilter = new System.Windows.Forms.Label();
|
||||||
|
@ -70,13 +72,22 @@ private void InitializeComponent()
|
||||||
//
|
//
|
||||||
// scMain.Panel1
|
// scMain.Panel1
|
||||||
//
|
//
|
||||||
|
this.scMain.Panel1.Controls.Add(this.rtbStats);
|
||||||
this.scMain.Panel1.Controls.Add(this.lvHistory);
|
this.scMain.Panel1.Controls.Add(this.lvHistory);
|
||||||
//
|
//
|
||||||
// scMain.Panel2
|
// scMain.Panel2
|
||||||
//
|
//
|
||||||
this.scMain.Panel2.Controls.Add(this.panel1);
|
this.scMain.Panel2.Controls.Add(this.panel1);
|
||||||
|
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.scMain.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.scMain_SplitterMoved);
|
||||||
//
|
//
|
||||||
|
// rtbStats
|
||||||
|
//
|
||||||
|
this.rtbStats.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
resources.ApplyResources(this.rtbStats, "rtbStats");
|
||||||
|
this.rtbStats.Name = "rtbStats";
|
||||||
|
//
|
||||||
// lvHistory
|
// lvHistory
|
||||||
//
|
//
|
||||||
this.lvHistory.AllowColumnSort = true;
|
this.lvHistory.AllowColumnSort = true;
|
||||||
|
@ -117,11 +128,19 @@ private void InitializeComponent()
|
||||||
//
|
//
|
||||||
// panel1
|
// panel1
|
||||||
//
|
//
|
||||||
|
this.panel1.Controls.Add(this.btnShowStats);
|
||||||
this.panel1.Controls.Add(this.pbThumbnail);
|
this.panel1.Controls.Add(this.pbThumbnail);
|
||||||
this.panel1.Controls.Add(this.gbFilters);
|
this.panel1.Controls.Add(this.gbFilters);
|
||||||
resources.ApplyResources(this.panel1, "panel1");
|
resources.ApplyResources(this.panel1, "panel1");
|
||||||
this.panel1.Name = "panel1";
|
this.panel1.Name = "panel1";
|
||||||
//
|
//
|
||||||
|
// btnShowStats
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.btnShowStats, "btnShowStats");
|
||||||
|
this.btnShowStats.Name = "btnShowStats";
|
||||||
|
this.btnShowStats.UseVisualStyleBackColor = true;
|
||||||
|
this.btnShowStats.Click += new System.EventHandler(this.BtnShowStats_Click);
|
||||||
|
//
|
||||||
// pbThumbnail
|
// pbThumbnail
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.pbThumbnail, "pbThumbnail");
|
resources.ApplyResources(this.pbThumbnail, "pbThumbnail");
|
||||||
|
@ -130,6 +149,7 @@ private void InitializeComponent()
|
||||||
this.pbThumbnail.DrawCheckeredBackground = true;
|
this.pbThumbnail.DrawCheckeredBackground = true;
|
||||||
this.pbThumbnail.FullscreenOnClick = true;
|
this.pbThumbnail.FullscreenOnClick = true;
|
||||||
this.pbThumbnail.Name = "pbThumbnail";
|
this.pbThumbnail.Name = "pbThumbnail";
|
||||||
|
this.pbThumbnail.PictureBoxBackColor = System.Drawing.SystemColors.Control;
|
||||||
this.pbThumbnail.ShowImageSizeLabel = true;
|
this.pbThumbnail.ShowImageSizeLabel = true;
|
||||||
//
|
//
|
||||||
// gbFilters
|
// gbFilters
|
||||||
|
@ -286,5 +306,7 @@ private void InitializeComponent()
|
||||||
private System.Windows.Forms.Label lblFilenameFilter;
|
private System.Windows.Forms.Label lblFilenameFilter;
|
||||||
private System.Windows.Forms.Label lblURLFilter;
|
private System.Windows.Forms.Label lblURLFilter;
|
||||||
private System.Windows.Forms.TextBox txtURLFilter;
|
private System.Windows.Forms.TextBox txtURLFilter;
|
||||||
|
private System.Windows.Forms.Button btnShowStats;
|
||||||
|
private System.Windows.Forms.RichTextBox rtbStats;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -44,6 +44,7 @@ public partial class HistoryForm : Form
|
||||||
private HistoryItemManager him;
|
private HistoryItemManager him;
|
||||||
private HistoryItem[] allHistoryItems;
|
private HistoryItem[] allHistoryItems;
|
||||||
private string defaultTitle;
|
private string defaultTitle;
|
||||||
|
private bool showingStats;
|
||||||
|
|
||||||
public HistoryForm(string historyPath, HistorySettings settings, Action<string> uploadFile = null, Action<string> editImage = null)
|
public HistoryForm(string historyPath, HistorySettings settings, Action<string> uploadFile = null, Action<string> editImage = null)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +54,7 @@ public HistoryForm(string historyPath, HistorySettings settings, Action<string>
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Icon = ShareXResources.Icon;
|
Icon = ShareXResources.Icon;
|
||||||
defaultTitle = Text;
|
defaultTitle = Text;
|
||||||
UpdateTitle();
|
//UpdateTitle();
|
||||||
|
|
||||||
// Mark the Date column as having a date; used for sorting
|
// Mark the Date column as having a date; used for sorting
|
||||||
chDateTime.Tag = new DateTime();
|
chDateTime.Tag = new DateTime();
|
||||||
|
@ -86,6 +87,63 @@ private void RefreshHistoryItems()
|
||||||
ApplyFiltersAndAdd();
|
ApplyFiltersAndAdd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OutputStats(HistoryItem[] historyItems)
|
||||||
|
{
|
||||||
|
rtbStats.ResetText();
|
||||||
|
|
||||||
|
rtbStats.SetFontBold();
|
||||||
|
rtbStats.AppendLine("History item counts:");
|
||||||
|
rtbStats.SetFontRegular();
|
||||||
|
rtbStats.AppendLine("Total: " + historyItems.Length);
|
||||||
|
|
||||||
|
IEnumerable<string> types = historyItems.
|
||||||
|
Select(x => x.Type).
|
||||||
|
GroupBy(x => x).
|
||||||
|
OrderByDescending(x => x.Count()).
|
||||||
|
Select(x => string.Format("{0}: {1}", x.Key, x.Count()));
|
||||||
|
|
||||||
|
rtbStats.AppendLine(string.Join(Environment.NewLine, types));
|
||||||
|
|
||||||
|
rtbStats.AppendLine();
|
||||||
|
rtbStats.SetFontBold();
|
||||||
|
rtbStats.AppendLine("Yearly usages:");
|
||||||
|
rtbStats.SetFontRegular();
|
||||||
|
|
||||||
|
IEnumerable<string> 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("File extensions:");
|
||||||
|
rtbStats.SetFontRegular();
|
||||||
|
|
||||||
|
IEnumerable<string> 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("Hosts:");
|
||||||
|
rtbStats.SetFontRegular();
|
||||||
|
|
||||||
|
IEnumerable<string> hosts = historyItems.
|
||||||
|
Select(x => x.Host).
|
||||||
|
GroupBy(x => x).
|
||||||
|
OrderByDescending(x => x.Count()).
|
||||||
|
Select(x => string.Format("{0} ({1})", x.Key, x.Count()));
|
||||||
|
|
||||||
|
rtbStats.AppendLine(string.Join(Environment.NewLine, hosts));
|
||||||
|
}
|
||||||
|
|
||||||
private HistoryItem[] him_GetHistoryItems()
|
private HistoryItem[] him_GetHistoryItems()
|
||||||
{
|
{
|
||||||
return lvHistory.SelectedItems.Cast<ListViewItem>().Select(x => x.Tag as HistoryItem).ToArray();
|
return lvHistory.SelectedItems.Cast<ListViewItem>().Select(x => x.Tag as HistoryItem).ToArray();
|
||||||
|
@ -177,7 +235,7 @@ private void AddHistoryItems(HistoryItem[] historyItems)
|
||||||
{
|
{
|
||||||
Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
|
|
||||||
UpdateTitle(historyItems);
|
//UpdateTitle(historyItems);
|
||||||
|
|
||||||
lvHistory.Items.Clear();
|
lvHistory.Items.Clear();
|
||||||
|
|
||||||
|
@ -340,6 +398,29 @@ private void btnRemoveFilters_Click(object sender, EventArgs e)
|
||||||
AddHistoryItems(allHistoryItems);
|
AddHistoryItems(allHistoryItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BtnShowStats_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (showingStats)
|
||||||
|
{
|
||||||
|
lvHistory.Visible = true;
|
||||||
|
rtbStats.Visible = false;
|
||||||
|
// TODO: Translate
|
||||||
|
btnShowStats.Text = "Show stats";
|
||||||
|
showingStats = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rtbStats.Visible = true;
|
||||||
|
lvHistory.Visible = false;
|
||||||
|
// TODO: Translate
|
||||||
|
btnShowStats.Text = "Hide stats";
|
||||||
|
Cursor = Cursors.WaitCursor;
|
||||||
|
OutputStats(allHistoryItems);
|
||||||
|
Cursor = Cursors.Default;
|
||||||
|
showingStats = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void lvHistory_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
|
private void lvHistory_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.IsSelected)
|
if (e.IsSelected)
|
||||||
|
|
|
@ -125,10 +125,43 @@
|
||||||
<data name="scMain.Location" type="System.Drawing.Point, System.Drawing">
|
<data name="scMain.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
<value>0, 0</value>
|
<value>0, 0</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="rtbStats.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||||
|
<value>Fill</value>
|
||||||
|
</data>
|
||||||
|
<data name="rtbStats.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
|
<value>Arial, 9.75pt</value>
|
||||||
|
</data>
|
||||||
|
<data name="rtbStats.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>0, 0</value>
|
||||||
|
</data>
|
||||||
|
<data name="rtbStats.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>550, 641</value>
|
||||||
|
</data>
|
||||||
|
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="rtbStats.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name="rtbStats.Text" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
|
<data name="rtbStats.Visible" type="System.Boolean, mscorlib">
|
||||||
|
<value>False</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>rtbStats.Name" xml:space="preserve">
|
||||||
|
<value>rtbStats</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>rtbStats.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.RichTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>rtbStats.Parent" xml:space="preserve">
|
||||||
|
<value>scMain.Panel1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>rtbStats.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
<data name="chIcon.Text" xml:space="preserve">
|
<data name="chIcon.Text" xml:space="preserve">
|
||||||
<value />
|
<value />
|
||||||
</data>
|
</data>
|
||||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
|
||||||
<data name="chIcon.Width" type="System.Int32, mscorlib">
|
<data name="chIcon.Width" type="System.Int32, mscorlib">
|
||||||
<value>24</value>
|
<value>24</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -166,13 +199,13 @@
|
||||||
<value>lvHistory</value>
|
<value>lvHistory</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>lvHistory.Type" xml:space="preserve">
|
<data name=">>lvHistory.Type" xml:space="preserve">
|
||||||
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=12.3.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>lvHistory.Parent" xml:space="preserve">
|
<data name=">>lvHistory.Parent" xml:space="preserve">
|
||||||
<value>scMain.Panel1</value>
|
<value>scMain.Panel1</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>lvHistory.ZOrder" xml:space="preserve">
|
<data name=">>lvHistory.ZOrder" xml:space="preserve">
|
||||||
<value>0</value>
|
<value>1</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>scMain.Panel1.Name" xml:space="preserve">
|
<data name=">>scMain.Panel1.Name" xml:space="preserve">
|
||||||
<value>scMain.Panel1</value>
|
<value>scMain.Panel1</value>
|
||||||
|
@ -189,6 +222,33 @@
|
||||||
<data name="scMain.Panel1MinSize" type="System.Int32, mscorlib">
|
<data name="scMain.Panel1MinSize" type="System.Int32, mscorlib">
|
||||||
<value>100</value>
|
<value>100</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="btnShowStats.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||||
|
<value>Bottom, Left</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnShowStats.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>8, 608</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnShowStats.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>144, 24</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnShowStats.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>5</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnShowStats.Text" xml:space="preserve">
|
||||||
|
<value>Show stats</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>btnShowStats.Name" xml:space="preserve">
|
||||||
|
<value>btnShowStats</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>btnShowStats.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>btnShowStats.Parent" xml:space="preserve">
|
||||||
|
<value>panel1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>btnShowStats.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
<data name="pbThumbnail.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
<data name="pbThumbnail.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||||
<value>Top, Bottom, Left, Right</value>
|
<value>Top, Bottom, Left, Right</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -196,7 +256,7 @@
|
||||||
<value>8, 8</value>
|
<value>8, 8</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="pbThumbnail.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="pbThumbnail.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>408, 384</value>
|
<value>408, 352</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="pbThumbnail.TabIndex" type="System.Int32, mscorlib">
|
<data name="pbThumbnail.TabIndex" type="System.Int32, mscorlib">
|
||||||
<value>3</value>
|
<value>3</value>
|
||||||
|
@ -205,13 +265,13 @@
|
||||||
<value>pbThumbnail</value>
|
<value>pbThumbnail</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>pbThumbnail.Type" xml:space="preserve">
|
<data name=">>pbThumbnail.Type" xml:space="preserve">
|
||||||
<value>ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=12.3.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>pbThumbnail.Parent" xml:space="preserve">
|
<data name=">>pbThumbnail.Parent" xml:space="preserve">
|
||||||
<value>panel1</value>
|
<value>panel1</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>pbThumbnail.ZOrder" xml:space="preserve">
|
<data name=">>pbThumbnail.ZOrder" xml:space="preserve">
|
||||||
<value>0</value>
|
<value>1</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="gbFilters.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
<data name="gbFilters.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||||
<value>Bottom, Left, Right</value>
|
<value>Bottom, Left, Right</value>
|
||||||
|
@ -601,7 +661,7 @@
|
||||||
<value>14</value>
|
<value>14</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="gbFilters.Location" type="System.Drawing.Point, System.Drawing">
|
<data name="gbFilters.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
<value>8, 400</value>
|
<value>8, 368</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="gbFilters.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="gbFilters.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>408, 234</value>
|
<value>408, 234</value>
|
||||||
|
@ -622,7 +682,7 @@
|
||||||
<value>panel1</value>
|
<value>panel1</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>gbFilters.ZOrder" xml:space="preserve">
|
<data name=">>gbFilters.ZOrder" xml:space="preserve">
|
||||||
<value>1</value>
|
<value>2</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||||
<value>Fill</value>
|
<value>Fill</value>
|
||||||
|
@ -679,7 +739,7 @@
|
||||||
<value>scMain</value>
|
<value>scMain</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>scMain.Type" xml:space="preserve">
|
<data name=">>scMain.Type" xml:space="preserve">
|
||||||
<value>ShareX.HelpersLib.SplitContainerCustomSplitter, ShareX.HelpersLib, Version=12.3.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>ShareX.HelpersLib.SplitContainerCustomSplitter, ShareX.HelpersLib, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>scMain.Parent" xml:space="preserve">
|
<data name=">>scMain.Parent" xml:space="preserve">
|
||||||
<value>$this</value>
|
<value>$this</value>
|
||||||
|
|
|
@ -768,32 +768,32 @@ private void UpdateResponseInfoTextBox(ResponseInfo responseInfo, bool includeRe
|
||||||
{
|
{
|
||||||
rtbResponseInfo.ResetText();
|
rtbResponseInfo.ResetText();
|
||||||
|
|
||||||
rtbResponseInfo.SelectionFont = new Font(rtbResponseInfo.Font, FontStyle.Bold);
|
rtbResponseInfo.SetFontBold();
|
||||||
rtbResponseInfo.AppendText("Status code:\r\n");
|
rtbResponseInfo.AppendText("Status code:\r\n");
|
||||||
rtbResponseInfo.SelectionFont = new Font(rtbResponseInfo.Font, FontStyle.Regular);
|
rtbResponseInfo.SetFontRegular();
|
||||||
rtbResponseInfo.AppendText($"({(int)responseInfo.StatusCode}) {responseInfo.StatusDescription}");
|
rtbResponseInfo.AppendText($"({(int)responseInfo.StatusCode}) {responseInfo.StatusDescription}");
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(responseInfo.ResponseURL))
|
if (!string.IsNullOrEmpty(responseInfo.ResponseURL))
|
||||||
{
|
{
|
||||||
rtbResponseInfo.SelectionFont = new Font(rtbResponseInfo.Font, FontStyle.Bold);
|
rtbResponseInfo.SetFontBold();
|
||||||
rtbResponseInfo.AppendText("\r\n\r\nResponse URL:\r\n");
|
rtbResponseInfo.AppendText("\r\n\r\nResponse URL:\r\n");
|
||||||
rtbResponseInfo.SelectionFont = new Font(rtbResponseInfo.Font, FontStyle.Regular);
|
rtbResponseInfo.SetFontRegular();
|
||||||
rtbResponseInfo.AppendText(responseInfo.ResponseURL);
|
rtbResponseInfo.AppendText(responseInfo.ResponseURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (responseInfo.Headers != null && responseInfo.Headers.Count > 0)
|
if (responseInfo.Headers != null && responseInfo.Headers.Count > 0)
|
||||||
{
|
{
|
||||||
rtbResponseInfo.SelectionFont = new Font(rtbResponseInfo.Font, FontStyle.Bold);
|
rtbResponseInfo.SetFontBold();
|
||||||
rtbResponseInfo.AppendText("\r\n\r\nHeaders:\r\n");
|
rtbResponseInfo.AppendText("\r\n\r\nHeaders:\r\n");
|
||||||
rtbResponseInfo.SelectionFont = new Font(rtbResponseInfo.Font, FontStyle.Regular);
|
rtbResponseInfo.SetFontRegular();
|
||||||
rtbResponseInfo.AppendText(responseInfo.Headers.ToString().TrimEnd('\r', '\n'));
|
rtbResponseInfo.AppendText(responseInfo.Headers.ToString().TrimEnd('\r', '\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includeResponseText && !string.IsNullOrEmpty(responseInfo.ResponseText))
|
if (includeResponseText && !string.IsNullOrEmpty(responseInfo.ResponseText))
|
||||||
{
|
{
|
||||||
rtbResponseInfo.SelectionFont = new Font(rtbResponseInfo.Font, FontStyle.Bold);
|
rtbResponseInfo.SetFontBold();
|
||||||
rtbResponseInfo.AppendText("\r\n\r\nResponse text:\r\n");
|
rtbResponseInfo.AppendText("\r\n\r\nResponse text:\r\n");
|
||||||
rtbResponseInfo.SelectionFont = new Font(rtbResponseInfo.Font, FontStyle.Regular);
|
rtbResponseInfo.SetFontRegular();
|
||||||
rtbResponseInfo.AppendText(responseInfo.ResponseText);
|
rtbResponseInfo.AppendText(responseInfo.ResponseText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue