Now remembers 'AutoBreakLines' in ocr window - thx jc :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1831 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-05-11 11:25:34 +00:00
parent b8c32447a5
commit 1c29c52786
6 changed files with 56 additions and 83 deletions

View File

@ -984,8 +984,6 @@ namespace Nikse.SubtitleEdit.Forms
}
}
int width = 0;
int height = 0;
GetResolution(ref width, ref height);

View File

@ -45,7 +45,6 @@
this.listBoxLinesForeground = new System.Windows.Forms.ListBox();
this.contextMenuLinesForeground = new System.Windows.Forms.ContextMenuStrip(this.components);
this.removeForegroundToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buttonMakeItalic = new System.Windows.Forms.Button();
this.buttonZoomOut = new System.Windows.Forms.Button();
this.buttonZoomIn = new System.Windows.Forms.Button();
this.labelCharacters = new System.Windows.Forms.Label();
@ -59,6 +58,7 @@
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonImport = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.labelNOcrCharInfo = new System.Windows.Forms.Label();
this.groupBoxCurrentCompareImage.SuspendLayout();
this.groupBox2.SuspendLayout();
this.contextMenuStripLinesBackground.SuspendLayout();
@ -110,12 +110,12 @@
this.groupBoxCurrentCompareImage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxCurrentCompareImage.Controls.Add(this.labelNOcrCharInfo);
this.groupBoxCurrentCompareImage.Controls.Add(this.groupBox2);
this.groupBoxCurrentCompareImage.Controls.Add(this.label2);
this.groupBoxCurrentCompareImage.Controls.Add(this.listBoxlinesBackground);
this.groupBoxCurrentCompareImage.Controls.Add(this.labelLines);
this.groupBoxCurrentCompareImage.Controls.Add(this.listBoxLinesForeground);
this.groupBoxCurrentCompareImage.Controls.Add(this.buttonMakeItalic);
this.groupBoxCurrentCompareImage.Controls.Add(this.buttonZoomOut);
this.groupBoxCurrentCompareImage.Controls.Add(this.buttonZoomIn);
this.groupBoxCurrentCompareImage.Controls.Add(this.labelCharacters);
@ -230,17 +230,6 @@
this.removeForegroundToolStripMenuItem.Text = "Remove";
this.removeForegroundToolStripMenuItem.Click += new System.EventHandler(this.removeForegroundToolStripMenuItem_Click);
//
// buttonMakeItalic
//
this.buttonMakeItalic.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonMakeItalic.Location = new System.Drawing.Point(299, 19);
this.buttonMakeItalic.Name = "buttonMakeItalic";
this.buttonMakeItalic.Size = new System.Drawing.Size(137, 23);
this.buttonMakeItalic.TabIndex = 37;
this.buttonMakeItalic.Text = "Make italic (DEV TEST)";
this.buttonMakeItalic.UseVisualStyleBackColor = true;
this.buttonMakeItalic.Click += new System.EventHandler(this.buttonMakeItalic_Click);
//
// buttonZoomOut
//
this.buttonZoomOut.Location = new System.Drawing.Point(269, 110);
@ -370,6 +359,16 @@
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// labelNOcrCharInfo
//
this.labelNOcrCharInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.labelNOcrCharInfo.AutoSize = true;
this.labelNOcrCharInfo.Location = new System.Drawing.Point(104, 59);
this.labelNOcrCharInfo.Name = "labelNOcrCharInfo";
this.labelNOcrCharInfo.Size = new System.Drawing.Size(94, 13);
this.labelNOcrCharInfo.TabIndex = 43;
this.labelNOcrCharInfo.Text = "labelNOcrCharInfo";
//
// VobSubNOcrEdit
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -418,7 +417,6 @@
private System.Windows.Forms.Label labelTextAssociatedWithImage;
private System.Windows.Forms.Button buttonDelete;
private System.Windows.Forms.TextBox textBoxText;
private System.Windows.Forms.Button buttonMakeItalic;
private System.Windows.Forms.Label labelInfo;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
@ -435,5 +433,6 @@
private System.Windows.Forms.ToolStripMenuItem removeForegroundToolStripMenuItem;
private System.Windows.Forms.Button buttonImport;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Label labelNOcrCharInfo;
}
}

View File

@ -39,6 +39,7 @@ namespace Nikse.SubtitleEdit.Forms
}
labelInfo.Text = string.Format("{0} elements in database", nocrChars.Count);
labelNOcrCharInfo.Text = string.Empty;
}
private void FillComboBox()
@ -163,6 +164,7 @@ namespace Nikse.SubtitleEdit.Forms
private void listBoxFileNames_SelectedIndexChanged(object sender, EventArgs e)
{
labelNOcrCharInfo.Text = string.Empty;
if (listBoxFileNames.SelectedIndex < 0)
return;
@ -180,6 +182,7 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxItalic.Checked = _nocrChar.Italic;
pictureBoxCharacter.Invalidate();
groupBoxCurrentCompareImage.Enabled = true;
labelNOcrCharInfo.Text = string.Format("Size: {0}x{1}, margin top: {2} ", _nocrChar.Width, _nocrChar.Height, _nocrChar.MarginTop);
if (pictureBoxCharacter.Image != null)
{
@ -284,43 +287,6 @@ namespace Nikse.SubtitleEdit.Forms
selPenB.Dispose();
}
private Point MakePointItalic(Point p, int height)
{
int _italicMoveRight = 2;
double _unItalicFactor = 0.2;
return new Point((int)Math.Round(p.X + (height - p.Y) * _unItalicFactor - _italicMoveRight), p.Y);
}
private void buttonMakeItalic_Click(object sender, EventArgs e)
{
var c = new NOcrChar();
foreach (NOcrPoint op in _nocrChar.LinesForeground)
{
c.LinesForeground.Add(new NOcrPoint(MakePointItalic(op.Start, _nocrChar.Height), MakePointItalic(op.End, _nocrChar.Height)));
}
foreach (NOcrPoint op in _nocrChar.LinesBackground)
{
c.LinesBackground.Add(new NOcrPoint(MakePointItalic(op.Start, _nocrChar.Height), MakePointItalic(op.End, _nocrChar.Height)));
}
c.Text = _nocrChar.Text;
c.Width = _nocrChar.Width;
c.Height = _nocrChar.Height;
c.MarginTop = _nocrChar.MarginTop;
_nocrChar = c;
pictureBoxCharacter.Invalidate();
if (IsMatch())
{
groupBoxCurrentCompareImage.BackColor = Color.LightGreen;
}
else
{
groupBoxCurrentCompareImage.BackColor = Control.DefaultBackColor;
}
}
private void buttonDelete_Click(object sender, EventArgs e)
{
if (listBoxFileNames.Items.Count == 0 || _nocrChar == null)
@ -489,6 +455,8 @@ namespace Nikse.SubtitleEdit.Forms
int notImportedCount = 0;
openFileDialog1.Filter = "nOCR files|nOCR_*.xml";
openFileDialog1.InitialDirectory = Configuration.DataDirectory;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Title = "Import existing nOCR database into current";
if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
{
foreach (NOcrChar newChar in VobSubOcr.LoadNOcr(openFileDialog1.FileName))

View File

@ -92,6 +92,7 @@ namespace Nikse.SubtitleEdit.Forms
this.buttonStop = new System.Windows.Forms.Button();
this.buttonStartOcr = new System.Windows.Forms.Button();
this.groupBoxOcrAutoFix = new System.Windows.Forms.GroupBox();
this.buttonSpellCheckDownload = new System.Windows.Forms.Button();
this.labelFixesMade = new System.Windows.Forms.Label();
this.comboBoxDictionaries = new System.Windows.Forms.ComboBox();
this.checkBoxGuessUnknownWords = new System.Windows.Forms.CheckBox();
@ -136,7 +137,6 @@ namespace Nikse.SubtitleEdit.Forms
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.splitContainerBottom = new System.Windows.Forms.SplitContainer();
this.buttonSpellCheckDownload = new System.Windows.Forms.Button();
this.textBoxCurrentText = new Nikse.SubtitleEdit.Controls.SETextBox();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.contextMenuStripListview.SuspendLayout();
@ -461,7 +461,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxNOcrItalic.AutoSize = true;
this.checkBoxNOcrItalic.Location = new System.Drawing.Point(15, 42);
this.checkBoxNOcrItalic.Name = "checkBoxNOcrItalic";
this.checkBoxNOcrItalic.Size = new System.Drawing.Size(92, 17);
this.checkBoxNOcrItalic.Size = new System.Drawing.Size(91, 17);
this.checkBoxNOcrItalic.TabIndex = 8;
this.checkBoxNOcrItalic.Text = "Contains italic";
this.checkBoxNOcrItalic.UseVisualStyleBackColor = true;
@ -471,7 +471,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxNOcrCorrect.AutoSize = true;
this.checkBoxNOcrCorrect.Location = new System.Drawing.Point(235, 17);
this.checkBoxNOcrCorrect.Name = "checkBoxNOcrCorrect";
this.checkBoxNOcrCorrect.Size = new System.Drawing.Size(116, 17);
this.checkBoxNOcrCorrect.Size = new System.Drawing.Size(113, 17);
this.checkBoxNOcrCorrect.TabIndex = 7;
this.checkBoxNOcrCorrect.Text = "Draw missing texts";
this.checkBoxNOcrCorrect.UseVisualStyleBackColor = true;
@ -481,7 +481,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxRightToLeftNOCR.AutoSize = true;
this.checkBoxRightToLeftNOCR.Location = new System.Drawing.Point(235, 40);
this.checkBoxRightToLeftNOCR.Name = "checkBoxRightToLeftNOCR";
this.checkBoxRightToLeftNOCR.Size = new System.Drawing.Size(83, 17);
this.checkBoxRightToLeftNOCR.Size = new System.Drawing.Size(80, 17);
this.checkBoxRightToLeftNOCR.TabIndex = 6;
this.checkBoxRightToLeftNOCR.Text = "Right to left";
this.checkBoxRightToLeftNOCR.UseVisualStyleBackColor = true;
@ -538,7 +538,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxRightToLeft.AutoSize = true;
this.checkBoxRightToLeft.Location = new System.Drawing.Point(173, 100);
this.checkBoxRightToLeft.Name = "checkBoxRightToLeft";
this.checkBoxRightToLeft.Size = new System.Drawing.Size(83, 17);
this.checkBoxRightToLeft.Size = new System.Drawing.Size(80, 17);
this.checkBoxRightToLeft.TabIndex = 6;
this.checkBoxRightToLeft.Text = "Right to left";
this.checkBoxRightToLeft.UseVisualStyleBackColor = true;
@ -645,7 +645,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxTesseractMusicOn.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxTesseractMusicOn.Location = new System.Drawing.Point(99, 101);
this.checkBoxTesseractMusicOn.Name = "checkBoxTesseractMusicOn";
this.checkBoxTesseractMusicOn.Size = new System.Drawing.Size(93, 17);
this.checkBoxTesseractMusicOn.Size = new System.Drawing.Size(94, 17);
this.checkBoxTesseractMusicOn.TabIndex = 4;
this.checkBoxTesseractMusicOn.Text = "Music symbols";
this.checkBoxTesseractMusicOn.UseVisualStyleBackColor = true;
@ -657,7 +657,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxTesseractItalicsOn.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxTesseractItalicsOn.Location = new System.Drawing.Point(22, 101);
this.checkBoxTesseractItalicsOn.Name = "checkBoxTesseractItalicsOn";
this.checkBoxTesseractItalicsOn.Size = new System.Drawing.Size(54, 17);
this.checkBoxTesseractItalicsOn.Size = new System.Drawing.Size(53, 17);
this.checkBoxTesseractItalicsOn.TabIndex = 3;
this.checkBoxTesseractItalicsOn.Text = "Italics";
this.checkBoxTesseractItalicsOn.UseVisualStyleBackColor = true;
@ -670,7 +670,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxUseModiInTesseractForUnknownWords.Enabled = false;
this.checkBoxUseModiInTesseractForUnknownWords.Location = new System.Drawing.Point(22, 74);
this.checkBoxUseModiInTesseractForUnknownWords.Name = "checkBoxUseModiInTesseractForUnknownWords";
this.checkBoxUseModiInTesseractForUnknownWords.Size = new System.Drawing.Size(167, 17);
this.checkBoxUseModiInTesseractForUnknownWords.Size = new System.Drawing.Size(165, 17);
this.checkBoxUseModiInTesseractForUnknownWords.TabIndex = 2;
this.checkBoxUseModiInTesseractForUnknownWords.Text = "Try MODI for unknown words";
this.checkBoxUseModiInTesseractForUnknownWords.UseVisualStyleBackColor = true;
@ -811,6 +811,17 @@ namespace Nikse.SubtitleEdit.Forms
this.groupBoxOcrAutoFix.TabStop = false;
this.groupBoxOcrAutoFix.Text = "OCR auto correction / spellchecking";
//
// buttonSpellCheckDownload
//
this.buttonSpellCheckDownload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonSpellCheckDownload.Location = new System.Drawing.Point(367, 19);
this.buttonSpellCheckDownload.Name = "buttonSpellCheckDownload";
this.buttonSpellCheckDownload.Size = new System.Drawing.Size(28, 21);
this.buttonSpellCheckDownload.TabIndex = 42;
this.buttonSpellCheckDownload.Text = "...";
this.buttonSpellCheckDownload.UseVisualStyleBackColor = true;
this.buttonSpellCheckDownload.Click += new System.EventHandler(this.buttonSpellCheckDownload_Click);
//
// labelFixesMade
//
this.labelFixesMade.AutoSize = true;
@ -839,7 +850,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxGuessUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxGuessUnknownWords.Location = new System.Drawing.Point(11, 91);
this.checkBoxGuessUnknownWords.Name = "checkBoxGuessUnknownWords";
this.checkBoxGuessUnknownWords.Size = new System.Drawing.Size(164, 17);
this.checkBoxGuessUnknownWords.Size = new System.Drawing.Size(162, 17);
this.checkBoxGuessUnknownWords.TabIndex = 5;
this.checkBoxGuessUnknownWords.Text = "Try to guess unknown words";
this.checkBoxGuessUnknownWords.UseVisualStyleBackColor = true;
@ -1032,7 +1043,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxPromptForUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxPromptForUnknownWords.Location = new System.Drawing.Point(11, 69);
this.checkBoxPromptForUnknownWords.Name = "checkBoxPromptForUnknownWords";
this.checkBoxPromptForUnknownWords.Size = new System.Drawing.Size(255, 17);
this.checkBoxPromptForUnknownWords.Size = new System.Drawing.Size(246, 17);
this.checkBoxPromptForUnknownWords.TabIndex = 4;
this.checkBoxPromptForUnknownWords.Text = "Prompt for unknown words (requires dictionary)";
this.checkBoxPromptForUnknownWords.UseVisualStyleBackColor = true;
@ -1044,7 +1055,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxAutoBreakLines.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAutoBreakLines.Location = new System.Drawing.Point(11, 113);
this.checkBoxAutoBreakLines.Name = "checkBoxAutoBreakLines";
this.checkBoxAutoBreakLines.Size = new System.Drawing.Size(208, 17);
this.checkBoxAutoBreakLines.Size = new System.Drawing.Size(200, 17);
this.checkBoxAutoBreakLines.TabIndex = 6;
this.checkBoxAutoBreakLines.Text = "Auto break subtitle, if line number > 2";
this.checkBoxAutoBreakLines.UseVisualStyleBackColor = true;
@ -1065,7 +1076,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxAutoFixCommonErrors.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAutoFixCommonErrors.Location = new System.Drawing.Point(11, 47);
this.checkBoxAutoFixCommonErrors.Name = "checkBoxAutoFixCommonErrors";
this.checkBoxAutoFixCommonErrors.Size = new System.Drawing.Size(139, 17);
this.checkBoxAutoFixCommonErrors.Size = new System.Drawing.Size(137, 17);
this.checkBoxAutoFixCommonErrors.TabIndex = 2;
this.checkBoxAutoFixCommonErrors.Text = "Fix common OCR errors";
this.checkBoxAutoFixCommonErrors.UseVisualStyleBackColor = true;
@ -1097,7 +1108,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxBackgroundTransparent.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxBackgroundTransparent.Location = new System.Drawing.Point(144, 19);
this.checkBoxBackgroundTransparent.Name = "checkBoxBackgroundTransparent";
this.checkBoxBackgroundTransparent.Size = new System.Drawing.Size(85, 17);
this.checkBoxBackgroundTransparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxBackgroundTransparent.TabIndex = 8;
this.checkBoxBackgroundTransparent.Text = "Transparent";
this.checkBoxBackgroundTransparent.UseVisualStyleBackColor = true;
@ -1118,7 +1129,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxEmphasis2Transparent.AutoSize = true;
this.checkBoxEmphasis2Transparent.Location = new System.Drawing.Point(507, 19);
this.checkBoxEmphasis2Transparent.Name = "checkBoxEmphasis2Transparent";
this.checkBoxEmphasis2Transparent.Size = new System.Drawing.Size(85, 17);
this.checkBoxEmphasis2Transparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxEmphasis2Transparent.TabIndex = 6;
this.checkBoxEmphasis2Transparent.Text = "Transparent";
this.checkBoxEmphasis2Transparent.UseVisualStyleBackColor = true;
@ -1129,7 +1140,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxEmphasis1Transparent.AutoSize = true;
this.checkBoxEmphasis1Transparent.Location = new System.Drawing.Point(387, 19);
this.checkBoxEmphasis1Transparent.Name = "checkBoxEmphasis1Transparent";
this.checkBoxEmphasis1Transparent.Size = new System.Drawing.Size(85, 17);
this.checkBoxEmphasis1Transparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxEmphasis1Transparent.TabIndex = 5;
this.checkBoxEmphasis1Transparent.Text = "Transparent";
this.checkBoxEmphasis1Transparent.UseVisualStyleBackColor = true;
@ -1140,7 +1151,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxPatternTransparent.AutoSize = true;
this.checkBoxPatternTransparent.Location = new System.Drawing.Point(266, 19);
this.checkBoxPatternTransparent.Name = "checkBoxPatternTransparent";
this.checkBoxPatternTransparent.Size = new System.Drawing.Size(85, 17);
this.checkBoxPatternTransparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxPatternTransparent.TabIndex = 4;
this.checkBoxPatternTransparent.Text = "Transparent";
this.checkBoxPatternTransparent.UseVisualStyleBackColor = true;
@ -1208,9 +1219,9 @@ namespace Nikse.SubtitleEdit.Forms
//
this.checkBoxAutoTransparentBackground.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.checkBoxAutoTransparentBackground.AutoSize = true;
this.checkBoxAutoTransparentBackground.Location = new System.Drawing.Point(481, 170);
this.checkBoxAutoTransparentBackground.Location = new System.Drawing.Point(485, 170);
this.checkBoxAutoTransparentBackground.Name = "checkBoxAutoTransparentBackground";
this.checkBoxAutoTransparentBackground.Size = new System.Drawing.Size(168, 17);
this.checkBoxAutoTransparentBackground.Size = new System.Drawing.Size(164, 17);
this.checkBoxAutoTransparentBackground.TabIndex = 36;
this.checkBoxAutoTransparentBackground.Text = "Auto transparent background";
this.checkBoxAutoTransparentBackground.UseVisualStyleBackColor = true;
@ -1283,17 +1294,6 @@ namespace Nikse.SubtitleEdit.Forms
this.splitContainerBottom.SplitterDistance = 658;
this.splitContainerBottom.TabIndex = 39;
//
// buttonSpellCheckDownload
//
this.buttonSpellCheckDownload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonSpellCheckDownload.Location = new System.Drawing.Point(367, 19);
this.buttonSpellCheckDownload.Name = "buttonSpellCheckDownload";
this.buttonSpellCheckDownload.Size = new System.Drawing.Size(28, 21);
this.buttonSpellCheckDownload.TabIndex = 42;
this.buttonSpellCheckDownload.Text = "...";
this.buttonSpellCheckDownload.UseVisualStyleBackColor = true;
this.buttonSpellCheckDownload.Click += new System.EventHandler(this.buttonSpellCheckDownload_Click);
//
// textBoxCurrentText
//
this.textBoxCurrentText.AllowDrop = true;

View File

@ -258,11 +258,12 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxAutoTransparentBackground.Text = language.AutoTransparentBackground;
checkBoxAutoTransparentBackground.Left = groupBoxSubtitleImage.Width - checkBoxAutoTransparentBackground.Width - 2;
checkBoxPromptForUnknownWords.Text = language.PromptForUnknownWords;
checkBoxPromptForUnknownWords.Checked = Configuration.Settings.VobSubOcr.PromptForUnknownWords;
checkBoxPromptForUnknownWords.Checked = Configuration.Settings.VobSubOcr.PromptForUnknownWords;
groupBoxOcrAutoFix.Text = language.OcrAutoCorrectionSpellchecking;
checkBoxGuessUnknownWords.Text = language.TryToGuessUnkownWords;
checkBoxAutoBreakLines.Text = language.AutoBreakSubtitleIfMoreThanTwoLines;
checkBoxAutoBreakLines.Checked = Configuration.Settings.VobSubOcr.AutoBreakSubtitleIfMoreThanTwoLines;
tabControlLogs.TabPages[0].Text = language.AllFixes;
tabControlLogs.TabPages[1].Text = language.GuessesUsed;
tabControlLogs.TabPages[2].Text = language.UnknownWords;
@ -5770,6 +5771,7 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.VobSubOcr.ItalicFactor = _unItalicFactor;
Configuration.Settings.VobSubOcr.UseModiInTesseractForUnknownWords = checkBoxUseModiInTesseractForUnknownWords.Checked;
Configuration.Settings.VobSubOcr.PromptForUnknownWords = checkBoxPromptForUnknownWords.Checked;
Configuration.Settings.VobSubOcr.AutoBreakSubtitleIfMoreThanTwoLines = checkBoxAutoBreakLines.Checked;
Configuration.Settings.VobSubOcr.LineOcrDraw = checkBoxNOcrCorrect.Checked;
Configuration.Settings.VobSubOcr.LineOcrAdvancedItalic = checkBoxNOcrItalic.Checked;
if (comboBoxOcrMethod.SelectedIndex == 3) // line ocr

View File

@ -568,6 +568,7 @@ namespace Nikse.SubtitleEdit.Logic
public bool TopToBottom { get; set; }
public int DefaultMillisecondsForUnknownDurations { get; set; }
public bool PromptForUnknownWords { get; set; }
public bool AutoBreakSubtitleIfMoreThanTwoLines { get; set; }
public double ItalicFactor { get; set; }
public bool LineOcrDraw { get; set; }
public bool LineOcrAdvancedItalic { get; set; }
@ -590,6 +591,7 @@ namespace Nikse.SubtitleEdit.Logic
TopToBottom = true;
DefaultMillisecondsForUnknownDurations = 5000;
PromptForUnknownWords = true;
AutoBreakSubtitleIfMoreThanTwoLines = true;
ItalicFactor = 0.2;
}
@ -1720,6 +1722,9 @@ namespace Nikse.SubtitleEdit.Logic
subNode = node.SelectSingleNode("PromptForUnknownWords");
if (subNode != null)
settings.VobSubOcr.PromptForUnknownWords = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("AutoBreakSubtitleIfMoreThanTwoLines");
if (subNode != null)
settings.VobSubOcr.AutoBreakSubtitleIfMoreThanTwoLines = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("ItalicFactor");
if (subNode != null)
settings.VobSubOcr.ItalicFactor = Convert.ToDouble(subNode.InnerText, CultureInfo.InvariantCulture);
@ -2402,6 +2407,7 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("TopToBottom", settings.VobSubOcr.TopToBottom.ToString());
textWriter.WriteElementString("DefaultMillisecondsForUnknownDurations", settings.VobSubOcr.DefaultMillisecondsForUnknownDurations.ToString());
textWriter.WriteElementString("PromptForUnknownWords", settings.VobSubOcr.PromptForUnknownWords.ToString());
textWriter.WriteElementString("AutoBreakSubtitleIfMoreThanTwoLines", settings.VobSubOcr.AutoBreakSubtitleIfMoreThanTwoLines.ToString());
textWriter.WriteElementString("ItalicFactor", settings.VobSubOcr.ItalicFactor.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("LineOcrDraw", settings.VobSubOcr.LineOcrDraw.ToString());
textWriter.WriteElementString("LineOcrAdvancedItalic", settings.VobSubOcr.LineOcrAdvancedItalic.ToString());