Added error message textbox to custom uploader settings form

This commit is contained in:
Jaex 2020-09-22 09:53:01 +03:00
parent f4f29f911a
commit e4aea5e8f4
5 changed files with 1559 additions and 836 deletions

View file

@ -103,6 +103,9 @@ public bool ShouldSerializeArguments() => (Body == CustomUploaderBody.MultipartF
[DefaultValue("")] [DefaultValue("")]
public string DeletionURL { get; set; } public string DeletionURL { get; set; }
[DefaultValue("")]
public string ErrorMessage { get; set; }
private CustomUploaderItem() private CustomUploaderItem()
{ {
} }

View file

@ -340,11 +340,12 @@ public enum OAuthLoginStatus
LoginFailed LoginFailed
} }
public enum URLType public enum CustomUploaderURLType
{ {
URL, URL,
ThumbnailURL, ThumbnailURL,
DeletionURL DeletionURL,
ErrorMessage
} }
public enum YouTubeVideoPrivacy // Localized public enum YouTubeVideoPrivacy // Localized

View file

@ -30,14 +30,14 @@ private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CustomUploaderSettingsForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CustomUploaderSettingsForm));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
this.tscResponseText = new System.Windows.Forms.ToolStripContainer(); this.tscResponseText = new System.Windows.Forms.ToolStripContainer();
this.pResponseText = new System.Windows.Forms.Panel(); this.pResponseText = new System.Windows.Forms.Panel();
this.rtbResponseText = new System.Windows.Forms.RichTextBox(); this.rtbResponseText = new System.Windows.Forms.RichTextBox();
@ -99,6 +99,9 @@ private void InitializeComponent()
this.pData = new System.Windows.Forms.Panel(); this.pData = new System.Windows.Forms.Panel();
this.rtbData = new System.Windows.Forms.RichTextBox(); this.rtbData = new System.Windows.Forms.RichTextBox();
this.tpResponse = new System.Windows.Forms.TabPage(); this.tpResponse = new System.Windows.Forms.TabPage();
this.pResultErrorMessage = new System.Windows.Forms.Panel();
this.rtbResultErrorMessage = new System.Windows.Forms.RichTextBox();
this.lblResultErrorMessage = new System.Windows.Forms.Label();
this.lblParseResponse = new System.Windows.Forms.Label(); this.lblParseResponse = new System.Windows.Forms.Label();
this.pResultDeletionURL = new System.Windows.Forms.Panel(); this.pResultDeletionURL = new System.Windows.Forms.Panel();
this.rtbResultDeletionURL = new System.Windows.Forms.RichTextBox(); this.rtbResultDeletionURL = new System.Windows.Forms.RichTextBox();
@ -162,6 +165,7 @@ private void InitializeComponent()
this.pBodyData.SuspendLayout(); this.pBodyData.SuspendLayout();
this.pData.SuspendLayout(); this.pData.SuspendLayout();
this.tpResponse.SuspendLayout(); this.tpResponse.SuspendLayout();
this.pResultErrorMessage.SuspendLayout();
this.pResultDeletionURL.SuspendLayout(); this.pResultDeletionURL.SuspendLayout();
this.pResultThumbnailURL.SuspendLayout(); this.pResultThumbnailURL.SuspendLayout();
this.pResultURL.SuspendLayout(); this.pResultURL.SuspendLayout();
@ -367,6 +371,7 @@ private void InitializeComponent()
resources.ApplyResources(this.eiCustomUploaders, "eiCustomUploaders"); resources.ApplyResources(this.eiCustomUploaders, "eiCustomUploaders");
this.eiCustomUploaders.Name = "eiCustomUploaders"; this.eiCustomUploaders.Name = "eiCustomUploaders";
this.eiCustomUploaders.ObjectType = null; this.eiCustomUploaders.ObjectType = null;
this.eiCustomUploaders.SerializationBinder = null;
this.eiCustomUploaders.ExportRequested += new ShareX.HelpersLib.ExportImportControl.ExportEventHandler(this.eiCustomUploaders_ExportRequested); this.eiCustomUploaders.ExportRequested += new ShareX.HelpersLib.ExportImportControl.ExportEventHandler(this.eiCustomUploaders_ExportRequested);
this.eiCustomUploaders.ImportRequested += new ShareX.HelpersLib.ExportImportControl.ImportEventHandler(this.eiCustomUploaders_ImportRequested); this.eiCustomUploaders.ImportRequested += new ShareX.HelpersLib.ExportImportControl.ImportEventHandler(this.eiCustomUploaders_ImportRequested);
this.eiCustomUploaders.ImportCompleted += new System.Action(this.eiCustomUploaders_ImportCompleted); this.eiCustomUploaders.ImportCompleted += new System.Action(this.eiCustomUploaders_ImportCompleted);
@ -457,28 +462,28 @@ private void InitializeComponent()
this.dgvHeaders.AllowUserToResizeRows = false; this.dgvHeaders.AllowUserToResizeRows = false;
this.dgvHeaders.BackgroundColor = System.Drawing.SystemColors.Window; this.dgvHeaders.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvHeaders.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; this.dgvHeaders.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle17.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle17.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle17.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle1.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2); dataGridViewCellStyle17.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle17.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvHeaders.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dgvHeaders.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17;
this.dgvHeaders.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvHeaders.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvHeaders.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dgvHeaders.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.cHeadersName, this.cHeadersName,
this.cHeadersValue}); this.cHeadersValue});
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle18.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(1, 0, 0, 0); dataGridViewCellStyle18.Padding = new System.Windows.Forms.Padding(1, 0, 0, 0);
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvHeaders.DefaultCellStyle = dataGridViewCellStyle2; this.dgvHeaders.DefaultCellStyle = dataGridViewCellStyle18;
this.dgvHeaders.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.dgvHeaders.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dgvHeaders.GridColor = System.Drawing.SystemColors.ControlLight; this.dgvHeaders.GridColor = System.Drawing.SystemColors.ControlLight;
resources.ApplyResources(this.dgvHeaders, "dgvHeaders"); resources.ApplyResources(this.dgvHeaders, "dgvHeaders");
@ -506,28 +511,28 @@ private void InitializeComponent()
this.dgvParameters.AllowUserToResizeRows = false; this.dgvParameters.AllowUserToResizeRows = false;
this.dgvParameters.BackgroundColor = System.Drawing.SystemColors.Window; this.dgvParameters.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvParameters.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; this.dgvParameters.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle19.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle3.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2); dataGridViewCellStyle19.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvParameters.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; this.dgvParameters.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle19;
this.dgvParameters.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvParameters.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvParameters.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dgvParameters.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.cParametersName, this.cParametersName,
this.cParametersValue}); this.cParametersValue});
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle20.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle20.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle20.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle4.Padding = new System.Windows.Forms.Padding(1, 0, 0, 0); dataGridViewCellStyle20.Padding = new System.Windows.Forms.Padding(1, 0, 0, 0);
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle20.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle20.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvParameters.DefaultCellStyle = dataGridViewCellStyle4; this.dgvParameters.DefaultCellStyle = dataGridViewCellStyle20;
this.dgvParameters.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.dgvParameters.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dgvParameters.GridColor = System.Drawing.SystemColors.ControlLight; this.dgvParameters.GridColor = System.Drawing.SystemColors.ControlLight;
resources.ApplyResources(this.dgvParameters, "dgvParameters"); resources.ApplyResources(this.dgvParameters, "dgvParameters");
@ -620,28 +625,28 @@ private void InitializeComponent()
this.dgvArguments.AllowUserToResizeRows = false; this.dgvArguments.AllowUserToResizeRows = false;
this.dgvArguments.BackgroundColor = System.Drawing.SystemColors.Window; this.dgvArguments.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvArguments.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; this.dgvArguments.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle21.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle5.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2); dataGridViewCellStyle21.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle21.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle21.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvArguments.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; this.dgvArguments.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle21;
this.dgvArguments.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvArguments.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvArguments.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dgvArguments.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.cArgumentsName, this.cArgumentsName,
this.cArgumentsValue}); this.cArgumentsValue});
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle22.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle22.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle22.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle6.Padding = new System.Windows.Forms.Padding(1, 0, 0, 0); dataGridViewCellStyle22.Padding = new System.Windows.Forms.Padding(1, 0, 0, 0);
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle22.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle22.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvArguments.DefaultCellStyle = dataGridViewCellStyle6; this.dgvArguments.DefaultCellStyle = dataGridViewCellStyle22;
this.dgvArguments.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.dgvArguments.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dgvArguments.GridColor = System.Drawing.SystemColors.ControlLight; this.dgvArguments.GridColor = System.Drawing.SystemColors.ControlLight;
resources.ApplyResources(this.dgvArguments, "dgvArguments"); resources.ApplyResources(this.dgvArguments, "dgvArguments");
@ -714,6 +719,8 @@ private void InitializeComponent()
// //
// tpResponse // tpResponse
// //
this.tpResponse.Controls.Add(this.pResultErrorMessage);
this.tpResponse.Controls.Add(this.lblResultErrorMessage);
this.tpResponse.Controls.Add(this.lblParseResponse); this.tpResponse.Controls.Add(this.lblParseResponse);
this.tpResponse.Controls.Add(this.pResultDeletionURL); this.tpResponse.Controls.Add(this.pResultDeletionURL);
this.tpResponse.Controls.Add(this.lblResultDeletionURL); this.tpResponse.Controls.Add(this.lblResultDeletionURL);
@ -726,6 +733,27 @@ private void InitializeComponent()
this.tpResponse.Name = "tpResponse"; this.tpResponse.Name = "tpResponse";
this.tpResponse.UseVisualStyleBackColor = true; this.tpResponse.UseVisualStyleBackColor = true;
// //
// pResultErrorMessage
//
this.pResultErrorMessage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pResultErrorMessage.Controls.Add(this.rtbResultErrorMessage);
resources.ApplyResources(this.pResultErrorMessage, "pResultErrorMessage");
this.pResultErrorMessage.Name = "pResultErrorMessage";
//
// rtbResultErrorMessage
//
this.rtbResultErrorMessage.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbResultErrorMessage.DetectUrls = false;
resources.ApplyResources(this.rtbResultErrorMessage, "rtbResultErrorMessage");
this.rtbResultErrorMessage.Name = "rtbResultErrorMessage";
this.rtbResultErrorMessage.TextChanged += new System.EventHandler(this.rtbResultErrorMessage_TextChanged);
this.rtbResultErrorMessage.Enter += new System.EventHandler(this.rtbResultErrorMessage_Enter);
//
// lblResultErrorMessage
//
resources.ApplyResources(this.lblResultErrorMessage, "lblResultErrorMessage");
this.lblResultErrorMessage.Name = "lblResultErrorMessage";
//
// lblParseResponse // lblParseResponse
// //
resources.ApplyResources(this.lblParseResponse, "lblParseResponse"); resources.ApplyResources(this.lblParseResponse, "lblParseResponse");
@ -904,28 +932,28 @@ private void InitializeComponent()
this.dgvRegex.AllowUserToResizeRows = false; this.dgvRegex.AllowUserToResizeRows = false;
this.dgvRegex.BackgroundColor = System.Drawing.SystemColors.Window; this.dgvRegex.BackgroundColor = System.Drawing.SystemColors.Window;
this.dgvRegex.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; this.dgvRegex.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle23.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle23.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle23.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle7.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2); dataGridViewCellStyle23.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle23.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle23.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle23.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvRegex.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; this.dgvRegex.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle23;
this.dgvRegex.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvRegex.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvRegex.ColumnHeadersVisible = false; this.dgvRegex.ColumnHeadersVisible = false;
this.dgvRegex.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dgvRegex.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.cRegex}); this.cRegex});
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle24.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle8.Padding = new System.Windows.Forms.Padding(1, 0, 0, 0); dataGridViewCellStyle24.Padding = new System.Windows.Forms.Padding(1, 0, 0, 0);
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvRegex.DefaultCellStyle = dataGridViewCellStyle8; this.dgvRegex.DefaultCellStyle = dataGridViewCellStyle24;
this.dgvRegex.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.dgvRegex.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dgvRegex.GridColor = System.Drawing.SystemColors.ControlLight; this.dgvRegex.GridColor = System.Drawing.SystemColors.ControlLight;
resources.ApplyResources(this.dgvRegex, "dgvRegex"); resources.ApplyResources(this.dgvRegex, "dgvRegex");
@ -1081,7 +1109,6 @@ private void InitializeComponent()
// //
this.AllowDrop = true; this.AllowDrop = true;
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.SystemColors.Window; this.BackColor = System.Drawing.SystemColors.Window;
this.Controls.Add(this.tcCustomUploader); this.Controls.Add(this.tcCustomUploader);
@ -1132,6 +1159,7 @@ private void InitializeComponent()
this.pData.ResumeLayout(false); this.pData.ResumeLayout(false);
this.tpResponse.ResumeLayout(false); this.tpResponse.ResumeLayout(false);
this.tpResponse.PerformLayout(); this.tpResponse.PerformLayout();
this.pResultErrorMessage.ResumeLayout(false);
this.pResultDeletionURL.ResumeLayout(false); this.pResultDeletionURL.ResumeLayout(false);
this.pResultThumbnailURL.ResumeLayout(false); this.pResultThumbnailURL.ResumeLayout(false);
this.pResultURL.ResumeLayout(false); this.pResultURL.ResumeLayout(false);
@ -1264,5 +1292,8 @@ private void InitializeComponent()
private System.Windows.Forms.Panel pResponseInfo; private System.Windows.Forms.Panel pResponseInfo;
private System.Windows.Forms.RichTextBox rtbResponseInfo; private System.Windows.Forms.RichTextBox rtbResponseInfo;
private System.Windows.Forms.ToolStripMenuItem tsmiUpdateFolder; private System.Windows.Forms.ToolStripMenuItem tsmiUpdateFolder;
private System.Windows.Forms.Panel pResultErrorMessage;
private System.Windows.Forms.RichTextBox rtbResultErrorMessage;
private System.Windows.Forms.Label lblResultErrorMessage;
} }
} }

View file

@ -52,7 +52,7 @@ public partial class CustomUploaderSettingsForm : Form
public UploadersConfig Config { get; private set; } public UploadersConfig Config { get; private set; }
private bool customUploaderPauseLoad; private bool customUploaderPauseLoad;
private URLType customUploaderURLType = URLType.URL; private CustomUploaderURLType customUploaderURLType = CustomUploaderURLType.URL;
public CustomUploaderSettingsForm(UploadersConfig config) public CustomUploaderSettingsForm(UploadersConfig config)
{ {
@ -90,12 +90,14 @@ public CustomUploaderSettingsForm(UploadersConfig config)
new CodeMenu(rtbResultURL, outputCodeMenuItems); new CodeMenu(rtbResultURL, outputCodeMenuItems);
new CodeMenu(rtbResultThumbnailURL, outputCodeMenuItems); new CodeMenu(rtbResultThumbnailURL, outputCodeMenuItems);
new CodeMenu(rtbResultDeletionURL, outputCodeMenuItems); new CodeMenu(rtbResultDeletionURL, outputCodeMenuItems);
new CodeMenu(rtbResultErrorMessage, outputCodeMenuItems);
rtbRequestURL.AddContextMenu(); rtbRequestURL.AddContextMenu();
rtbData.AddContextMenu(); rtbData.AddContextMenu();
rtbResultURL.AddContextMenu(); rtbResultURL.AddContextMenu();
rtbResultThumbnailURL.AddContextMenu(); rtbResultThumbnailURL.AddContextMenu();
rtbResultDeletionURL.AddContextMenu(); rtbResultDeletionURL.AddContextMenu();
rtbResultErrorMessage.AddContextMenu();
rtbResult.AddContextMenu(); rtbResult.AddContextMenu();
rtbResponseInfo.AddContextMenu(); rtbResponseInfo.AddContextMenu();
rtbResponseText.AddContextMenu(); rtbResponseText.AddContextMenu();
@ -216,12 +218,14 @@ private void CustomUploaderLoad(CustomUploaderItem uploader)
} }
} }
rtbResultURL.Text = uploader.URL ?? ""; rtbResultURL.Text = uploader.URL;
CustomUploaderSyntaxHighlight(rtbResultURL); CustomUploaderSyntaxHighlight(rtbResultURL);
rtbResultThumbnailURL.Text = uploader.ThumbnailURL ?? ""; rtbResultThumbnailURL.Text = uploader.ThumbnailURL;
CustomUploaderSyntaxHighlight(rtbResultThumbnailURL); CustomUploaderSyntaxHighlight(rtbResultThumbnailURL);
rtbResultDeletionURL.Text = uploader.DeletionURL ?? ""; rtbResultDeletionURL.Text = uploader.DeletionURL;
CustomUploaderSyntaxHighlight(rtbResultDeletionURL); CustomUploaderSyntaxHighlight(rtbResultDeletionURL);
rtbResultErrorMessage.Text = uploader.ErrorMessage;
CustomUploaderSyntaxHighlight(rtbResultErrorMessage);
CustomUploaderUpdateStates(); CustomUploaderUpdateStates();
} }
@ -630,15 +634,18 @@ private void AddTextToActiveURLField(string text)
switch (customUploaderURLType) switch (customUploaderURLType)
{ {
default: default:
case URLType.URL: case CustomUploaderURLType.URL:
rtb = rtbResultURL; rtb = rtbResultURL;
break; break;
case URLType.ThumbnailURL: case CustomUploaderURLType.ThumbnailURL:
rtb = rtbResultThumbnailURL; rtb = rtbResultThumbnailURL;
break; break;
case URLType.DeletionURL: case CustomUploaderURLType.DeletionURL:
rtb = rtbResultDeletionURL; rtb = rtbResultDeletionURL;
break; break;
case CustomUploaderURLType.ErrorMessage:
rtb = rtbResultErrorMessage;
break;
} }
rtb.AppendText(text); rtb.AppendText(text);
@ -1251,7 +1258,7 @@ private void btnCustomUploaderRegexAddSyntax_Click(object sender, EventArgs e)
private void rtbCustomUploaderURL_Enter(object sender, EventArgs e) private void rtbCustomUploaderURL_Enter(object sender, EventArgs e)
{ {
customUploaderURLType = URLType.URL; customUploaderURLType = CustomUploaderURLType.URL;
} }
private void rtbCustomUploaderURL_TextChanged(object sender, EventArgs e) private void rtbCustomUploaderURL_TextChanged(object sender, EventArgs e)
@ -1263,7 +1270,7 @@ private void rtbCustomUploaderURL_TextChanged(object sender, EventArgs e)
private void rtbCustomUploaderThumbnailURL_Enter(object sender, EventArgs e) private void rtbCustomUploaderThumbnailURL_Enter(object sender, EventArgs e)
{ {
customUploaderURLType = URLType.ThumbnailURL; customUploaderURLType = CustomUploaderURLType.ThumbnailURL;
} }
private void rtbCustomUploaderThumbnailURL_TextChanged(object sender, EventArgs e) private void rtbCustomUploaderThumbnailURL_TextChanged(object sender, EventArgs e)
@ -1275,7 +1282,7 @@ private void rtbCustomUploaderThumbnailURL_TextChanged(object sender, EventArgs
private void rtbCustomUploaderDeletionURL_Enter(object sender, EventArgs e) private void rtbCustomUploaderDeletionURL_Enter(object sender, EventArgs e)
{ {
customUploaderURLType = URLType.DeletionURL; customUploaderURLType = CustomUploaderURLType.DeletionURL;
} }
private void rtbCustomUploaderDeletionURL_TextChanged(object sender, EventArgs e) private void rtbCustomUploaderDeletionURL_TextChanged(object sender, EventArgs e)
@ -1285,6 +1292,18 @@ private void rtbCustomUploaderDeletionURL_TextChanged(object sender, EventArgs e
CustomUploaderSyntaxHighlight(rtbResultDeletionURL); CustomUploaderSyntaxHighlight(rtbResultDeletionURL);
} }
private void rtbResultErrorMessage_Enter(object sender, EventArgs e)
{
customUploaderURLType = CustomUploaderURLType.ErrorMessage;
}
private void rtbResultErrorMessage_TextChanged(object sender, EventArgs e)
{
CustomUploaderItem uploader = CustomUploaderGetSelected();
if (uploader != null) uploader.ErrorMessage = rtbResultErrorMessage.Text;
CustomUploaderSyntaxHighlight(rtbResultErrorMessage);
}
private void txtCustomUploaderLog_LinkClicked(object sender, LinkClickedEventArgs e) private void txtCustomUploaderLog_LinkClicked(object sender, LinkClickedEventArgs e)
{ {
URLHelpers.OpenURL(e.LinkText); URLHelpers.OpenURL(e.LinkText);

File diff suppressed because it is too large Load diff