From e8bdc39ce5ecb195fa5b9c79631a331b072858ea Mon Sep 17 00:00:00 2001 From: Dmitry Tveryanovich Date: Wed, 6 Aug 2025 00:01:49 +0200 Subject: [PATCH 1/4] checkbox added --- .../WinForms/IntentoFormAdvanced.Designer.cs | 169 ++++++++++-------- .../WinForms/IntentoFormAdvanced.cs | 4 +- 2 files changed, 94 insertions(+), 79 deletions(-) diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs index cf7db55..5567df7 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs @@ -1,33 +1,33 @@ -namespace Intento.MT.Plugin.PropertiesForm.WinForms -{ - partial class IntentoFormAdvanced - { - /// - /// 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() - { +namespace Intento.MT.Plugin.PropertiesForm.WinForms +{ + partial class IntentoFormAdvanced + { + /// + /// 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() + { this.groupBoxProxy = new System.Windows.Forms.GroupBox(); this.groupBoxAuth = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); @@ -44,6 +44,7 @@ private void InitializeComponent() this.labelPort = new System.Windows.Forms.Label(); this.textBoxPort = new System.Windows.Forms.TextBox(); this.checkBoxProxy = new System.Windows.Forms.CheckBox(); + this.checkBoxEmptySegments = new System.Windows.Forms.CheckBox(); this.checkBoxSaveApiKeyInRegistry = new System.Windows.Forms.CheckBox(); this.checkBoxTrace = new System.Windows.Forms.CheckBox(); this.buttonCancel = new System.Windows.Forms.Button(); @@ -100,7 +101,7 @@ private void InitializeComponent() this.groupBoxAuth.Margin = new System.Windows.Forms.Padding(0); this.groupBoxAuth.Name = "groupBoxAuth"; this.groupBoxAuth.Size = new System.Drawing.Size(503, 104); - this.groupBoxAuth.TabIndex = 16; + this.groupBoxAuth.TabIndex = 17; this.groupBoxAuth.TabStop = false; // // tableLayoutPanel4 @@ -181,7 +182,7 @@ private void InitializeComponent() this.panel2.Name = "panel2"; this.panel2.Padding = new System.Windows.Forms.Padding(3); this.panel2.Size = new System.Drawing.Size(503, 28); - this.panel2.TabIndex = 19; + this.panel2.TabIndex = 20; // // checkBoxAuth // @@ -191,7 +192,7 @@ private void InitializeComponent() this.checkBoxAuth.Margin = new System.Windows.Forms.Padding(0); this.checkBoxAuth.Name = "checkBoxAuth"; this.checkBoxAuth.Size = new System.Drawing.Size(497, 22); - this.checkBoxAuth.TabIndex = 17; + this.checkBoxAuth.TabIndex = 18; this.checkBoxAuth.Text = "Authorization required"; this.checkBoxAuth.UseVisualStyleBackColor = true; this.checkBoxAuth.CheckedChanged += new System.EventHandler(this.checkBoxAuth_CheckedChanged); @@ -214,7 +215,7 @@ private void InitializeComponent() this.tableLayoutPanel2.RowCount = 1; this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.Size = new System.Drawing.Size(503, 28); - this.tableLayoutPanel2.TabIndex = 18; + this.tableLayoutPanel2.TabIndex = 19; // // labelAddress // @@ -255,8 +256,19 @@ private void InitializeComponent() this.textBoxPort.Margin = new System.Windows.Forms.Padding(3, 5, 3, 3); this.textBoxPort.Name = "textBoxPort"; this.textBoxPort.Size = new System.Drawing.Size(77, 22); - this.textBoxPort.TabIndex = 15; + this.textBoxPort.TabIndex = 16; this.textBoxPort.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxPort_KeyPress); + // + // checkBoxEmptySegments + // + this.checkBoxEmptySegments.Dock = System.Windows.Forms.DockStyle.Top; + this.checkBoxEmptySegments.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.checkBoxEmptySegments.Location = new System.Drawing.Point(3, 26); + this.checkBoxEmptySegments.Name = "checkBoxEmptySegments"; + this.checkBoxEmptySegments.Size = new System.Drawing.Size(253, 17); + this.checkBoxEmptySegments.TabIndex = 14; + this.checkBoxEmptySegments.Text = "checkBoxEmptySegments"; + this.checkBoxEmptySegments.UseVisualStyleBackColor = true; // // checkBoxProxy // @@ -266,7 +278,7 @@ private void InitializeComponent() this.checkBoxProxy.Location = new System.Drawing.Point(3, 26); this.checkBoxProxy.Name = "checkBoxProxy"; this.checkBoxProxy.Size = new System.Drawing.Size(513, 18); - this.checkBoxProxy.TabIndex = 13; + this.checkBoxProxy.TabIndex = 15; this.checkBoxProxy.Text = "checkBoxProxy"; this.checkBoxProxy.UseVisualStyleBackColor = true; this.checkBoxProxy.CheckedChanged += new System.EventHandler(this.checkBoxProxy_CheckedChanged); @@ -398,15 +410,17 @@ private void InitializeComponent() this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.Controls.Add(this.checkBoxTrace, 0, 0); this.tableLayoutPanel1.Controls.Add(this.checkBoxSaveLocally, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.checkBoxProxy, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.checkBoxEmptySegments, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.checkBoxProxy, 0, 2); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(519, 47); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.Size = new System.Drawing.Size(519, 72); this.tableLayoutPanel1.TabIndex = 41; // // panel1 @@ -524,42 +538,43 @@ private void InitializeComponent() this.ResumeLayout(false); this.PerformLayout(); - } - - #endregion - - private System.Windows.Forms.GroupBox groupBoxProxy; - private System.Windows.Forms.CheckBox checkBoxAuth; - private System.Windows.Forms.GroupBox groupBoxAuth; - private System.Windows.Forms.TextBox textBoxPassword; - private System.Windows.Forms.Label labelPassword; - private System.Windows.Forms.TextBox textBoxUserName; - private System.Windows.Forms.Label labelUserName; - private System.Windows.Forms.TextBox textBoxPort; - private System.Windows.Forms.Label labelPort; - private System.Windows.Forms.TextBox textBoxAddress; - private System.Windows.Forms.Label labelAddress; - public System.Windows.Forms.CheckBox checkBoxProxy; - public System.Windows.Forms.CheckBox checkBoxSaveApiKeyInRegistry; - public System.Windows.Forms.CheckBox checkBoxTrace; - private System.Windows.Forms.Button buttonCancel; - public System.Windows.Forms.Button buttonSave; - private System.Windows.Forms.StatusStrip statusStrip1; - public System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; - private System.Windows.Forms.TextBox textBoxCustomSettingsName; - private System.Windows.Forms.Label labelCustomSettingsName; - public System.Windows.Forms.CheckBox checkBoxCustomTagParser; - public System.Windows.Forms.CheckBox checkBoxCutTags; - private System.Windows.Forms.Label labelError; - public System.Windows.Forms.CheckBox checkBoxSaveLocally; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; - private System.Windows.Forms.Panel panel3; - private System.Windows.Forms.Panel panel4; - } + } + + #endregion + + private System.Windows.Forms.GroupBox groupBoxProxy; + private System.Windows.Forms.CheckBox checkBoxAuth; + private System.Windows.Forms.GroupBox groupBoxAuth; + private System.Windows.Forms.TextBox textBoxPassword; + private System.Windows.Forms.Label labelPassword; + private System.Windows.Forms.TextBox textBoxUserName; + private System.Windows.Forms.Label labelUserName; + private System.Windows.Forms.TextBox textBoxPort; + private System.Windows.Forms.Label labelPort; + private System.Windows.Forms.TextBox textBoxAddress; + private System.Windows.Forms.Label labelAddress; + public System.Windows.Forms.CheckBox checkBoxProxy; + public System.Windows.Forms.CheckBox checkBoxEmptySegments; + public System.Windows.Forms.CheckBox checkBoxSaveApiKeyInRegistry; + public System.Windows.Forms.CheckBox checkBoxTrace; + private System.Windows.Forms.Button buttonCancel; + public System.Windows.Forms.Button buttonSave; + private System.Windows.Forms.StatusStrip statusStrip1; + public System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.TextBox textBoxCustomSettingsName; + private System.Windows.Forms.Label labelCustomSettingsName; + public System.Windows.Forms.CheckBox checkBoxCustomTagParser; + public System.Windows.Forms.CheckBox checkBoxCutTags; + private System.Windows.Forms.Label labelError; + public System.Windows.Forms.CheckBox checkBoxSaveLocally; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Panel panel4; + } } \ No newline at end of file diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs index 9fbdf28..b7bc08f 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs @@ -31,12 +31,12 @@ private void LocalizeContent() checkBoxProxy.Text = Resource.FAcheckBoxProxy; labelAddress.Text = Resource.FAlabelAddress; checkBoxTrace.Text = Resource.FAcheckBoxTrace; + checkBoxEmptySegments.Text = Resource.FAcheckBoxEmptySegments; labelPassword.Text = Resource.FAlabelPassword; labelPort.Text = Resource.FAlabelPort; labelUserName.Text = Resource.FAlabelUserName; buttonCancel.Text = Resource.Cancel; - buttonSave.Text = Resource.Save; - checkBoxTrace.Text = Resource.FAcheckBoxTrace; + buttonSave.Text = Resource.Save; Text = Resource.FAcaption; labelCustomSettingsName.Text = Resource.FAlabelCustomSettingsName; checkBoxCustomTagParser.Text = Resource.FAcheckBoxCustomTagParser; From 5a5ed16909cbb67f6068fd68c659458ce11c43f9 Mon Sep 17 00:00:00 2001 From: Dmitry Tveryanovich Date: Wed, 6 Aug 2025 00:13:04 +0200 Subject: [PATCH 2/4] percentage spinbox --- .../WinForms/IntentoFormAdvanced.Designer.cs | 17 +++++++++++++++++ .../WinForms/IntentoFormAdvanced.cs | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs index 5567df7..50df57f 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs @@ -56,6 +56,7 @@ private void InitializeComponent() this.checkBoxCustomTagParser = new System.Windows.Forms.CheckBox(); this.checkBoxCutTags = new System.Windows.Forms.CheckBox(); this.checkBoxSaveLocally = new System.Windows.Forms.CheckBox(); + this.spinBoxEmptySegmentsPercent = new System.Windows.Forms.NumericUpDown(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); @@ -269,6 +270,7 @@ private void InitializeComponent() this.checkBoxEmptySegments.TabIndex = 14; this.checkBoxEmptySegments.Text = "checkBoxEmptySegments"; this.checkBoxEmptySegments.UseVisualStyleBackColor = true; + this.checkBoxEmptySegments.CheckedChanged += new System.EventHandler(this.checkBoxEmptySegments_CheckedChanged); // // checkBoxProxy // @@ -402,6 +404,19 @@ private void InitializeComponent() this.checkBoxSaveLocally.UseVisualStyleBackColor = true; this.checkBoxSaveLocally.Visible = false; // + // spinBoxEmptySegmentsPercent + // + this.spinBoxEmptySegmentsPercent.Dock = System.Windows.Forms.DockStyle.Top; + this.spinBoxEmptySegmentsPercent.Enabled = false; + this.spinBoxEmptySegmentsPercent.Location = new System.Drawing.Point(262, 26); + this.spinBoxEmptySegmentsPercent.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.spinBoxEmptySegmentsPercent.Maximum = new decimal(new int[] {100, 0, 0, 0}); + this.spinBoxEmptySegmentsPercent.Minimum = new decimal(new int[] {0, 0, 0, 0}); + this.spinBoxEmptySegmentsPercent.Name = "spinBoxEmptySegmentsPercent"; + this.spinBoxEmptySegmentsPercent.Size = new System.Drawing.Size(254, 22); + this.spinBoxEmptySegmentsPercent.TabIndex = 41; + this.spinBoxEmptySegmentsPercent.Value = new decimal(new int[] {0, 0, 0, 0}); + // // tableLayoutPanel1 // this.tableLayoutPanel1.AutoSize = true; @@ -411,6 +426,7 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.checkBoxTrace, 0, 0); this.tableLayoutPanel1.Controls.Add(this.checkBoxSaveLocally, 1, 0); this.tableLayoutPanel1.Controls.Add(this.checkBoxEmptySegments, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.spinBoxEmptySegmentsPercent, 1, 1); this.tableLayoutPanel1.Controls.Add(this.checkBoxProxy, 0, 2); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3); @@ -555,6 +571,7 @@ private void InitializeComponent() private System.Windows.Forms.Label labelAddress; public System.Windows.Forms.CheckBox checkBoxProxy; public System.Windows.Forms.CheckBox checkBoxEmptySegments; + public System.Windows.Forms.NumericUpDown spinBoxEmptySegmentsPercent; public System.Windows.Forms.CheckBox checkBoxSaveApiKeyInRegistry; public System.Windows.Forms.CheckBox checkBoxTrace; private System.Windows.Forms.Button buttonCancel; diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs index b7bc08f..f005eb3 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs @@ -58,6 +58,11 @@ private void checkBoxProxy_CheckedChanged(object sender, EventArgs e) groupBoxProxy.Enabled = checkBoxProxy.Checked; } + private void checkBoxEmptySegments_CheckedChanged(object sender, EventArgs e) + { + spinBoxEmptySegmentsPercent.Enabled = checkBoxEmptySegments.Checked; + } + private void buttonSave_Click(object sender, EventArgs e) { RemoteLogService.SetTraceEndTime(DateTime.Now.AddMinutes(checkBoxTrace.Checked ? 30 : -40)); From 3e6ec08ad3645a41a5f357ee31ca744d99229c0c Mon Sep 17 00:00:00 2001 From: Dmitry Tveryanovich Date: Wed, 6 Aug 2025 00:33:44 +0200 Subject: [PATCH 3/4] added label and resources --- .../WinForms/IntentoFormAdvanced.Designer.cs | 65 +++++++++++++------ .../WinForms/IntentoFormAdvanced.cs | 3 +- .../WinForms/Resource.Designer.cs | 18 +++++ .../WinForms/Resource.resx | 6 ++ 4 files changed, 71 insertions(+), 21 deletions(-) diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs index 50df57f..0639281 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.Designer.cs @@ -57,6 +57,8 @@ private void InitializeComponent() this.checkBoxCutTags = new System.Windows.Forms.CheckBox(); this.checkBoxSaveLocally = new System.Windows.Forms.CheckBox(); this.spinBoxEmptySegmentsPercent = new System.Windows.Forms.NumericUpDown(); + this.labelEmptySegmentsPercentage = new System.Windows.Forms.Label(); + this.panelEmptySegmentsPercent = new System.Windows.Forms.Panel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); @@ -69,6 +71,7 @@ private void InitializeComponent() this.panel2.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.statusStrip1.SuspendLayout(); + this.panelEmptySegmentsPercent.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.panel1.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); @@ -259,18 +262,6 @@ private void InitializeComponent() this.textBoxPort.Size = new System.Drawing.Size(77, 22); this.textBoxPort.TabIndex = 16; this.textBoxPort.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxPort_KeyPress); - // - // checkBoxEmptySegments - // - this.checkBoxEmptySegments.Dock = System.Windows.Forms.DockStyle.Top; - this.checkBoxEmptySegments.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.checkBoxEmptySegments.Location = new System.Drawing.Point(3, 26); - this.checkBoxEmptySegments.Name = "checkBoxEmptySegments"; - this.checkBoxEmptySegments.Size = new System.Drawing.Size(253, 17); - this.checkBoxEmptySegments.TabIndex = 14; - this.checkBoxEmptySegments.Text = "checkBoxEmptySegments"; - this.checkBoxEmptySegments.UseVisualStyleBackColor = true; - this.checkBoxEmptySegments.CheckedChanged += new System.EventHandler(this.checkBoxEmptySegments_CheckedChanged); // // checkBoxProxy // @@ -285,6 +276,19 @@ private void InitializeComponent() this.checkBoxProxy.UseVisualStyleBackColor = true; this.checkBoxProxy.CheckedChanged += new System.EventHandler(this.checkBoxProxy_CheckedChanged); // + // checkBoxEmptySegments + // + this.checkBoxEmptySegments.Dock = System.Windows.Forms.DockStyle.Top; + this.checkBoxEmptySegments.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.checkBoxEmptySegments.Location = new System.Drawing.Point(6, 52); + this.checkBoxEmptySegments.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.checkBoxEmptySegments.Name = "checkBoxEmptySegments"; + this.checkBoxEmptySegments.Size = new System.Drawing.Size(507, 34); + this.checkBoxEmptySegments.TabIndex = 14; + this.checkBoxEmptySegments.Text = "checkBoxEmptySegments"; + this.checkBoxEmptySegments.UseVisualStyleBackColor = true; + this.checkBoxEmptySegments.CheckedChanged += new System.EventHandler(this.checkBoxEmptySegments_CheckedChanged); + // // checkBoxSaveApiKeyInRegistry // this.checkBoxSaveApiKeyInRegistry.Dock = System.Windows.Forms.DockStyle.Fill; @@ -406,16 +410,35 @@ private void InitializeComponent() // // spinBoxEmptySegmentsPercent // - this.spinBoxEmptySegmentsPercent.Dock = System.Windows.Forms.DockStyle.Top; + this.spinBoxEmptySegmentsPercent.Dock = System.Windows.Forms.DockStyle.Right; this.spinBoxEmptySegmentsPercent.Enabled = false; - this.spinBoxEmptySegmentsPercent.Location = new System.Drawing.Point(262, 26); - this.spinBoxEmptySegmentsPercent.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3); - this.spinBoxEmptySegmentsPercent.Maximum = new decimal(new int[] {100, 0, 0, 0}); - this.spinBoxEmptySegmentsPercent.Minimum = new decimal(new int[] {0, 0, 0, 0}); + this.spinBoxEmptySegmentsPercent.Location = new System.Drawing.Point(347, 0); + this.spinBoxEmptySegmentsPercent.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); this.spinBoxEmptySegmentsPercent.Name = "spinBoxEmptySegmentsPercent"; - this.spinBoxEmptySegmentsPercent.Size = new System.Drawing.Size(254, 22); + this.spinBoxEmptySegmentsPercent.Size = new System.Drawing.Size(160, 37); this.spinBoxEmptySegmentsPercent.TabIndex = 41; - this.spinBoxEmptySegmentsPercent.Value = new decimal(new int[] {0, 0, 0, 0}); + // + // labelEmptySegmentsPercentage + // + this.labelEmptySegmentsPercentage.Dock = System.Windows.Forms.DockStyle.Left; + this.labelEmptySegmentsPercentage.Location = new System.Drawing.Point(0, 0); + this.labelEmptySegmentsPercentage.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.labelEmptySegmentsPercentage.Name = "labelEmptySegmentsPercentage"; + this.labelEmptySegmentsPercentage.Size = new System.Drawing.Size(160, 44); + this.labelEmptySegmentsPercentage.TabIndex = 42; + this.labelEmptySegmentsPercentage.Text = "labelEmptySegmentsPercentage"; + this.labelEmptySegmentsPercentage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // panelEmptySegmentsPercent + // + this.panelEmptySegmentsPercent.Controls.Add(this.spinBoxEmptySegmentsPercent); + this.panelEmptySegmentsPercent.Controls.Add(this.labelEmptySegmentsPercentage); + this.panelEmptySegmentsPercent.Dock = System.Windows.Forms.DockStyle.Top; + this.panelEmptySegmentsPercent.Location = new System.Drawing.Point(525, 52); + this.panelEmptySegmentsPercent.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.panelEmptySegmentsPercent.Name = "panelEmptySegmentsPercent"; + this.panelEmptySegmentsPercent.Size = new System.Drawing.Size(507, 44); + this.panelEmptySegmentsPercent.TabIndex = 43; // // tableLayoutPanel1 // @@ -426,7 +449,7 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.checkBoxTrace, 0, 0); this.tableLayoutPanel1.Controls.Add(this.checkBoxSaveLocally, 1, 0); this.tableLayoutPanel1.Controls.Add(this.checkBoxEmptySegments, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.spinBoxEmptySegmentsPercent, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.panelEmptySegmentsPercent, 1, 1); this.tableLayoutPanel1.Controls.Add(this.checkBoxProxy, 0, 2); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3); @@ -593,5 +616,7 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Label labelEmptySegmentsPercentage; + private System.Windows.Forms.Panel panelEmptySegmentsPercent; } } \ No newline at end of file diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs index f005eb3..98c4859 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs @@ -32,6 +32,7 @@ private void LocalizeContent() labelAddress.Text = Resource.FAlabelAddress; checkBoxTrace.Text = Resource.FAcheckBoxTrace; checkBoxEmptySegments.Text = Resource.FAcheckBoxEmptySegments; + labelEmptySegmentsPercentage.Text = Resource.FAlabelEmptySegmentsPercentage; labelPassword.Text = Resource.FAlabelPassword; labelPort.Text = Resource.FAlabelPort; labelUserName.Text = Resource.FAlabelUserName; @@ -60,7 +61,7 @@ private void checkBoxProxy_CheckedChanged(object sender, EventArgs e) private void checkBoxEmptySegments_CheckedChanged(object sender, EventArgs e) { - spinBoxEmptySegmentsPercent.Enabled = checkBoxEmptySegments.Checked; + panelEmptySegmentsPercent.Enabled = checkBoxEmptySegments.Checked; } private void buttonSave_Click(object sender, EventArgs e) diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/Resource.Designer.cs b/Intento.MT.Plugin.PropertiesForm/WinForms/Resource.Designer.cs index f0637be..22ab4e3 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/Resource.Designer.cs +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/Resource.Designer.cs @@ -294,6 +294,15 @@ internal static string FACheckBoxCutTags { } } + /// + /// Looks up a localized string similar to Empty segments check. + /// + internal static string FAcheckBoxEmptySegments { + get { + return ResourceManager.GetString("FAcheckBoxEmptySegments", resourceCulture); + } + } + /// /// Looks up a localized string similar to Enable proxy server (Attention! Proxy settings apply to all sets of settings). /// @@ -348,6 +357,15 @@ internal static string FAlabelCustomSettingsName { } } + /// + /// Looks up a localized string similar to Percentage. + /// + internal static string FAlabelEmptySegmentsPercentage { + get { + return ResourceManager.GetString("FAlabelEmptySegmentsPercentage", resourceCulture); + } + } + /// /// Looks up a localized string similar to Password:. /// diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/Resource.resx b/Intento.MT.Plugin.PropertiesForm/WinForms/Resource.resx index 42b8c56..c6b9777 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/Resource.resx +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/Resource.resx @@ -356,4 +356,10 @@ If you have selected custom model or glossary, please adjust the language pair:< Uncheck all + + Empty segments check + + + Percentage + \ No newline at end of file From 9cc6ee6f6e2037ece4524fa04c4d2895c08a639d Mon Sep 17 00:00:00 2001 From: Dmitry Tveryanovich Date: Wed, 6 Aug 2025 00:59:27 +0200 Subject: [PATCH 4/4] saving value in options --- .../IntentoMTFormOptions.cs | 11 +++++++++++ .../WinForms/IntentoFormAdvanced.cs | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/Intento.MT.Plugin.PropertiesForm/IntentoMTFormOptions.cs b/Intento.MT.Plugin.PropertiesForm/IntentoMTFormOptions.cs index 2246702..ac556c4 100644 --- a/Intento.MT.Plugin.PropertiesForm/IntentoMTFormOptions.cs +++ b/Intento.MT.Plugin.PropertiesForm/IntentoMTFormOptions.cs @@ -44,6 +44,17 @@ public partial class IntentoMTFormOptions /// public string ProviderName { get; set; } + // --------------------------- Empty segments settings ------------------------------- + /// + /// Fail translation on empty segments + /// + public bool EmptySegmentsCheckEnabled { get; set; } + + /// + /// Percentage of empty segments to fail translation + /// + public int EmptySegmentsPercentage { get; set; } + // --------------------------- Account and provider authentication parameters ------------------------------- /// /// Using external authentication (not "Via Intento") diff --git a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs index 98c4859..73f91d0 100644 --- a/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs +++ b/Intento.MT.Plugin.PropertiesForm/WinForms/IntentoFormAdvanced.cs @@ -72,6 +72,10 @@ private void buttonSave_Click(object sender, EventArgs e) parent.CurrentOptions.CutTag = checkBoxCutTags.Checked; parent.CurrentOptions.SaveLocally = checkBoxSaveLocally.Checked; + parent.CurrentOptions.EmptySegmentsCheckEnabled = checkBoxEmptySegments.Checked; + // TODO do we need to check that value is in range? + parent.CurrentOptions.EmptySegmentsPercentage = (int)spinBoxEmptySegmentsPercent.Value; + if (!checkBoxProxy.Checked) { if (parent.CurrentOptions.ProxySettings != null) @@ -200,6 +204,11 @@ private void IntentoFormAdvanced_Shown(object sender, EventArgs e) checkBoxSaveLocally.Checked = parent.CurrentOptions.SaveLocally; checkBoxSaveLocally.Visible = parent.IsTrados || !parent.MemoqPublic; + checkBoxEmptySegments.Checked = parent.CurrentOptions.EmptySegmentsCheckEnabled; + // TODO shouldn't this be called after setting the value? + checkBoxEmptySegments_CheckedChanged(null, null); + spinBoxEmptySegmentsPercent.Value = parent.CurrentOptions.EmptySegmentsPercentage; + // Specific setting for Trados textBoxCustomSettingsName.Visible = parent.IsTrados; labelCustomSettingsName.Visible = parent.IsTrados;