More work on #3633

This commit is contained in:
Nikolaj Olsson 2019-10-05 10:10:20 +02:00
parent e186fad145
commit deeae0eafc
6 changed files with 48 additions and 13 deletions

View File

@ -79,6 +79,8 @@
<Size>Size</Size>
<Search>Search</Search>
<DeleteCurrentLine>Delete current line</DeleteCurrentLine>
<Width>Width</Width>
<Height>Height</Height>
</General>
<About>
<Title>About Subtitle Edit</Title>
@ -212,6 +214,8 @@ Note: Do check free disk space.</WaveFileMalformed>
<AutoBalanceErrorX>Auto balance: {0}</AutoBalanceErrorX>
<OffsetTimeCodes>Offset time codes</OffsetTimeCodes>
<TransportStreamSettings>Transport Stream settings</TransportStreamSettings>
<TransportStreamOverridePosition>Override original position</TransportStreamOverridePosition>
<TransportStreamOverrideVideoSize>Override original video size</TransportStreamOverrideVideoSize>
</BatchConvert>
<Beamer>
<Title>Beamer</Title>

View File

@ -196,7 +196,9 @@ namespace Nikse.SubtitleEdit.Core
After = "After",
Size = "Size",
Search = "Search",
DeleteCurrentLine = "Delete current line"
DeleteCurrentLine = "Delete current line",
Width = "Width",
Height = "Height"
};
About = new LanguageStructure.About
@ -351,7 +353,9 @@ namespace Nikse.SubtitleEdit.Core
MultipleReplaceErrorX = "Multiple replace: {0}",
AutoBalanceErrorX = "Auto balance: {0}",
OffsetTimeCodes = "Offset time codes",
TransportStreamSettings = "Transport Stream settings"
TransportStreamSettings = "Transport Stream settings",
TransportStreamOverridePosition = "Override original position",
TransportStreamOverrideVideoSize = "Override original video size"
};
Beamer = new LanguageStructure.Beamer

View File

@ -292,6 +292,12 @@ namespace Nikse.SubtitleEdit.Core
case "General/DeleteCurrentLine":
language.General.DeleteCurrentLine = reader.Value;
break;
case "General/Width":
language.General.Width = reader.Value;
break;
case "General/Height":
language.General.Height = reader.Value;
break;
case "About/Title":
language.About.Title = reader.Value;
break;
@ -577,6 +583,12 @@ namespace Nikse.SubtitleEdit.Core
case "BatchConvert/TransportStreamSettings":
language.BatchConvert.TransportStreamSettings = reader.Value;
break;
case "BatchConvert/TransportStreamOverridePosition":
language.BatchConvert.TransportStreamOverridePosition = reader.Value;
break;
case "BatchConvert/TransportStreamOverrideVideoSize":
language.BatchConvert.TransportStreamOverrideVideoSize = reader.Value;
break;
case "Beamer/Title":
language.Beamer.Title = reader.Value;
break;

View File

@ -83,6 +83,8 @@
public string Size { get; set; }
public string Search { get; set; }
public string DeleteCurrentLine { get; set; }
public string Width { get; set; }
public string Height { get; set; }
}
public class About
@ -222,6 +224,8 @@
public string AutoBalanceErrorX { get; set; }
public string OffsetTimeCodes { get; set; }
public string TransportStreamSettings { get; set; }
public string TransportStreamOverridePosition { get; set; }
public string TransportStreamOverrideVideoSize { get; set; }
}
public class Beamer

View File

@ -47,7 +47,7 @@
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(231, 145);
this.buttonOK.Location = new System.Drawing.Point(287, 145);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 8;
@ -60,7 +60,7 @@
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(312, 145);
this.buttonCancel.Location = new System.Drawing.Point(368, 145);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 9;
@ -114,7 +114,7 @@
0});
this.numericUpDownWidth.Name = "numericUpDownWidth";
this.numericUpDownWidth.Size = new System.Drawing.Size(62, 20);
this.numericUpDownWidth.TabIndex = 15;
this.numericUpDownWidth.TabIndex = 16;
this.numericUpDownWidth.Value = new decimal(new int[] {
1920,
0,
@ -136,7 +136,7 @@
this.checkBoxOverrideVideoSize.Location = new System.Drawing.Point(244, 24);
this.checkBoxOverrideVideoSize.Name = "checkBoxOverrideVideoSize";
this.checkBoxOverrideVideoSize.Size = new System.Drawing.Size(116, 17);
this.checkBoxOverrideVideoSize.TabIndex = 16;
this.checkBoxOverrideVideoSize.TabIndex = 15;
this.checkBoxOverrideVideoSize.Text = "Override video size";
this.checkBoxOverrideVideoSize.UseVisualStyleBackColor = true;
this.checkBoxOverrideVideoSize.CheckedChanged += new System.EventHandler(this.CheckBoxOverrideVideoSize_CheckedChanged);
@ -156,7 +156,7 @@
0});
this.numericUpDownHeight.Name = "numericUpDownHeight";
this.numericUpDownHeight.Size = new System.Drawing.Size(62, 20);
this.numericUpDownHeight.TabIndex = 18;
this.numericUpDownHeight.TabIndex = 17;
this.numericUpDownHeight.Value = new decimal(new int[] {
1080,
0,
@ -176,7 +176,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(399, 178);
this.ClientSize = new System.Drawing.Size(455, 178);
this.Controls.Add(this.numericUpDownHeight);
this.Controls.Add(this.labelHeight);
this.Controls.Add(this.checkBoxOverrideVideoSize);

View File

@ -1,4 +1,5 @@
using System.Windows.Forms;
using System;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Core;
using Nikse.SubtitleEdit.Logic;
@ -12,10 +13,20 @@ namespace Nikse.SubtitleEdit.Forms
InitializeComponent();
UiUtil.FixFonts(this);
Text = Configuration.Settings.Language.BatchConvert.TransportStreamSettings;
checkBoxOverrideOriginalPosition.Text = Configuration.Settings.Language.BatchConvert.TransportStreamOverridePosition;
checkBoxOverrideVideoSize.Text = Configuration.Settings.Language.BatchConvert.TransportStreamOverrideVideoSize;
labelBottomMargin.Text = Configuration.Settings.Language.ExportPngXml.BottomMargin;
labelWidth.Text = Configuration.Settings.Language.General.Width;
labelHeight.Text = Configuration.Settings.Language.General.Height;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
buttonOK.Text = Configuration.Settings.Language.General.Ok;
UiUtil.FixLargeFonts(this, buttonOK);
numericUpDownBottomMargin.Left = labelBottomMargin.Left + labelBottomMargin.Width + 5;
var widthAndHeightLeft = Math.Max(labelWidth.Left + labelWidth.Width, labelHeight.Left + labelHeight.Width) + 5;
numericUpDownWidth.Left = widthAndHeightLeft;
numericUpDownHeight.Left = widthAndHeightLeft;
checkBoxOverrideOriginalPosition.Checked = Configuration.Settings.Tools.BatchConvertTsOverridePosition;
numericUpDownBottomMargin.Value = Configuration.Settings.Tools.BatchConvertTsOverrideBottomMargin;
checkBoxOverrideVideoSize.Checked = Configuration.Settings.Tools.BatchConvertTsOverrideScreenSize;
@ -26,13 +37,13 @@ namespace Nikse.SubtitleEdit.Forms
CheckBoxOverrideVideoSize_CheckedChanged(null, null);
}
private void CheckBoxOverrideOriginalPosition_CheckedChanged(object sender, System.EventArgs e)
private void CheckBoxOverrideOriginalPosition_CheckedChanged(object sender, EventArgs e)
{
labelBottomMargin.Enabled = checkBoxOverrideOriginalPosition.Checked;
numericUpDownBottomMargin.Enabled = checkBoxOverrideOriginalPosition.Checked;
}
private void CheckBoxOverrideVideoSize_CheckedChanged(object sender, System.EventArgs e)
private void CheckBoxOverrideVideoSize_CheckedChanged(object sender, EventArgs e)
{
labelWidth.Enabled = checkBoxOverrideVideoSize.Checked;
numericUpDownWidth.Enabled = checkBoxOverrideVideoSize.Checked;
@ -55,11 +66,11 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void ButtonOK_Click(object sender, System.EventArgs e)
private void ButtonOK_Click(object sender, EventArgs e)
{
Configuration.Settings.Tools.BatchConvertTsOverridePosition = checkBoxOverrideOriginalPosition.Checked;
Configuration.Settings.Tools.BatchConvertTsOverrideBottomMargin = (int)numericUpDownBottomMargin.Value;
Configuration.Settings.Tools.BatchConvertTsOverrideScreenSize= checkBoxOverrideVideoSize.Checked;
Configuration.Settings.Tools.BatchConvertTsOverrideScreenSize = checkBoxOverrideVideoSize.Checked;
Configuration.Settings.Tools.BatchConvertTsScreenWidth = (int)numericUpDownWidth.Value;
Configuration.Settings.Tools.BatchConvertTsScreenHeight = (int)numericUpDownHeight.Value;
DialogResult = DialogResult.OK;