diff --git a/Src/Common/FwUtils/EventConstants.cs b/Src/Common/FwUtils/EventConstants.cs index 6b278d327e..d5f7999e6f 100644 --- a/Src/Common/FwUtils/EventConstants.cs +++ b/Src/Common/FwUtils/EventConstants.cs @@ -26,6 +26,7 @@ public static class EventConstants public const string PrepareToRefresh = "PrepareToRefresh"; public const string RecordNavigation = "RecordNavigation"; public const string RefreshCurrentList = "RefreshCurrentList"; + public const string RefreshPopupWindowFonts = "RefreshPopupWindowFonts"; public const string ReloadAreaTools = "ReloadAreaTools"; public const string RemoveFilters = "RemoveFilters"; public const string RestoreScrollPosition = "RestoreScrollPosition"; diff --git a/Src/LexText/ParserUI/ParserListener.cs b/Src/LexText/ParserUI/ParserListener.cs index dfea987b77..2b8dcdb5f6 100644 --- a/Src/LexText/ParserUI/ParserListener.cs +++ b/Src/LexText/ParserUI/ParserListener.cs @@ -70,6 +70,7 @@ public class ParserListener : IxCoreColleague, IDisposable, IVwNotifyChange private string m_sourceText = null; private ObservableCollection m_parserReports = null; private ParserReportsDialog m_parserReportsDialog = null; + private IList m_parserReportDialogs = new List(); private string m_defaultComment = null; public void Init(Mediator mediator, PropertyTable propertyTable, XmlNode configurationParameters) @@ -85,6 +86,7 @@ public void Init(Mediator mediator, PropertyTable propertyTable, XmlNode configu m_sda.AddNotification(this); Subscriber.Subscribe(EventConstants.StopParser, StopParser); + Subscriber.Subscribe(EventConstants.RefreshPopupWindowFonts, RefreshPopupWindowFonts); } /// @@ -364,6 +366,7 @@ protected virtual void Dispose(bool disposing) if (disposing) { Subscriber.Unsubscribe(EventConstants.StopParser, StopParser); + Subscriber.Unsubscribe(EventConstants.RefreshPopupWindowFonts, RefreshPopupWindowFonts); // other clients may now parse // Dispose managed resources here. @@ -626,7 +629,7 @@ private void UpdateWordforms(IEnumerable wordforms, ParserPriority // Write an empty parser report. var parserReport = CreateParserReport(); ParserReportViewModel viewModel = AddParserReport(parserReport); - ShowParserReport(viewModel, m_mediator, m_cache); + ShowParserReport(viewModel); } } m_parserConnection.UpdateWordforms(wordforms, priority, checkParser); @@ -681,7 +684,7 @@ private void WordformUpdatedEventHandler(object sender, WordformUpdatedEventArgs // Convert parse results into ParserReport. var parserReport = CreateParserReport(); ParserReportViewModel viewModel = AddParserReport(parserReport); - ShowParserReport(viewModel, m_mediator, m_cache); + ShowParserReport(viewModel); } } @@ -839,13 +842,25 @@ public void ShowParserReports() { ReadParserReports(); // Create parser reports window. - m_parserReportsDialog = new ParserReportsDialog(m_parserReports, m_mediator, m_cache, m_defaultComment); + m_parserReportsDialog = new ParserReportsDialog(m_parserReports, this, m_mediator, m_cache, m_propertyTable, m_defaultComment); m_parserReportsDialog.Closed += ParserReportsDialog_Closed; } m_parserReportsDialog.Show(); // Show the dialog but do not block other app access m_parserReportsDialog.BringIntoView(); } + public void RefreshPopupWindowFonts(object sender) + { + if (m_parserReportsDialog != null) + { + m_parserReportsDialog.SetFont(); + } + foreach (ParserReportDialog dialog in m_parserReportDialogs) + { + dialog.SetFont(); + } + } + private void ParserReportsDialog_Closed(object sender, EventArgs e) { ParserReportsDialog dialog = (ParserReportsDialog)sender; @@ -888,12 +903,22 @@ private ParserReportViewModel AddParserReport(ParserReport parserReport) /// /// Display a parser report window. /// - /// - /// the mediator is used to call TryAWord - public static void ShowParserReport(ParserReportViewModel parserReport, Mediator mediator, LcmCache cache) + public void ShowParserReport(object obj) { - ParserReportDialog dialog = new ParserReportDialog(parserReport, mediator, cache); + ParserReportViewModel parserReport = obj as ParserReportViewModel; + ParserReportDialog dialog = new ParserReportDialog(parserReport, m_mediator, m_cache, m_propertyTable); dialog.Show(); + m_parserReportDialogs.Add(dialog); + dialog.Closed += ParserReportDialog_Closed; + } + + private void ParserReportDialog_Closed(object sender, EventArgs e) + { + ParserReportDialog dialog = (ParserReportDialog)sender; + if (dialog != null) + { + m_parserReportDialogs.Remove(dialog); + } } public bool OnParseAllWords(object argument) diff --git a/Src/LexText/ParserUI/ParserReportDialog.xaml b/Src/LexText/ParserUI/ParserReportDialog.xaml index 793ccd6450..2407087c09 100644 --- a/Src/LexText/ParserUI/ParserReportDialog.xaml +++ b/Src/LexText/ParserUI/ParserReportDialog.xaml @@ -133,7 +133,7 @@ - +