More find/replace

This commit is contained in:
niksedk 2023-04-07 08:55:23 +02:00
parent f14ba0ae25
commit 0e4eaedc27
6 changed files with 19 additions and 7 deletions

View File

@ -725,7 +725,8 @@ Read more info (web)?</WhisperNotFound>
</ExtractDateTimeInfo>
<FindDialog>
<Title>Find</Title>
<Find>&amp;Find</Find>
<FindNext>&amp;Find next</FindNext>
<FindPrevious>Find &amp;previous</FindPrevious>
<Normal>&amp;Normal</Normal>
<CaseSensitive>&amp;Case sensitive</CaseSensitive>
<RegularExpression>Regular e&amp;xpression</RegularExpression>

View File

@ -271,12 +271,12 @@ namespace Nikse.SubtitleEdit.Forms
else if (radioButtonNormal.Checked)
{
DialogResult = DialogResult.OK;
_findAndReplaceMethods.FindDialogFindPrevious();
_findAndReplaceMethods.FindDialogFindPrevious(FindText);
}
else if (radioButtonCaseSensitive.Checked)
{
DialogResult = DialogResult.OK;
_findAndReplaceMethods.FindDialogFindPrevious();
_findAndReplaceMethods.FindDialogFindPrevious(FindText);
}
else if (radioButtonRegEx.Checked)
{
@ -284,7 +284,7 @@ namespace Nikse.SubtitleEdit.Forms
{
_regEx = new Regex(RegexUtils.FixNewLine(searchText), RegexOptions.Compiled, TimeSpan.FromSeconds(5));
DialogResult = DialogResult.OK;
_findAndReplaceMethods.FindDialogFindPrevious();
_findAndReplaceMethods.FindDialogFindPrevious(FindText);
}
catch (Exception exception)
{

View File

@ -6245,8 +6245,11 @@ namespace Nikse.SubtitleEdit.Forms
}
}
public void FindDialogFindPrevious()
public void FindDialogFindPrevious(string findText)
{
_findHelper = _findHelper ?? _findDialog.GetFindDialogHelper(_subtitleListViewIndex);
_findHelper.FindText = findText;
_findHelper.FindTextLength = findText.Length;
FindPrevious();
}

View File

@ -9827,13 +9827,15 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
}
}
public void FindDialogFindPrevious()
public void FindDialogFindPrevious(string findText)
{
if (_findHelper == null)
{
return;
}
_findHelper.FindText = findText;
_findHelper.FindTextLength = findText.Length;
_findHelper.InProgress = true;
var tb = textBoxCurrentText;

View File

@ -3,7 +3,7 @@
public interface IFindAndReplace
{
void FindDialogFind(string findText);
void FindDialogFindPrevious();
void FindDialogFindPrevious(string findText);
void FindDialogClose();
void ReplaceDialogFind();

View File

@ -1894,6 +1894,12 @@ namespace Nikse.SubtitleEdit.Logic
case "FindDialog/Title":
language.FindDialog.Title = reader.Value;
break;
case "FindDialog/FindNext":
language.FindDialog.FindNext = reader.Value;
break;
case "FindDialog/FindPrevious":
language.FindDialog.FindPrevious = reader.Value;
break;
case "FindDialog/Normal":
language.FindDialog.Normal = reader.Value;
break;