Fixed bug at delete line in translate mode (thx vmb) + new ocr vobsub 'image-background-auto-transparent' option - SE 3.2 beta3

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@539 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-07-03 18:56:43 +00:00
parent 4af13aa0d3
commit ab9ff0d621
5 changed files with 45 additions and 16 deletions

View File

@ -111,7 +111,7 @@ namespace Nikse.SubtitleEdit.Forms
if (versionInfo.Length >= 3 && versionInfo[2] != "0")
_title += "." + versionInfo[2];
}
return _title + " Beta 2";
return _title + " Beta 3";
}
}
@ -3809,7 +3809,6 @@ namespace Nikse.SubtitleEdit.Forms
if (original != null)
alternateIndexes.Add(_subtitleAlternate.GetIndex(original));
}
alternateIndexes.Add(item.Index);
}
alternateIndexes.Reverse();

View File

@ -104,6 +104,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxUseTimeCodesFromIdx = new System.Windows.Forms.CheckBox();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.checkBoxAutoTransparentBackground = new System.Windows.Forms.CheckBox();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxSubtitleImage)).BeginInit();
this.contextMenuStripListview.SuspendLayout();
@ -155,7 +156,7 @@ namespace Nikse.SubtitleEdit.Forms
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem,
this.EditLastAdditionsToolStripMenuItem});
this.contextMenuStripListview.Name = "contextMenuStripListview";
this.contextMenuStripListview.Size = new System.Drawing.Size(306, 220);
this.contextMenuStripListview.Size = new System.Drawing.Size(306, 198);
this.contextMenuStripListview.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListviewOpening);
//
// normalToolStripMenuItem
@ -315,7 +316,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(80, 17);
this.checkBoxRightToLeft.Size = new System.Drawing.Size(83, 17);
this.checkBoxRightToLeft.TabIndex = 40;
this.checkBoxRightToLeft.Text = "Right to left";
this.checkBoxRightToLeft.UseVisualStyleBackColor = true;
@ -454,7 +455,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(165, 17);
this.checkBoxUseModiInTesseractForUnknownWords.Size = new System.Drawing.Size(167, 17);
this.checkBoxUseModiInTesseractForUnknownWords.TabIndex = 39;
this.checkBoxUseModiInTesseractForUnknownWords.Text = "Try MODI for unknown words";
this.checkBoxUseModiInTesseractForUnknownWords.UseVisualStyleBackColor = true;
@ -596,7 +597,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(162, 17);
this.checkBoxGuessUnknownWords.Size = new System.Drawing.Size(164, 17);
this.checkBoxGuessUnknownWords.TabIndex = 39;
this.checkBoxGuessUnknownWords.Text = "Try to guess unknown words";
this.checkBoxGuessUnknownWords.UseVisualStyleBackColor = true;
@ -696,7 +697,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(246, 17);
this.checkBoxPromptForUnknownWords.Size = new System.Drawing.Size(255, 17);
this.checkBoxPromptForUnknownWords.TabIndex = 38;
this.checkBoxPromptForUnknownWords.Text = "Prompt for unknown words (requires dictionary)";
this.checkBoxPromptForUnknownWords.UseVisualStyleBackColor = true;
@ -708,7 +709,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(200, 17);
this.checkBoxAutoBreakLines.Size = new System.Drawing.Size(208, 17);
this.checkBoxAutoBreakLines.TabIndex = 37;
this.checkBoxAutoBreakLines.Text = "Auto break subtitle, if line number > 2";
this.checkBoxAutoBreakLines.UseVisualStyleBackColor = true;
@ -729,7 +730,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(137, 17);
this.checkBoxAutoFixCommonErrors.Size = new System.Drawing.Size(139, 17);
this.checkBoxAutoFixCommonErrors.TabIndex = 34;
this.checkBoxAutoFixCommonErrors.Text = "Fix common OCR errors";
this.checkBoxAutoFixCommonErrors.UseVisualStyleBackColor = true;
@ -761,7 +762,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxBackgroundTransparent.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxBackgroundTransparent.Location = new System.Drawing.Point(144, 16);
this.checkBoxBackgroundTransparent.Name = "checkBoxBackgroundTransparent";
this.checkBoxBackgroundTransparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxBackgroundTransparent.Size = new System.Drawing.Size(85, 17);
this.checkBoxBackgroundTransparent.TabIndex = 8;
this.checkBoxBackgroundTransparent.Text = "Transparent";
this.checkBoxBackgroundTransparent.UseVisualStyleBackColor = true;
@ -782,7 +783,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(83, 17);
this.checkBoxEmphasis2Transparent.Size = new System.Drawing.Size(85, 17);
this.checkBoxEmphasis2Transparent.TabIndex = 6;
this.checkBoxEmphasis2Transparent.Text = "Transparent";
this.checkBoxEmphasis2Transparent.UseVisualStyleBackColor = true;
@ -793,7 +794,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(83, 17);
this.checkBoxEmphasis1Transparent.Size = new System.Drawing.Size(85, 17);
this.checkBoxEmphasis1Transparent.TabIndex = 5;
this.checkBoxEmphasis1Transparent.Text = "Transparent";
this.checkBoxEmphasis1Transparent.UseVisualStyleBackColor = true;
@ -804,7 +805,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(83, 17);
this.checkBoxPatternTransparent.Size = new System.Drawing.Size(85, 17);
this.checkBoxPatternTransparent.TabIndex = 4;
this.checkBoxPatternTransparent.Text = "Transparent";
this.checkBoxPatternTransparent.UseVisualStyleBackColor = true;
@ -858,6 +859,7 @@ namespace Nikse.SubtitleEdit.Forms
//
this.groupBoxSubtitleImage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxSubtitleImage.Controls.Add(this.checkBoxAutoTransparentBackground);
this.groupBoxSubtitleImage.Controls.Add(this.groupBoxImagePalette);
this.groupBoxSubtitleImage.Controls.Add(this.pictureBoxSubtitleImage);
this.groupBoxSubtitleImage.Location = new System.Drawing.Point(412, 6);
@ -895,6 +897,18 @@ namespace Nikse.SubtitleEdit.Forms
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// checkBoxAutoTransparentBackground
//
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(449, 170);
this.checkBoxAutoTransparentBackground.Name = "checkBoxAutoTransparentBackground";
this.checkBoxAutoTransparentBackground.Size = new System.Drawing.Size(168, 17);
this.checkBoxAutoTransparentBackground.TabIndex = 36;
this.checkBoxAutoTransparentBackground.Text = "Auto transparent background";
this.checkBoxAutoTransparentBackground.UseVisualStyleBackColor = true;
this.checkBoxAutoTransparentBackground.CheckedChanged += new System.EventHandler(this.checkBoxAutoTransparentBackground_CheckedChanged);
//
// subtitleListView1
//
this.subtitleListView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -968,6 +982,7 @@ namespace Nikse.SubtitleEdit.Forms
((System.ComponentModel.ISupportInitialize)(this.pictureBoxEmphasis1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPattern)).EndInit();
this.groupBoxSubtitleImage.ResumeLayout(false);
this.groupBoxSubtitleImage.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -1049,5 +1064,6 @@ namespace Nikse.SubtitleEdit.Forms
private System.Windows.Forms.ToolStripSeparator toolStripSeparatorImageCompare;
private System.Windows.Forms.ToolStripMenuItem inspectImageCompareMatchesForCurrentImageToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem EditLastAdditionsToolStripMenuItem;
private System.Windows.Forms.CheckBox checkBoxAutoTransparentBackground;
}
}

View File

@ -158,6 +158,7 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxPatternTransparent.Text = language.Transparent;
checkBoxEmphasis1Transparent.Text = language.Transparent;
checkBoxEmphasis2Transparent.Text = language.Transparent;
checkBoxAutoTransparentBackground.Text = language.AutoTransparentBackground;
checkBoxPromptForUnknownWords.Text = language.PromptForUnknownWords;
groupBoxOcrAutoFix.Text = language.OcrAutoCorrectionSpellchecking;
@ -338,6 +339,8 @@ namespace Nikse.SubtitleEdit.Forms
groupBoxImagePalette.Visible = false;
Text = Configuration.Settings.Language.VobSubOcr.TitleBluRay;
checkBoxAutoTransparentBackground.Checked = false;
checkBoxAutoTransparentBackground.Visible = false;
}
private void LoadImageCompareCharacterDatabaseList()
@ -676,7 +679,8 @@ namespace Nikse.SubtitleEdit.Forms
if (File.Exists(fileName))
{
Bitmap b = new Bitmap(fileName);
b.MakeTransparent();
if (checkBoxAutoTransparentBackground.Checked)
b.MakeTransparent();
return b;
}
}
@ -717,7 +721,8 @@ namespace Nikse.SubtitleEdit.Forms
}
Bitmap bmp = _vobSubMergedPackist[index].SubPicture.GetBitmap(_palette, Color.Transparent, Color.Black, Color.White, Color.Black);
bmp.MakeTransparent();
if (checkBoxAutoTransparentBackground.Checked)
bmp.MakeTransparent();
return bmp;
}
@ -2585,6 +2590,8 @@ namespace Nikse.SubtitleEdit.Forms
Text = Configuration.Settings.Language.VobSubOcr.TitleBluRay;
Text += " - " + Path.GetFileName(_bdnFileName);
checkBoxAutoTransparentBackground.Checked = true;
}
internal void StartOcrFromDelayed()
@ -2678,7 +2685,7 @@ namespace Nikse.SubtitleEdit.Forms
StringBuilder sb = new StringBuilder();
sb.AppendLine("<html>");
sb.AppendLine("<head><title>Subtitle images</title></head>");
sb.AppendLine("<body>");
sb.AppendLine("<body style='text-align:center'>");
for (int i = 0; i < _subtitle.Paragraphs.Count; i++)
{
progressBar1.Value = i;
@ -2766,5 +2773,10 @@ namespace Nikse.SubtitleEdit.Forms
LoadImageCompareBitmaps();
}
private void checkBoxAutoTransparentBackground_CheckedChanged(object sender, EventArgs e)
{
SubtitleListView1SelectedIndexChanged(null, null);
}
}
}

View File

@ -1426,6 +1426,7 @@ can edit in same subtitle file (collaboration)",
ShowOnlyForcedSubtitles = "Show only forced subtitles",
UseTimeCodesFromIdx = "Use time codes from .idx file",
NoMatch = "<No match>",
AutoTransparentBackground = "Auto transparent background"
};
VobSubOcrCharacter = new LanguageStructure.VobSubOcrCharacter

View File

@ -1356,6 +1356,7 @@
public string ShowOnlyForcedSubtitles { get; set; }
public string UseTimeCodesFromIdx { get; set; }
public string NoMatch { get; set; }
public string AutoTransparentBackground { get; set; }
}
public class VobSubOcrCharacter