mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Fixed replace dialog abort on Linux - thx teguh :)
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@700 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
01964e08fd
commit
9752be4dfb
1
src/Forms/ReplaceDialog.Designer.cs
generated
1
src/Forms/ReplaceDialog.Designer.cs
generated
@ -162,6 +162,7 @@
|
||||
this.Name = "ReplaceDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "Replace";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ReplaceDialog_FormClosing);
|
||||
this.Shown += new System.EventHandler(this.FormReplaceDialog_Shown);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormReplaceDialog_KeyDown);
|
||||
this.Move += new System.EventHandler(this.FormReplaceDialog_Move);
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Enums;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
@ -12,6 +12,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
Regex _regEx;
|
||||
int _left;
|
||||
int _top;
|
||||
bool _userAction = false;
|
||||
|
||||
public ReplaceDialog()
|
||||
{
|
||||
@ -64,9 +65,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private void FormReplaceDialog_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
|
||||
internal void Initialize(string selectedText, FindReplaceDialogHelper findHelper)
|
||||
@ -115,10 +114,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
else if (radioButtonNormal.Checked)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
_userAction = true;
|
||||
}
|
||||
else if (radioButtonCaseSensitive.Checked)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
_userAction = true;
|
||||
}
|
||||
else if (radioButtonRegEx.Checked)
|
||||
{
|
||||
@ -126,6 +127,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
_regEx = new Regex(textBoxFind.Text, RegexOptions.Compiled);
|
||||
DialogResult = DialogResult.OK;
|
||||
_userAction = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@ -190,5 +192,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.Icon = System.Drawing.Icon.FromHandle(Hicon);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReplaceDialog_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (!_userAction)
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user