From 4703e8b6e5629281193f706ea78768b3c91b26c6 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 15 Nov 2024 10:13:48 -0800 Subject: [PATCH 1/2] Fix LT-21934: FLEx freezes when closing Try a Word if parser is running --- Src/LexText/ParserUI/ParserUIStrings.Designer.cs | 9 +++++++++ Src/LexText/ParserUI/ParserUIStrings.resx | 3 +++ Src/LexText/ParserUI/TryAWordDlg.cs | 1 + 3 files changed, 13 insertions(+) diff --git a/Src/LexText/ParserUI/ParserUIStrings.Designer.cs b/Src/LexText/ParserUI/ParserUIStrings.Designer.cs index d34153e430..3773ebc1ab 100644 --- a/Src/LexText/ParserUI/ParserUIStrings.Designer.cs +++ b/Src/LexText/ParserUI/ParserUIStrings.Designer.cs @@ -555,6 +555,15 @@ public static string ksSlotNameSeparator { } } + /// + /// Looks up a localized string similar to Stopping the Parser (may take up to a minute). + /// + public static string ksStoppingParser { + get { + return ResourceManager.GetString("ksStoppingParser", resourceCulture); + } + } + /// /// Looks up a localized string similar to Text. /// diff --git a/Src/LexText/ParserUI/ParserUIStrings.resx b/Src/LexText/ParserUI/ParserUIStrings.resx index 16c9ecb1dc..fa0432d364 100644 --- a/Src/LexText/ParserUI/ParserUIStrings.resx +++ b/Src/LexText/ParserUI/ParserUIStrings.resx @@ -344,4 +344,7 @@ Please enter a comment for the parser report + + Stopping the Parser (may take up to a minute) + \ No newline at end of file diff --git a/Src/LexText/ParserUI/TryAWordDlg.cs b/Src/LexText/ParserUI/TryAWordDlg.cs index 3eac2c4afe..0504c8aab3 100644 --- a/Src/LexText/ParserUI/TryAWordDlg.cs +++ b/Src/LexText/ParserUI/TryAWordDlg.cs @@ -369,6 +369,7 @@ protected override void OnClosed(EventArgs ea) m_persistProvider.PersistWindowSettings(PersistProviderID, this); if (m_parserListener.Connection != null) { + this.Text = ParserUIStrings.ksStoppingParser; m_parserListener.Connection.TryAWordDialogIsRunning = false; m_parserListener.DisconnectFromParser(); } From c931a898a249e5acb966cdd99b5a2d4c010d2b40 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 15 Nov 2024 11:12:39 -0800 Subject: [PATCH 2/2] Remove redundant code --- Src/XCore/xWindow.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Src/XCore/xWindow.cs b/Src/XCore/xWindow.cs index 1f2bcc8afa..50e1e78791 100644 --- a/Src/XCore/xWindow.cs +++ b/Src/XCore/xWindow.cs @@ -1929,8 +1929,6 @@ public bool OnCloseWindow(object sender) { CheckDisposed(); - if (Mediator != null) - Mediator.SendMessage("StopParser", null); this.Close(); return true;