mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Merge branch 'SubtitleEdit:main' into main
This commit is contained in:
commit
94b1b4e158
@ -876,6 +876,7 @@
|
||||
<Word from="koaj" to="koja" />
|
||||
<Word from="kofu" to="kavu" />
|
||||
<Word from="kogao" to="mogao" />
|
||||
<Word from="kojiam" to="kojima" />
|
||||
<Word from="kola" to="auto" />
|
||||
<Word from="kolima" to="autu" />
|
||||
<Word from="komandni" to="zapovjedni" />
|
||||
@ -2710,6 +2711,7 @@
|
||||
<Word from="uopšte" to="uopće" />
|
||||
<Word from="uopše" to="uopće" />
|
||||
<Word from="uopče" to="uopće" />
|
||||
<Word from="uopcr" to="uopće" />
|
||||
<Word from="upakujem" to="upakiram" />
|
||||
<Word from="upakovano" to="upakirano" />
|
||||
<Word from="upustva" to="uputstva" />
|
||||
@ -3035,6 +3037,7 @@
|
||||
<Word from="zevati" to="zijevati" />
|
||||
<Word from="zevali" to="zijevali" />
|
||||
<Word from="zobg" to="zbog" />
|
||||
<Word from="zgob" to="zbog" />
|
||||
<Word from="zdelu" to="zdjelu" />
|
||||
<Word from="zdrvo" to="zdravo" />
|
||||
<Word from="Zdrvo" to="Zdravo" />
|
||||
@ -5380,6 +5383,7 @@
|
||||
<RegEx find="mrn" replaceWith="men" />
|
||||
<RegEx find="mro([as])" replaceWith="mor$1" />
|
||||
<RegEx find="msč" replaceWith="mač" />
|
||||
<RegEx find="msd" replaceWith="mad" />
|
||||
<RegEx find="([Mm])sl" replaceWith="$1isl" />
|
||||
<RegEx find="mtić" replaceWith="mtit ć" />
|
||||
<RegEx find="mzn" replaceWith="mun" />
|
||||
@ -5517,6 +5521,7 @@
|
||||
<RegEx find="rčaće" replaceWith="rčat će" />
|
||||
<RegEx find="renaduvan" replaceWith="renapuhan" />
|
||||
<RegEx find="resed" replaceWith="resjed" />
|
||||
<RegEx find="rgk" replaceWith="rgl" />
|
||||
<RegEx find="rgv" replaceWith="rgov" />
|
||||
<RegEx find="rijedel" replaceWith="rijedil" />
|
||||
<RegEx find="r([mv])isa" replaceWith="r$1ira" />
|
||||
@ -5552,7 +5557,7 @@
|
||||
<RegEx find="(?<!star)aćemo" replaceWith="at ćemo" />
|
||||
<RegEx find="\bstaral" replaceWith="brinul" />
|
||||
<RegEx find="\bStaral" replaceWith="Brinul" />
|
||||
<RegEx find="stba" replaceWith="stva" />
|
||||
<RegEx find="tba" replaceWith="tva" />
|
||||
<RegEx find="stkl" replaceWith="stakl" />
|
||||
<RegEx find="struis" replaceWith="struir" />
|
||||
<RegEx find="struiše" replaceWith="struira" />
|
||||
@ -5720,6 +5725,7 @@
|
||||
<RegEx find="zvešć" replaceWith="zvest ć" />
|
||||
<RegEx find="zvolić" replaceWith="zvolit ć" />
|
||||
<RegEx find="zwm" replaceWith="zem" />
|
||||
<RegEx find="žw" replaceWith="ze" />
|
||||
<RegEx find="žbać" replaceWith="žbat ć" />
|
||||
<RegEx find="žalj?ev" replaceWith="žalijev" />
|
||||
<RegEx find="([žzt])ivać" replaceWith="$1ivat ć" />
|
||||
|
@ -474,6 +474,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
internal MakeBitmapParameter MakeMakeBitmapParameter(int index, int screenWidth, int screenHeight)
|
||||
{
|
||||
var p = _subtitle.GetParagraphOrDefault(index);
|
||||
if (p == null)
|
||||
{
|
||||
p = new Paragraph();
|
||||
}
|
||||
|
||||
var parameter = new MakeBitmapParameter
|
||||
{
|
||||
Type = _exportType,
|
||||
@ -510,6 +515,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
FullFrame = checkBoxFullFrameImage.Checked,
|
||||
FullFrameBackgroundColor = panelFullFrameBackground.BackColor,
|
||||
};
|
||||
|
||||
if (index < _subtitle.Paragraphs.Count)
|
||||
{
|
||||
parameter.P = _subtitle.Paragraphs[index];
|
||||
@ -571,6 +577,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
parameter.P = null;
|
||||
}
|
||||
|
||||
return parameter;
|
||||
}
|
||||
|
||||
|
55
src/ui/Forms/FindDialog.Designer.cs
generated
55
src/ui/Forms/FindDialog.Designer.cs
generated
@ -28,6 +28,7 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.textBoxFind = new Nikse.SubtitleEdit.Controls.NikseTextBox();
|
||||
this.buttonFind = new System.Windows.Forms.Button();
|
||||
this.radioButtonNormal = new System.Windows.Forms.RadioButton();
|
||||
@ -39,6 +40,12 @@
|
||||
this.checkBoxWholeWord = new System.Windows.Forms.CheckBox();
|
||||
this.buttonFindPrev = new System.Windows.Forms.Button();
|
||||
this.labelFindWhat = new System.Windows.Forms.Label();
|
||||
this.contextMenuStripNormal = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.contextMenuStripNormal.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textBoxFind
|
||||
@ -171,6 +178,48 @@
|
||||
this.labelFindWhat.TabIndex = 12;
|
||||
this.labelFindWhat.Text = "Find what:";
|
||||
//
|
||||
// contextMenuStripNormal
|
||||
//
|
||||
this.contextMenuStripNormal.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.cutToolStripMenuItem,
|
||||
this.copyToolStripMenuItem,
|
||||
this.pasteToolStripMenuItem,
|
||||
this.deleteToolStripMenuItem});
|
||||
this.contextMenuStripNormal.Name = "contextMenuStripNormal";
|
||||
this.contextMenuStripNormal.Size = new System.Drawing.Size(145, 92);
|
||||
this.contextMenuStripNormal.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripNormal_Opening);
|
||||
//
|
||||
// cutToolStripMenuItem
|
||||
//
|
||||
this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
|
||||
this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
|
||||
this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
|
||||
this.cutToolStripMenuItem.Text = "Cut";
|
||||
this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click);
|
||||
//
|
||||
// copyToolStripMenuItem
|
||||
//
|
||||
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
|
||||
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
|
||||
this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
|
||||
this.copyToolStripMenuItem.Text = "Copy";
|
||||
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
|
||||
//
|
||||
// pasteToolStripMenuItem
|
||||
//
|
||||
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
|
||||
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
|
||||
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
|
||||
this.pasteToolStripMenuItem.Text = "Paste";
|
||||
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
|
||||
//
|
||||
// deleteToolStripMenuItem
|
||||
//
|
||||
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
|
||||
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
|
||||
this.deleteToolStripMenuItem.Text = "Delete";
|
||||
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
|
||||
//
|
||||
// FindDialog
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -199,6 +248,7 @@
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FindDialog_FormClosing);
|
||||
this.Shown += new System.EventHandler(this.FindDialog_Shown);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormFindDialog_KeyDown);
|
||||
this.contextMenuStripNormal.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@ -217,5 +267,10 @@
|
||||
private System.Windows.Forms.CheckBox checkBoxWholeWord;
|
||||
private System.Windows.Forms.Button buttonFindPrev;
|
||||
private System.Windows.Forms.Label labelFindWhat;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStripNormal;
|
||||
private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
radioButtonRegEx.Text = LanguageSettings.Current.FindDialog.RegularExpression;
|
||||
checkBoxWholeWord.Text = LanguageSettings.Current.FindDialog.WholeWord;
|
||||
buttonCount.Text = LanguageSettings.Current.FindDialog.Count;
|
||||
cutToolStripMenuItem.Text = LanguageSettings.Current.Main.Menu.ContextMenu.Cut;
|
||||
copyToolStripMenuItem.Text = LanguageSettings.Current.Main.Menu.ContextMenu.Copy;
|
||||
pasteToolStripMenuItem.Text = LanguageSettings.Current.Main.Menu.ContextMenu.Paste;
|
||||
deleteToolStripMenuItem.Text = LanguageSettings.Current.Main.Menu.ContextMenu.Delete;
|
||||
|
||||
labelCount.Text = string.Empty;
|
||||
_subtitle = subtitle;
|
||||
_findAndReplaceMethods = findAndReplaceMethods;
|
||||
@ -213,22 +218,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void RadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
// remove any existing context menu
|
||||
textBoxFind.ContextMenuStrip = null;
|
||||
comboBoxFind.ContextMenuStrip = null;
|
||||
|
||||
// only hook context menu if regex radio button is checked
|
||||
if (sender == radioButtonRegEx && radioButtonRegEx.Checked)
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.ContextMenuStrip = FindReplaceDialogHelper.GetRegExContextMenu(textBoxFind);
|
||||
}
|
||||
else if (radioButtonRegEx.Checked)
|
||||
{
|
||||
comboBoxFind.ContextMenuStrip = FindReplaceDialogHelper.GetRegExContextMenu(comboBoxFind);
|
||||
}
|
||||
}
|
||||
SetContextMenuStrip();
|
||||
|
||||
checkBoxWholeWord.Enabled = !radioButtonRegEx.Checked;
|
||||
labelCount.Text = string.Empty;
|
||||
@ -337,6 +327,32 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
buttonFindPrev.Focus();
|
||||
}
|
||||
|
||||
private void SetContextMenuStrip()
|
||||
{
|
||||
comboBoxFind.ContextMenuStrip = null;
|
||||
textBoxFind.ContextMenuStrip = null;
|
||||
|
||||
if (radioButtonRegEx.Checked)
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.ContextMenuStrip = FindReplaceDialogHelper.GetRegExContextMenu(textBoxFind);
|
||||
}
|
||||
else if (radioButtonRegEx.Checked)
|
||||
{
|
||||
comboBoxFind.ContextMenuStrip = FindReplaceDialogHelper.GetRegExContextMenu(comboBoxFind);
|
||||
}
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
comboBoxFind.ContextMenuStrip = contextMenuStripNormal;
|
||||
}
|
||||
else
|
||||
{
|
||||
textBoxFind.ContextMenuStrip = contextMenuStripNormal;
|
||||
}
|
||||
}
|
||||
|
||||
private void FindDialog_Shown(object sender, EventArgs e)
|
||||
{
|
||||
if (comboBoxFind.Visible)
|
||||
@ -347,6 +363,103 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
textBoxFind.Focus();
|
||||
}
|
||||
|
||||
SetContextMenuStrip();
|
||||
}
|
||||
|
||||
private void cutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.Cut();
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
if (comboBoxFind.SelectedText.Length > 0)
|
||||
{
|
||||
Clipboard.SetText(comboBoxFind.SelectedText);
|
||||
comboBoxFind.SelectedText = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.Copy();
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
if (comboBoxFind.SelectedText.Length > 0)
|
||||
{
|
||||
Clipboard.SetText(comboBoxFind.SelectedText);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var text = Clipboard.GetText();
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.Paste(text);
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
comboBoxFind.SelectedText = text;
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.SelectedText = string.Empty;
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
comboBoxFind.SelectedText = string.Empty;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private void contextMenuStripNormal_Opening(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
pasteToolStripMenuItem.Enabled = Clipboard.ContainsText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -117,4 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="contextMenuStripNormal.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
110
src/ui/Forms/ReplaceDialog.Designer.cs
generated
110
src/ui/Forms/ReplaceDialog.Designer.cs
generated
@ -28,6 +28,7 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.radioButtonRegEx = new System.Windows.Forms.RadioButton();
|
||||
this.radioButtonCaseSensitive = new System.Windows.Forms.RadioButton();
|
||||
this.radioButtonNormal = new System.Windows.Forms.RadioButton();
|
||||
@ -42,6 +43,18 @@
|
||||
this.comboBoxFindReplaceIn = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.labelFindReplaceIn = new Nikse.SubtitleEdit.Controls.NikseLabel();
|
||||
this.comboBoxFind = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.contextMenuStripNormal = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.contextMenuStripReplace = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.toolStripMenuItemCutReplace = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItemCopyReplace = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItemPasteReplace = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItemDeleteReplace = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.contextMenuStripNormal.SuspendLayout();
|
||||
this.contextMenuStripReplace.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// radioButtonRegEx
|
||||
@ -116,6 +129,7 @@
|
||||
//
|
||||
// textBoxReplace
|
||||
//
|
||||
this.textBoxReplace.ContextMenuStrip = this.contextMenuStripReplace;
|
||||
this.textBoxReplace.FocusedColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
|
||||
this.textBoxReplace.Location = new System.Drawing.Point(15, 71);
|
||||
this.textBoxReplace.Name = "textBoxReplace";
|
||||
@ -220,6 +234,90 @@
|
||||
this.comboBoxFind.UsePopupWindow = false;
|
||||
this.comboBoxFind.KeyDown += new System.Windows.Forms.KeyEventHandler(this.comboBoxFind_KeyDown);
|
||||
//
|
||||
// contextMenuStripNormal
|
||||
//
|
||||
this.contextMenuStripNormal.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.cutToolStripMenuItem,
|
||||
this.copyToolStripMenuItem,
|
||||
this.pasteToolStripMenuItem,
|
||||
this.deleteToolStripMenuItem});
|
||||
this.contextMenuStripNormal.Name = "contextMenuStripNormal";
|
||||
this.contextMenuStripNormal.Size = new System.Drawing.Size(181, 114);
|
||||
this.contextMenuStripNormal.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripNormal_Opening);
|
||||
//
|
||||
// cutToolStripMenuItem
|
||||
//
|
||||
this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
|
||||
this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
|
||||
this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
|
||||
this.cutToolStripMenuItem.Text = "Cut";
|
||||
this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click);
|
||||
//
|
||||
// copyToolStripMenuItem
|
||||
//
|
||||
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
|
||||
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
|
||||
this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
|
||||
this.copyToolStripMenuItem.Text = "Copy";
|
||||
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
|
||||
//
|
||||
// pasteToolStripMenuItem
|
||||
//
|
||||
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
|
||||
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
|
||||
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
|
||||
this.pasteToolStripMenuItem.Text = "Paste";
|
||||
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
|
||||
//
|
||||
// deleteToolStripMenuItem
|
||||
//
|
||||
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
|
||||
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
|
||||
this.deleteToolStripMenuItem.Text = "Delete";
|
||||
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
|
||||
//
|
||||
// contextMenuStripReplace
|
||||
//
|
||||
this.contextMenuStripReplace.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripMenuItemCutReplace,
|
||||
this.toolStripMenuItemCopyReplace,
|
||||
this.toolStripMenuItemPasteReplace,
|
||||
this.toolStripMenuItemDeleteReplace});
|
||||
this.contextMenuStripReplace.Name = "contextMenuStripNormal";
|
||||
this.contextMenuStripReplace.Size = new System.Drawing.Size(145, 92);
|
||||
this.contextMenuStripReplace.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripReplace_Opening);
|
||||
//
|
||||
// toolStripMenuItemCutReplace
|
||||
//
|
||||
this.toolStripMenuItemCutReplace.Name = "toolStripMenuItemCutReplace";
|
||||
this.toolStripMenuItemCutReplace.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
|
||||
this.toolStripMenuItemCutReplace.Size = new System.Drawing.Size(180, 22);
|
||||
this.toolStripMenuItemCutReplace.Text = "Cut";
|
||||
this.toolStripMenuItemCutReplace.Click += new System.EventHandler(this.toolStripMenuItemCutReplace_Click);
|
||||
//
|
||||
// toolStripMenuItemCopyReplace
|
||||
//
|
||||
this.toolStripMenuItemCopyReplace.Name = "toolStripMenuItemCopyReplace";
|
||||
this.toolStripMenuItemCopyReplace.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
|
||||
this.toolStripMenuItemCopyReplace.Size = new System.Drawing.Size(180, 22);
|
||||
this.toolStripMenuItemCopyReplace.Text = "Copy";
|
||||
this.toolStripMenuItemCopyReplace.Click += new System.EventHandler(this.toolStripMenuItemCopyReplace_Click);
|
||||
//
|
||||
// toolStripMenuItemPasteReplace
|
||||
//
|
||||
this.toolStripMenuItemPasteReplace.Name = "toolStripMenuItemPasteReplace";
|
||||
this.toolStripMenuItemPasteReplace.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
|
||||
this.toolStripMenuItemPasteReplace.Size = new System.Drawing.Size(180, 22);
|
||||
this.toolStripMenuItemPasteReplace.Text = "Paste";
|
||||
this.toolStripMenuItemPasteReplace.Click += new System.EventHandler(this.toolStripMenuItemPasteReplace_Click);
|
||||
//
|
||||
// toolStripMenuItemDeleteReplace
|
||||
//
|
||||
this.toolStripMenuItemDeleteReplace.Name = "toolStripMenuItemDeleteReplace";
|
||||
this.toolStripMenuItemDeleteReplace.Size = new System.Drawing.Size(180, 22);
|
||||
this.toolStripMenuItemDeleteReplace.Text = "Delete";
|
||||
this.toolStripMenuItemDeleteReplace.Click += new System.EventHandler(this.toolStripMenuItemDeleteReplace_Click);
|
||||
//
|
||||
// ReplaceDialog
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -252,6 +350,8 @@
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ReplaceDialog_FormClosing);
|
||||
this.Shown += new System.EventHandler(this.ReplaceDialog_Shown);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormReplaceDialog_KeyDown);
|
||||
this.contextMenuStripNormal.ResumeLayout(false);
|
||||
this.contextMenuStripReplace.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@ -273,5 +373,15 @@
|
||||
private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxFindReplaceIn;
|
||||
private Nikse.SubtitleEdit.Controls.NikseLabel labelFindReplaceIn;
|
||||
private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxFind;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStripNormal;
|
||||
private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStripReplace;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemCutReplace;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemCopyReplace;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemPasteReplace;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemDeleteReplace;
|
||||
}
|
||||
}
|
@ -37,6 +37,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
buttonReplace.Text = LanguageSettings.Current.ReplaceDialog.Replace;
|
||||
buttonReplaceAll.Text = LanguageSettings.Current.ReplaceDialog.ReplaceAll;
|
||||
labelFindReplaceIn.Text = LanguageSettings.Current.ReplaceDialog.FindReplaceIn;
|
||||
cutToolStripMenuItem.Text = LanguageSettings.Current.Main.Menu.ContextMenu.Cut;
|
||||
copyToolStripMenuItem.Text = LanguageSettings.Current.Main.Menu.ContextMenu.Copy;
|
||||
pasteToolStripMenuItem.Text = LanguageSettings.Current.Main.Menu.ContextMenu.Paste;
|
||||
deleteToolStripMenuItem.Text = LanguageSettings.Current.Main.Menu.ContextMenu.Delete;
|
||||
|
||||
if (Width < radioButtonRegEx.Right + 5)
|
||||
{
|
||||
@ -134,6 +138,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
var s = Configuration.Settings.Tools.FindHistory[index];
|
||||
comboBoxFind.Items.Add(s);
|
||||
}
|
||||
|
||||
comboBoxFind.Text = selectedText;
|
||||
comboBoxFind.SelectAll();
|
||||
}
|
||||
@ -155,6 +160,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
textBoxReplace.Text = findHelper.ReplaceText.Replace(Environment.NewLine, "\\n");
|
||||
}
|
||||
|
||||
textBoxFind.SelectAll();
|
||||
if (findHelper.FindReplaceType.FindType == FindType.RegEx)
|
||||
{
|
||||
@ -310,11 +316,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void RadioButtonCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
textBoxFind.ContextMenuStrip = sender == radioButtonRegEx
|
||||
? FindReplaceDialogHelper.GetRegExContextMenu(textBoxFind)
|
||||
: null;
|
||||
|
||||
checkBoxWholeWord.Enabled = !radioButtonRegEx.Checked;
|
||||
SetContextMenuStrip();
|
||||
}
|
||||
|
||||
private void TextBoxFindKeyDown(object sender, KeyEventArgs e)
|
||||
@ -410,6 +413,154 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
BringToFront();
|
||||
Activate();
|
||||
});
|
||||
|
||||
SetContextMenuStrip();
|
||||
}
|
||||
|
||||
private void SetContextMenuStrip()
|
||||
{
|
||||
comboBoxFind.ContextMenuStrip = null;
|
||||
textBoxFind.ContextMenuStrip = null;
|
||||
|
||||
if (radioButtonRegEx.Checked)
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.ContextMenuStrip = FindReplaceDialogHelper.GetRegExContextMenu(textBoxFind);
|
||||
}
|
||||
else if (radioButtonRegEx.Checked)
|
||||
{
|
||||
comboBoxFind.ContextMenuStrip = FindReplaceDialogHelper.GetRegExContextMenu(comboBoxFind);
|
||||
}
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
comboBoxFind.ContextMenuStrip = contextMenuStripNormal;
|
||||
}
|
||||
else
|
||||
{
|
||||
textBoxFind.ContextMenuStrip = contextMenuStripNormal;
|
||||
}
|
||||
}
|
||||
|
||||
private void cutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.Cut();
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
if (comboBoxFind.SelectedText.Length > 0)
|
||||
{
|
||||
Clipboard.SetText(comboBoxFind.SelectedText);
|
||||
comboBoxFind.SelectedText = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.Copy();
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
if (comboBoxFind.SelectedText.Length > 0)
|
||||
{
|
||||
Clipboard.SetText(comboBoxFind.SelectedText);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var text = Clipboard.GetText();
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.Paste(text);
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
comboBoxFind.SelectedText = text;
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (textBoxFind.Visible)
|
||||
{
|
||||
textBoxFind.SelectedText = string.Empty;
|
||||
}
|
||||
else if (comboBoxFind.Visible)
|
||||
{
|
||||
comboBoxFind.SelectedText = string.Empty;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private void toolStripMenuItemCutReplace_Click(object sender, EventArgs e)
|
||||
{
|
||||
textBoxReplace.Cut();
|
||||
}
|
||||
|
||||
private void toolStripMenuItemCopyReplace_Click(object sender, EventArgs e)
|
||||
{
|
||||
textBoxReplace.Copy();
|
||||
}
|
||||
|
||||
private void toolStripMenuItemPasteReplace_Click(object sender, EventArgs e)
|
||||
{
|
||||
textBoxReplace.Paste();
|
||||
}
|
||||
|
||||
private void toolStripMenuItemDeleteReplace_Click(object sender, EventArgs e)
|
||||
{
|
||||
textBoxReplace.SelectedText = string.Empty;
|
||||
}
|
||||
|
||||
private void contextMenuStripReplace_Opening(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
toolStripMenuItemPasteReplace.Enabled = Clipboard.ContainsText();
|
||||
}
|
||||
|
||||
private void contextMenuStripNormal_Opening(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
pasteToolStripMenuItem.Enabled = Clipboard.ContainsText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -117,4 +117,10 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="contextMenuStripReplace.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>172, 17</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStripNormal.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
@ -2132,10 +2132,12 @@ Transferir e continuar?</VideoFromUrlRequirements>
|
||||
<RegEx>Expressão regular</RegEx>
|
||||
<OddLines>Linhas ímpares</OddLines>
|
||||
<EvenLines>Linhas pares</EvenLines>
|
||||
<DurationLessThan>Duração menor que</DurationLessThan>
|
||||
<DurationGreaterThan>Duração maior que</DurationGreaterThan>
|
||||
<CpsLessThan>CPS menor que</CpsLessThan>
|
||||
<CpsGreaterThan>CPS maior que</CpsGreaterThan>
|
||||
<DurationLessThan>Duração inferior a</DurationLessThan>
|
||||
<DurationGreaterThan>Duração superior a</DurationGreaterThan>
|
||||
<CpsLessThan>CPS inferior a</CpsLessThan>
|
||||
<CpsGreaterThan>CPS superior a</CpsGreaterThan>
|
||||
<LengthLessThan>Comprimento inferior a</LengthLessThan>
|
||||
<LengthGreaterThan>Comprimento superior a</LengthGreaterThan>
|
||||
<ExactlyOneLine>Exactamente uma linha</ExactlyOneLine>
|
||||
<ExactlyTwoLines>Exactamente duas linhas</ExactlyTwoLines>
|
||||
<MoreThanTwoLines>Mais de duas linhas</MoreThanTwoLines>
|
||||
|
@ -21,13 +21,19 @@ namespace Nikse.SubtitleEdit.Logic.CommandLineConvert
|
||||
|
||||
using (var form = new ExportPngXml())
|
||||
{
|
||||
form.Initialize(new Subtitle(), new SubRip(), BatchConvert.BluRaySubtitle, fileName, null, fileName);
|
||||
var sub = tsParser.GetDvbSubtitles(pid);
|
||||
|
||||
var tempSubtitle = new Subtitle();
|
||||
foreach (var x in sub)
|
||||
{
|
||||
tempSubtitle.Paragraphs.Add(new Paragraph(string.Empty, x.StartMilliseconds, x.EndMilliseconds));
|
||||
}
|
||||
|
||||
form.Initialize(tempSubtitle, new SubRip(), BatchConvert.BluRaySubtitle, fileName, null, fileName);
|
||||
|
||||
var language = GetFileNameEnding(programMapTableParser, pid);
|
||||
var outputFileName = CommandLineConverter.FormatOutputFileNameForBatchConvert(Utilities.GetPathAndFileNameWithoutExtension(fileName) + language + Path.GetExtension(fileName), ".sup", outputFolder, overwrite);
|
||||
stdOutWriter?.Write($"{count}: {Path.GetFileName(fileName)} -> PID {pid} to {outputFileName}...");
|
||||
var sub = tsParser.GetDvbSubtitles(pid);
|
||||
progressCallback?.Invoke($"Save PID {pid}");
|
||||
var subtitleScreenSize = GetSubtitleScreenSize(sub, overrideScreenSize, resolution);
|
||||
using (var binarySubtitleFile = new FileStream(outputFileName, FileMode.Create))
|
||||
|
Loading…
Reference in New Issue
Block a user