mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 05:02:36 +01:00
Minor cleanup + added Escape as possible shortcut element
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1066 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
0f1c21fdf4
commit
a16751f951
39
src/Forms/ImportText.Designer.cs
generated
39
src/Forms/ImportText.Designer.cs
generated
@ -68,7 +68,7 @@
|
||||
this.buttonOpenText.TabIndex = 0;
|
||||
this.buttonOpenText.Text = "Open file...";
|
||||
this.buttonOpenText.UseVisualStyleBackColor = true;
|
||||
this.buttonOpenText.Click += new System.EventHandler(this.buttonOpenText_Click);
|
||||
this.buttonOpenText.Click += new System.EventHandler(this.ButtonOpenTextClick);
|
||||
//
|
||||
// groupBoxImportText
|
||||
//
|
||||
@ -89,15 +89,15 @@
|
||||
this.textBoxText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBoxText.Location = new System.Drawing.Point(6, 48);
|
||||
this.textBoxText.MaxLength = 232767;
|
||||
this.textBoxText.MaxLength = 0;
|
||||
this.textBoxText.Multiline = true;
|
||||
this.textBoxText.Name = "textBoxText";
|
||||
this.textBoxText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.textBoxText.Size = new System.Drawing.Size(495, 272);
|
||||
this.textBoxText.TabIndex = 2;
|
||||
this.textBoxText.TextChanged += new System.EventHandler(this.textBoxText_TextChanged);
|
||||
this.textBoxText.DragDrop += new System.Windows.Forms.DragEventHandler(this.textBoxText_DragDrop);
|
||||
this.textBoxText.DragEnter += new System.Windows.Forms.DragEventHandler(this.textBoxText_DragEnter);
|
||||
this.textBoxText.TextChanged += new System.EventHandler(this.TextBoxTextTextChanged);
|
||||
this.textBoxText.DragDrop += new System.Windows.Forms.DragEventHandler(this.TextBoxTextDragDrop);
|
||||
this.textBoxText.DragEnter += new System.Windows.Forms.DragEventHandler(this.TextBoxTextDragEnter);
|
||||
//
|
||||
// groupBoxImportOptions
|
||||
//
|
||||
@ -128,7 +128,7 @@
|
||||
this.checkBoxMergeShortLines.TabIndex = 40;
|
||||
this.checkBoxMergeShortLines.Text = "Merge short lines with continuation";
|
||||
this.checkBoxMergeShortLines.UseVisualStyleBackColor = true;
|
||||
this.checkBoxMergeShortLines.CheckedChanged += new System.EventHandler(this.checkBoxMergeShortLines_CheckedChanged);
|
||||
this.checkBoxMergeShortLines.CheckedChanged += new System.EventHandler(this.CheckBoxMergeShortLinesCheckedChanged);
|
||||
//
|
||||
// groupBoxDuration
|
||||
//
|
||||
@ -146,7 +146,7 @@
|
||||
//
|
||||
this.numericUpDownDurationFixed.Location = new System.Drawing.Point(111, 42);
|
||||
this.numericUpDownDurationFixed.Maximum = new decimal(new int[] {
|
||||
10000,
|
||||
100000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
@ -159,10 +159,11 @@
|
||||
this.numericUpDownDurationFixed.Size = new System.Drawing.Size(64, 21);
|
||||
this.numericUpDownDurationFixed.TabIndex = 37;
|
||||
this.numericUpDownDurationFixed.Value = new decimal(new int[] {
|
||||
1000,
|
||||
2000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownDurationFixed.ValueChanged += new System.EventHandler(this.NumericUpDownDurationFixedValueChanged);
|
||||
//
|
||||
// radioButtonDurationFixed
|
||||
//
|
||||
@ -173,7 +174,7 @@
|
||||
this.radioButtonDurationFixed.TabIndex = 3;
|
||||
this.radioButtonDurationFixed.Text = "Fixed";
|
||||
this.radioButtonDurationFixed.UseVisualStyleBackColor = true;
|
||||
this.radioButtonDurationFixed.CheckedChanged += new System.EventHandler(this.radioButtonDurationFixed_CheckedChanged);
|
||||
this.radioButtonDurationFixed.CheckedChanged += new System.EventHandler(this.RadioButtonDurationFixedCheckedChanged);
|
||||
//
|
||||
// radioButtonDurationAuto
|
||||
//
|
||||
@ -186,6 +187,7 @@
|
||||
this.radioButtonDurationAuto.TabStop = true;
|
||||
this.radioButtonDurationAuto.Text = "Auto";
|
||||
this.radioButtonDurationAuto.UseVisualStyleBackColor = true;
|
||||
this.radioButtonDurationAuto.CheckedChanged += new System.EventHandler(this.RadioButtonDurationAutoCheckedChanged);
|
||||
//
|
||||
// buttonRefresh
|
||||
//
|
||||
@ -196,13 +198,13 @@
|
||||
this.buttonRefresh.TabIndex = 38;
|
||||
this.buttonRefresh.Text = "Refresh";
|
||||
this.buttonRefresh.UseVisualStyleBackColor = true;
|
||||
this.buttonRefresh.Click += new System.EventHandler(this.buttonRefresh_Click);
|
||||
this.buttonRefresh.Click += new System.EventHandler(this.ButtonRefreshClick);
|
||||
//
|
||||
// numericUpDownGapBetweenLines
|
||||
//
|
||||
this.numericUpDownGapBetweenLines.Location = new System.Drawing.Point(19, 192);
|
||||
this.numericUpDownGapBetweenLines.Maximum = new decimal(new int[] {
|
||||
10000,
|
||||
100000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
@ -219,6 +221,7 @@
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownGapBetweenLines.ValueChanged += new System.EventHandler(this.NumericUpDownGapBetweenLinesValueChanged);
|
||||
//
|
||||
// labelGapBetweenSubtitles
|
||||
//
|
||||
@ -240,7 +243,7 @@
|
||||
this.checkBoxRemoveLinesWithoutLetters.TabIndex = 5;
|
||||
this.checkBoxRemoveLinesWithoutLetters.Text = "Remove lines without letters";
|
||||
this.checkBoxRemoveLinesWithoutLetters.UseVisualStyleBackColor = true;
|
||||
this.checkBoxRemoveLinesWithoutLetters.CheckedChanged += new System.EventHandler(this.checkBoxRemoveLinesWithoutLettersOrNumbers_CheckedChanged);
|
||||
this.checkBoxRemoveLinesWithoutLetters.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveLinesWithoutLettersOrNumbersCheckedChanged);
|
||||
//
|
||||
// groupBoxSplitting
|
||||
//
|
||||
@ -264,7 +267,7 @@
|
||||
this.radioButtonAutoSplit.TabStop = true;
|
||||
this.radioButtonAutoSplit.Text = "Auto split text";
|
||||
this.radioButtonAutoSplit.UseVisualStyleBackColor = true;
|
||||
this.radioButtonAutoSplit.CheckedChanged += new System.EventHandler(this.radioButtonAutoSplit_CheckedChanged);
|
||||
this.radioButtonAutoSplit.CheckedChanged += new System.EventHandler(this.RadioButtonAutoSplitCheckedChanged);
|
||||
//
|
||||
// radioButtonLineMode
|
||||
//
|
||||
@ -275,7 +278,7 @@
|
||||
this.radioButtonLineMode.TabIndex = 0;
|
||||
this.radioButtonLineMode.Text = "One line is one subtitle";
|
||||
this.radioButtonLineMode.UseVisualStyleBackColor = true;
|
||||
this.radioButtonLineMode.CheckedChanged += new System.EventHandler(this.radioButtonLineMode_CheckedChanged);
|
||||
this.radioButtonLineMode.CheckedChanged += new System.EventHandler(this.RadioButtonLineModeCheckedChanged);
|
||||
//
|
||||
// checkBoxRemoveEmptyLines
|
||||
//
|
||||
@ -288,7 +291,7 @@
|
||||
this.checkBoxRemoveEmptyLines.TabIndex = 3;
|
||||
this.checkBoxRemoveEmptyLines.Text = "Remove empty lines";
|
||||
this.checkBoxRemoveEmptyLines.UseVisualStyleBackColor = true;
|
||||
this.checkBoxRemoveEmptyLines.CheckedChanged += new System.EventHandler(this.checkBoxRemoveEmptyLines_CheckedChanged);
|
||||
this.checkBoxRemoveEmptyLines.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveEmptyLinesCheckedChanged);
|
||||
//
|
||||
// groupBoxImportResult
|
||||
//
|
||||
@ -337,7 +340,7 @@
|
||||
this.buttonCancel.TabIndex = 17;
|
||||
this.buttonCancel.Text = "C&ancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
|
||||
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
|
||||
//
|
||||
// buttonOK
|
||||
//
|
||||
@ -349,7 +352,7 @@
|
||||
this.buttonOK.TabIndex = 16;
|
||||
this.buttonOK.Text = "&Next >";
|
||||
this.buttonOK.UseVisualStyleBackColor = true;
|
||||
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
|
||||
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
|
||||
//
|
||||
// ImportText
|
||||
//
|
||||
@ -368,7 +371,7 @@
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Import text";
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ImportText_KeyDown);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ImportTextKeyDown);
|
||||
this.groupBoxImportText.ResumeLayout(false);
|
||||
this.groupBoxImportText.PerformLayout();
|
||||
this.groupBoxImportOptions.ResumeLayout(false);
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@ -13,6 +14,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
Subtitle _subtitle;
|
||||
string _videoFileName;
|
||||
private readonly Timer _refreshTimer = new Timer();
|
||||
|
||||
public Subtitle FixedSubtitle { get { return _subtitle; } }
|
||||
public string VideoFileName { get { return _videoFileName; } }
|
||||
@ -21,7 +23,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Text = Configuration.Settings.Language.ImportText.Title;
|
||||
Text = Configuration.Settings.Language.ImportText.Title;
|
||||
groupBoxImportText.Text = Configuration.Settings.Language.ImportText.Title;
|
||||
buttonOpenText.Text = Configuration.Settings.Language.ImportText.OpenTextFile;
|
||||
groupBoxImportOptions.Text = Configuration.Settings.Language.ImportText.ImportOptions;
|
||||
@ -45,12 +47,20 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
numericUpDownDurationFixed.Enabled = radioButtonDurationFixed.Checked;
|
||||
FixLargeFonts();
|
||||
_refreshTimer.Interval = 400;
|
||||
_refreshTimer.Tick += RefreshTimerTick;
|
||||
}
|
||||
|
||||
void RefreshTimerTick(object sender, EventArgs e)
|
||||
{
|
||||
_refreshTimer.Stop();
|
||||
GeneratePreviewReal();
|
||||
}
|
||||
|
||||
private void FixLargeFonts()
|
||||
{
|
||||
Graphics graphics = this.CreateGraphics();
|
||||
SizeF textSize = graphics.MeasureString(buttonOK.Text, this.Font);
|
||||
Graphics graphics = CreateGraphics();
|
||||
SizeF textSize = graphics.MeasureString(buttonOK.Text, Font);
|
||||
if (textSize.Height > buttonOK.Height - 4)
|
||||
{
|
||||
int newButtonHeight = (int)(textSize.Height + 7 + 0.5);
|
||||
@ -58,7 +68,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonOpenText_Click(object sender, EventArgs e)
|
||||
private void ButtonOpenTextClick(object sender, EventArgs e)
|
||||
{
|
||||
openFileDialog1.Title = buttonOpenText.Text;
|
||||
openFileDialog1.Filter = Configuration.Settings.Language.ImportText.TextFiles + "|*.txt|Adobe Story|*.astx|" + Configuration.Settings.Language.General.AllFiles + "|*.*";
|
||||
@ -74,6 +84,19 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
private void GeneratePreview()
|
||||
{
|
||||
if (_refreshTimer.Enabled)
|
||||
{
|
||||
_refreshTimer.Stop();
|
||||
_refreshTimer.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
_refreshTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private void GeneratePreviewReal()
|
||||
{
|
||||
_subtitle = new Subtitle();
|
||||
if (radioButtonLineMode.Checked)
|
||||
@ -90,13 +113,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
groupBoxImportResult.Text = string.Format(Configuration.Settings.Language.ImportText.PreviewLinesModifiedX, _subtitle.Paragraphs.Count);
|
||||
SubtitleListview1.Fill(_subtitle);
|
||||
if (_subtitle.Paragraphs.Count > 0)
|
||||
SubtitleListview1.Items[0].Selected = true;
|
||||
SubtitleListview1.SelectIndexAndEnsureVisible(0);
|
||||
}
|
||||
|
||||
private void MergeLinesWithContinuation()
|
||||
{
|
||||
Subtitle temp = new Subtitle();
|
||||
var temp = new Subtitle();
|
||||
bool skipNext = false;
|
||||
for (int i=0; i < _subtitle.Paragraphs.Count; i++)
|
||||
{
|
||||
@ -105,15 +127,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
Paragraph next = _subtitle.GetParagraphOrDefault(i + 1);
|
||||
|
||||
bool merge = true;
|
||||
|
||||
if (p.Text.Contains(Environment.NewLine) || next == null)
|
||||
merge = false;
|
||||
bool merge = !(p.Text.Contains(Environment.NewLine) || next == null);
|
||||
|
||||
if (merge && (p.Text.TrimEnd().EndsWith("!") || p.Text.TrimEnd().EndsWith(".") || p.Text.TrimEnd().EndsWith("!")))
|
||||
{
|
||||
StripableText st = new StripableText(p.Text);
|
||||
if (st.StrippedText.Length > 0 && Utilities.UppercaseLetters.Contains(st.StrippedText[0].ToString()))
|
||||
var st = new StripableText(p.Text);
|
||||
if (st.StrippedText.Length > 0 && Utilities.UppercaseLetters.Contains(st.StrippedText[0].ToString(CultureInfo.InvariantCulture)))
|
||||
merge = false;
|
||||
}
|
||||
|
||||
@ -122,7 +141,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
if (merge)
|
||||
{
|
||||
temp.Paragraphs.Add(new Paragraph() { Text = p.Text + Environment.NewLine + next.Text });
|
||||
temp.Paragraphs.Add(new Paragraph { Text = p.Text + Environment.NewLine + next.Text });
|
||||
skipNext = true;
|
||||
}
|
||||
else
|
||||
@ -147,7 +166,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
p.EndTime.TotalMilliseconds = millisecondsIndex + p.Duration.TotalMilliseconds;
|
||||
p.StartTime.TotalMilliseconds = millisecondsIndex;
|
||||
|
||||
millisecondsIndex += p.Duration.TotalMilliseconds + millisecondsInterval;
|
||||
millisecondsIndex += p.Duration.TotalMilliseconds + millisecondsInterval;
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,7 +211,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void ImportAutoSplit(IEnumerable<string> textLines)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var sb = new StringBuilder();
|
||||
foreach (string line in textLines)
|
||||
{
|
||||
if (line.Trim().Length == 0)
|
||||
@ -230,7 +249,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
lines[i] = lines[i].Replace("_@PER_", ".");
|
||||
}
|
||||
|
||||
List<string> list = new List<string>();
|
||||
var list = new List<string>();
|
||||
foreach (string s in lines)
|
||||
AutoSplit(list, s);
|
||||
|
||||
@ -243,22 +262,22 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
if (split.Length < Configuration.Settings.General.SubtitleLineMaximumLength)
|
||||
list.Add(split);
|
||||
else
|
||||
else if (split != line)
|
||||
AutoSplit(list, split);
|
||||
}
|
||||
}
|
||||
|
||||
private bool ContainsLetters(string line)
|
||||
{
|
||||
foreach (char ch in line.ToCharArray())
|
||||
foreach (char ch in line)
|
||||
{
|
||||
if (!("\r\n\t .?" + Convert.ToChar(0)).Contains(ch.ToString()))
|
||||
if (!("\r\n\t .?" + Convert.ToChar(0)).Contains(ch.ToString(CultureInfo.InvariantCulture)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void buttonOK_Click(object sender, EventArgs e)
|
||||
private void ButtonOkClick(object sender, EventArgs e)
|
||||
{
|
||||
if (SubtitleListview1.Items.Count > 0)
|
||||
DialogResult = DialogResult.OK;
|
||||
@ -266,43 +285,38 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e)
|
||||
private void ButtonCancelClick(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void checkBoxRemoveLinesWithoutLettersOrNumbers_CheckedChanged(object sender, EventArgs e)
|
||||
private void CheckBoxRemoveLinesWithoutLettersOrNumbersCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void checkBoxRemoveEmptyLines_CheckedChanged(object sender, EventArgs e)
|
||||
private void CheckBoxRemoveEmptyLinesCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void radioButtonLineMode_CheckedChanged(object sender, EventArgs e)
|
||||
private void RadioButtonLineModeCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void radioButtonOneTwoLineMode_CheckedChanged(object sender, EventArgs e)
|
||||
private void RadioButtonAutoSplitCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void radioButtonAutoSplit_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void textBoxText_DragEnter(object sender, DragEventArgs e)
|
||||
private void TextBoxTextDragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop, false))
|
||||
e.Effect = DragDropEffects.All;
|
||||
}
|
||||
|
||||
private void textBoxText_DragDrop(object sender, DragEventArgs e)
|
||||
private void TextBoxTextDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
if (files.Length == 1)
|
||||
@ -330,8 +344,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
try
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
XmlDocument doc = new XmlDocument();
|
||||
var sb = new StringBuilder();
|
||||
var doc = new XmlDocument();
|
||||
doc.Load(fileName);
|
||||
foreach (XmlNode node in doc.DocumentElement.SelectNodes("//paragraph[@element='Dialog']")) // <paragraph objID="1:28" element="Dialog">
|
||||
{
|
||||
@ -376,31 +390,46 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonRefresh_Click(object sender, EventArgs e)
|
||||
private void ButtonRefreshClick(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void radioButtonDurationFixed_CheckedChanged(object sender, EventArgs e)
|
||||
private void RadioButtonDurationFixedCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
numericUpDownDurationFixed.Enabled = radioButtonDurationFixed.Checked;
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void checkBoxMergeShortLines_CheckedChanged(object sender, EventArgs e)
|
||||
private void CheckBoxMergeShortLinesCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void ImportText_KeyDown(object sender, KeyEventArgs e)
|
||||
private void ImportTextKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void textBoxText_TextChanged(object sender, EventArgs e)
|
||||
private void TextBoxTextTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
buttonRefresh_Click(null, null);
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void NumericUpDownDurationFixedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void NumericUpDownGapBetweenLinesValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
private void RadioButtonDurationAutoCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
GeneratePreview();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
GoogleOrMicrosoftTranslate _googleOrMicrosoftTranslate = null;
|
||||
|
||||
bool _cancelWordSpellCheck = false;
|
||||
bool _cancelWordSpellCheck = true;
|
||||
|
||||
Keys _toggleVideoDockUndock = Keys.None;
|
||||
Keys _videoPause = Keys.None;
|
||||
@ -4085,6 +4085,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
wordSpellChecker.Quit();
|
||||
ShowStatus(string.Format(_language.SpellCheckCompletedXCorrections, totalLinesChanged));
|
||||
Cursor = Cursors.Default;
|
||||
_cancelWordSpellCheck = true;
|
||||
}
|
||||
|
||||
private void SpellCheck(bool autoDetect)
|
||||
@ -7232,7 +7233,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
bool inListView = tabControlSubtitle.SelectedIndex == TabControlListView;
|
||||
|
||||
if (audioVisualizer != null && audioVisualizer.Visible & e.KeyData == _waveformVerticalZoom)
|
||||
if (e.KeyCode == Keys.Escape && !_cancelWordSpellCheck)
|
||||
{
|
||||
_cancelWordSpellCheck = true;
|
||||
}
|
||||
else if (audioVisualizer != null && audioVisualizer.Visible & e.KeyData == _waveformVerticalZoom)
|
||||
{
|
||||
if (audioVisualizer.VerticalZoomPercent > 0.2)
|
||||
audioVisualizer.VerticalZoomPercent -= 0.1;
|
||||
@ -7578,10 +7583,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
_cancelWordSpellCheck = true;
|
||||
}
|
||||
else if (e.Modifiers == (Keys.Control | Keys.Shift) && e.KeyCode == Keys.U) // Ctrl+Shift+U = switch original/current
|
||||
{
|
||||
if (_subtitleAlternate != null && _subtitleAlternate.Paragraphs.Count > 0 && _networkSession == null)
|
||||
@ -12125,6 +12126,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return;
|
||||
}
|
||||
|
||||
MakeHistoryForUndoOnlyIfNotResent(string.Format(_language.VideoControls.BeforeChangingTimeInWaveFormX, "#" + p.Number + " " + p.Text));
|
||||
|
||||
timeUpDownStartTime.MaskedTextBox.TextChanged -= MaskedTextBox_TextChanged;
|
||||
var oldParagraph = new Paragraph(_subtitle.Paragraphs[index]);
|
||||
double videoPosition = mediaPlayer.CurrentPosition;
|
||||
@ -12147,7 +12150,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
timeUpDownStartTime.TimeCode = _subtitle.Paragraphs[index].StartTime;
|
||||
timeUpDownStartTime.MaskedTextBox.TextChanged += MaskedTextBox_TextChanged;
|
||||
UpdateOriginalTimeCodes(oldParagraph);
|
||||
|
||||
_subtitleListViewIndex = -1;
|
||||
SubtitleListview1.SelectIndexAndEnsureVisible(index + 1);
|
||||
audioVisualizer.Invalidate();
|
||||
}
|
||||
|
17
src/Forms/Settings.Designer.cs
generated
17
src/Forms/Settings.Designer.cs
generated
@ -358,7 +358,7 @@
|
||||
this.checkBoxPromptDeleteLines.AutoSize = true;
|
||||
this.checkBoxPromptDeleteLines.Location = new System.Drawing.Point(436, 319);
|
||||
this.checkBoxPromptDeleteLines.Name = "checkBoxPromptDeleteLines";
|
||||
this.checkBoxPromptDeleteLines.Size = new System.Drawing.Size(142, 17);
|
||||
this.checkBoxPromptDeleteLines.Size = new System.Drawing.Size(138, 17);
|
||||
this.checkBoxPromptDeleteLines.TabIndex = 40;
|
||||
this.checkBoxPromptDeleteLines.Text = "Prompt for deleting lines";
|
||||
this.checkBoxPromptDeleteLines.UseVisualStyleBackColor = true;
|
||||
@ -368,7 +368,7 @@
|
||||
this.checkBoxAutoWrapWhileTyping.AutoSize = true;
|
||||
this.checkBoxAutoWrapWhileTyping.Location = new System.Drawing.Point(193, 146);
|
||||
this.checkBoxAutoWrapWhileTyping.Name = "checkBoxAutoWrapWhileTyping";
|
||||
this.checkBoxAutoWrapWhileTyping.Size = new System.Drawing.Size(137, 17);
|
||||
this.checkBoxAutoWrapWhileTyping.Size = new System.Drawing.Size(132, 17);
|
||||
this.checkBoxAutoWrapWhileTyping.TabIndex = 4;
|
||||
this.checkBoxAutoWrapWhileTyping.Text = "Auto-wrap while typing";
|
||||
this.checkBoxAutoWrapWhileTyping.UseVisualStyleBackColor = true;
|
||||
@ -396,7 +396,7 @@
|
||||
this.checkBoxAllowEditOfOriginalSubtitle.AutoSize = true;
|
||||
this.checkBoxAllowEditOfOriginalSubtitle.Location = new System.Drawing.Point(436, 296);
|
||||
this.checkBoxAllowEditOfOriginalSubtitle.Name = "checkBoxAllowEditOfOriginalSubtitle";
|
||||
this.checkBoxAllowEditOfOriginalSubtitle.Size = new System.Drawing.Size(160, 17);
|
||||
this.checkBoxAllowEditOfOriginalSubtitle.Size = new System.Drawing.Size(155, 17);
|
||||
this.checkBoxAllowEditOfOriginalSubtitle.TabIndex = 24;
|
||||
this.checkBoxAllowEditOfOriginalSubtitle.Text = "Allow edit of original subtitle";
|
||||
this.checkBoxAllowEditOfOriginalSubtitle.UseVisualStyleBackColor = true;
|
||||
@ -564,7 +564,7 @@
|
||||
this.checkBoxRememberWindowPosition.AutoSize = true;
|
||||
this.checkBoxRememberWindowPosition.Location = new System.Drawing.Point(436, 101);
|
||||
this.checkBoxRememberWindowPosition.Name = "checkBoxRememberWindowPosition";
|
||||
this.checkBoxRememberWindowPosition.Size = new System.Drawing.Size(223, 17);
|
||||
this.checkBoxRememberWindowPosition.Size = new System.Drawing.Size(222, 17);
|
||||
this.checkBoxRememberWindowPosition.TabIndex = 15;
|
||||
this.checkBoxRememberWindowPosition.Text = "Remember main window position and size";
|
||||
this.checkBoxRememberWindowPosition.UseVisualStyleBackColor = true;
|
||||
@ -611,7 +611,7 @@
|
||||
this.checkBoxStartInSourceView.AutoSize = true;
|
||||
this.checkBoxStartInSourceView.Location = new System.Drawing.Point(436, 124);
|
||||
this.checkBoxStartInSourceView.Name = "checkBoxStartInSourceView";
|
||||
this.checkBoxStartInSourceView.Size = new System.Drawing.Size(121, 17);
|
||||
this.checkBoxStartInSourceView.Size = new System.Drawing.Size(119, 17);
|
||||
this.checkBoxStartInSourceView.TabIndex = 16;
|
||||
this.checkBoxStartInSourceView.Text = "Start in source view";
|
||||
this.checkBoxStartInSourceView.UseVisualStyleBackColor = true;
|
||||
@ -621,7 +621,7 @@
|
||||
this.checkBoxReopenLastOpened.AutoSize = true;
|
||||
this.checkBoxReopenLastOpened.Location = new System.Drawing.Point(444, 52);
|
||||
this.checkBoxReopenLastOpened.Name = "checkBoxReopenLastOpened";
|
||||
this.checkBoxReopenLastOpened.Size = new System.Drawing.Size(145, 17);
|
||||
this.checkBoxReopenLastOpened.Size = new System.Drawing.Size(140, 17);
|
||||
this.checkBoxReopenLastOpened.TabIndex = 13;
|
||||
this.checkBoxReopenLastOpened.Text = "Start with last file loaded";
|
||||
this.checkBoxReopenLastOpened.UseVisualStyleBackColor = true;
|
||||
@ -631,7 +631,7 @@
|
||||
this.checkBoxRememberRecentFiles.AutoSize = true;
|
||||
this.checkBoxRememberRecentFiles.Location = new System.Drawing.Point(436, 28);
|
||||
this.checkBoxRememberRecentFiles.Name = "checkBoxRememberRecentFiles";
|
||||
this.checkBoxRememberRecentFiles.Size = new System.Drawing.Size(195, 17);
|
||||
this.checkBoxRememberRecentFiles.Size = new System.Drawing.Size(188, 17);
|
||||
this.checkBoxRememberRecentFiles.TabIndex = 12;
|
||||
this.checkBoxRememberRecentFiles.Text = "Remember recent files (for reopen)";
|
||||
this.checkBoxRememberRecentFiles.UseVisualStyleBackColor = true;
|
||||
@ -642,7 +642,7 @@
|
||||
this.checkBoxSubtitleFontBold.AutoSize = true;
|
||||
this.checkBoxSubtitleFontBold.Location = new System.Drawing.Point(193, 269);
|
||||
this.checkBoxSubtitleFontBold.Name = "checkBoxSubtitleFontBold";
|
||||
this.checkBoxSubtitleFontBold.Size = new System.Drawing.Size(46, 17);
|
||||
this.checkBoxSubtitleFontBold.Size = new System.Drawing.Size(47, 17);
|
||||
this.checkBoxSubtitleFontBold.TabIndex = 8;
|
||||
this.checkBoxSubtitleFontBold.Text = "Bold";
|
||||
this.checkBoxSubtitleFontBold.UseVisualStyleBackColor = true;
|
||||
@ -2220,6 +2220,7 @@
|
||||
"Del",
|
||||
"Down",
|
||||
"End",
|
||||
"Escape",
|
||||
"Ins",
|
||||
"Left",
|
||||
"Pause",
|
||||
|
@ -153,7 +153,7 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
|
||||
public void WriteParagraph(Paragraph p, Bitmap bmp)
|
||||
{
|
||||
// timestamp: 00:00:33:900, filepos: 000000000
|
||||
_idx.AppendLine(string.Format("timestamp: {0:00}:{1:00}:{2:00}:{3:000}, filepos: {4}", p.StartTime.Hours, p.StartTime.Minutes, p.StartTime.Seconds, p.StartTime.Milliseconds, _subFile.Position.ToString("X").PadLeft(9, '0')));
|
||||
_idx.AppendLine(string.Format("timestamp: {0:00}:{1:00}:{2:00}:{3:000}, filepos: {4}", p.StartTime.Hours, p.StartTime.Minutes, p.StartTime.Seconds, p.StartTime.Milliseconds, _subFile.Position.ToString("X").PadLeft(9, '0').ToLower()));
|
||||
|
||||
// write binary vobsub file (duration + image)
|
||||
_subFile.Write(Mpeg2PackHeaderBuffer, 0, Mpeg2PackHeaderBuffer.Length);
|
||||
|
Loading…
Reference in New Issue
Block a user