diff --git a/DistFiles/Language Explorer/Configuration/Main.xml b/DistFiles/Language Explorer/Configuration/Main.xml index a29bea9509..a8ee014b05 100644 --- a/DistFiles/Language Explorer/Configuration/Main.xml +++ b/DistFiles/Language Explorer/Configuration/Main.xml @@ -876,6 +876,7 @@ I (RandyR) brought them into this file, just to keep track of them for the time + diff --git a/DistFiles/Language Explorer/Configuration/Words/areaConfiguration.xml b/DistFiles/Language Explorer/Configuration/Words/areaConfiguration.xml index 10fee39719..ff843bbd7d 100644 --- a/DistFiles/Language Explorer/Configuration/Words/areaConfiguration.xml +++ b/DistFiles/Language Explorer/Configuration/Words/areaConfiguration.xml @@ -28,10 +28,10 @@ - + - + @@ -294,7 +294,7 @@ - + diff --git a/Src/LexText/Interlinear/ChooseAnalysisHandler.cs b/Src/LexText/Interlinear/ChooseAnalysisHandler.cs index 79d284bec3..983757219f 100644 --- a/Src/LexText/Interlinear/ChooseAnalysisHandler.cs +++ b/Src/LexText/Interlinear/ChooseAnalysisHandler.cs @@ -282,7 +282,7 @@ public void SetupCombo() var wordform = m_owner.GetWordformOfAnalysis(); // Add the analyses, and recursively the other items. - var guess_services = new AnalysisGuessServices(m_cache, IsParsingMode()); + var guess_services = new AnalysisGuessServices(m_cache, IsParsingDevMode()); var sorted_analyses = guess_services.GetSortedAnalysisGuesses(wordform, m_occurrence, false); foreach (var wa in sorted_analyses) { @@ -311,7 +311,7 @@ void AddAnalysisItems(IWfiAnalysis wa) { AddItem(wa, MakeAnalysisStringRep(wa, m_cache, StyleSheet != null, (m_owner as SandboxBase).RawWordformWs), true); - var guess_services = new AnalysisGuessServices(m_cache, IsParsingMode()); + var guess_services = new AnalysisGuessServices(m_cache, IsParsingDevMode()); var sorted_glosses = guess_services.GetSortedGlossGuesses(wa, m_occurrence); foreach (var gloss in sorted_glosses) { @@ -323,11 +323,11 @@ void AddAnalysisItems(IWfiAnalysis wa) AddItem(wa, MakeSimpleString(ITextStrings.ksNewWordGloss), false, WfiGlossTags.kClassId); } - private bool IsParsingMode() + private bool IsParsingDevMode() { if (Owner?.InterlinDoc?.GetMaster() == null) return false; - return Owner.InterlinDoc.GetMaster().IsParsingMode(); + return Owner.InterlinDoc.GetMaster().IsParsingDevMode(); } protected ITsString MakeSimpleString(String str) diff --git a/Src/LexText/Interlinear/ITextStrings.Designer.cs b/Src/LexText/Interlinear/ITextStrings.Designer.cs index a6fa54ab95..b8ced5ba81 100644 --- a/Src/LexText/Interlinear/ITextStrings.Designer.cs +++ b/Src/LexText/Interlinear/ITextStrings.Designer.cs @@ -1576,15 +1576,6 @@ internal static string ksParsing { } } - /// - /// Looks up a localized string similar to Parsing. - /// - internal static string ksParsingMode { - get { - return ResourceManager.GetString("ksParsingMode", resourceCulture); - } - } - /// /// Looks up a localized string similar to Ph{0} {1}. /// diff --git a/Src/LexText/Interlinear/ITextStrings.resx b/Src/LexText/Interlinear/ITextStrings.resx index 0f730840c8..c8010e0e6d 100644 --- a/Src/LexText/Interlinear/ITextStrings.resx +++ b/Src/LexText/Interlinear/ITextStrings.resx @@ -989,8 +989,4 @@ Click "Cancel" to abort this import. Results may be incomplete. - - Parsing - alternate name for Analyze tab - \ No newline at end of file diff --git a/Src/LexText/Interlinear/InterlinMaster.cs b/Src/LexText/Interlinear/InterlinMaster.cs index e5aca1c26c..bede158f41 100644 --- a/Src/LexText/Interlinear/InterlinMaster.cs +++ b/Src/LexText/Interlinear/InterlinMaster.cs @@ -55,8 +55,6 @@ public partial class InterlinMaster : InterlinMasterBase, IFocusablePanePortion private string m_currentTool = ""; - private string m_analyzeTabName = ""; - public string CurrentTool { get { return m_currentTool; } @@ -89,8 +87,6 @@ public InterlinMaster() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); - // Save the Analyze tab name. - m_analyzeTabName = m_tpInterlinear.Text; } internal string BookmarkId @@ -725,7 +721,7 @@ public override void Init(Mediator mediator, PropertyTable propertyTable, XmlNod m_mediator = mediator; // InitBase will do this, but we need it in place before calling SetInitialTabPage(). m_propertyTable = propertyTable; - SetParsingMode(IsParsingMode()); + SetParsingDevMode(IsParsingDevMode()); // Making the tab control currently requires this first... if (!fHideTitlePane) @@ -1251,20 +1247,21 @@ public bool OnConfigureInterlinear(object argument) return true; // We handled this } - public bool OnDisplaySetParsingMode(object commandObject, + public bool OnDisplaySetParsingDevMode(object commandObject, ref UIItemDisplayProperties display) { var cmd = (Command)commandObject; bool value = cmd.GetParameter("value") == "true"; - display.Checked = IsParsingMode() == value; + display.Checked = IsParsingDevMode() == value; return true; } - public bool OnSetParsingMode(object argument) + public bool OnSetParsingDevMode(object argument) { var cmd = (Command)argument; string value = cmd.GetParameter("value"); - SetParsingMode(value == "true"); + SetParsingDevMode(value == "true"); + Clerk.UpdateParsingDevStatusBarPanel(); // Refresh the display. RootStText = null; m_idcAnalyze.ResetAnalysisCache(); @@ -1272,23 +1269,14 @@ public bool OnSetParsingMode(object argument) return true; // we handled this } - public void SetParsingMode(bool value) + public void SetParsingDevMode(bool value) { - m_propertyTable.SetProperty("ParsingMode", value, PropertyTable.SettingsGroup.LocalSettings, false); - if (value) - { - m_tpInterlinear.Text = ITextStrings.ksParsingMode; - } - else - { - // Restore Analyze tab name. - m_tpInterlinear.Text = m_analyzeTabName; - } + m_propertyTable.SetProperty("ParsingDevMode", value, PropertyTable.SettingsGroup.LocalSettings, false); } - public bool IsParsingMode() + public bool IsParsingDevMode() { - return m_propertyTable.GetBoolProperty("ParsingMode", false, PropertyTable.SettingsGroup.LocalSettings); + return m_propertyTable.GetBoolProperty("ParsingDevMode", false, PropertyTable.SettingsGroup.LocalSettings); } /// diff --git a/Src/LexText/Interlinear/InterlinVc.cs b/Src/LexText/Interlinear/InterlinVc.cs index 83380f468b..7537a2f2e5 100644 --- a/Src/LexText/Interlinear/InterlinVc.cs +++ b/Src/LexText/Interlinear/InterlinVc.cs @@ -373,15 +373,15 @@ public void ResetAnalysisCache() if (m_loader != null) { CheckDisposed(); - m_loader.ResetGuessCache(IsParsingMode()); + m_loader.ResetGuessCache(IsParsingDevMode()); } } - internal bool IsParsingMode() + internal bool IsParsingDevMode() { if (RootSite?.GetMaster() == null) return false; - return RootSite.GetMaster().IsParsingMode(); + return RootSite.GetMaster().IsParsingDevMode(); } internal AnalysisGuessServices GuessServices @@ -390,7 +390,7 @@ internal AnalysisGuessServices GuessServices { if (m_loader != null && m_loader.GuessServices != null) return m_loader.GuessServices; - return new AnalysisGuessServices(m_cache, IsParsingMode()); + return new AnalysisGuessServices(m_cache, IsParsingDevMode()); } } @@ -551,7 +551,7 @@ private void SetGuessing(IVwEnv vwenv, int bgColor) private int GetGuessColor(ICmObject obj) { IWfiAnalysis wa; - if (IsParsingMode()) + if (IsParsingDevMode()) { // Parser approval takes precedence over User approval. wa = (obj is IWfiGloss) ? ((IWfiGloss)obj).Analysis : obj as IWfiAnalysis; @@ -2305,7 +2305,7 @@ private void EnsureLoader() internal virtual IParaDataLoader CreateParaLoader() { - return new InterlinViewCacheLoader(new AnalysisGuessServices(m_cache, IsParsingMode()), GuessCache); + return new InterlinViewCacheLoader(new AnalysisGuessServices(m_cache, IsParsingDevMode()), GuessCache); } internal void RecordGuessIfNotKnown(AnalysisOccurrence selected) @@ -2426,7 +2426,7 @@ public interface IParaDataLoader { void LoadParaData(IStTxtPara para); void LoadSegmentData(ISegment seg); - void ResetGuessCache(bool parsingMode); + void ResetGuessCache(bool parsingDevMode); bool UpdatingOccurrence(IAnalysis oldAnalysis, IAnalysis newAnalysis); void RecordGuessIfNotKnown(AnalysisOccurrence occurrence); IAnalysis GetGuessForWordform(IWfiWordform wf, int ws); @@ -2550,11 +2550,11 @@ protected virtual void SetInt(int hvo, int flid, int n) #region IParaDataLoader Members - public void ResetGuessCache(bool parsingMode) + public void ResetGuessCache(bool parsingDevMode) { // recreate the guess services, so they will use the latest FDO data. GuessServices.ClearGuessData(); - GuessServices.PrioritizeParser = parsingMode; + GuessServices.PrioritizeParser = parsingDevMode; // clear the cache for the guesses, so it won't have any stale data. m_guessCache.ClearPropFromCache(InterlinViewDataCache.AnalysisMostApprovedFlid); } diff --git a/Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs b/Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs index a0fb2f2838..b458f1d098 100644 --- a/Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs +++ b/Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs @@ -115,11 +115,11 @@ internal InterlinComboHandler(SandboxBase sandbox) m_rootb = sandbox.RootBox; } - internal bool IsParsingMode() + internal bool IsParsingDevMode() { if (m_sandbox.InterlinDoc?.GetMaster() == null) return false; - return m_sandbox.InterlinDoc.GetMaster().IsParsingMode(); + return m_sandbox.InterlinDoc.GetMaster().IsParsingDevMode(); } @@ -1134,7 +1134,7 @@ private void AddAnalysesOf(IWfiWordform wordform, bool fBaseWordIsPhrase) return; // no real wordform, can't have analyses. ITsStrBldr builder = TsStringUtils.MakeStrBldr(); ITsString space = TsStringUtils.MakeString(fBaseWordIsPhrase ? " " : " ", m_wsVern); - var guess_services = new AnalysisGuessServices(m_caches.MainCache, IsParsingMode()); + var guess_services = new AnalysisGuessServices(m_caches.MainCache, IsParsingDevMode()); var sorted_analyses = guess_services.GetSortedAnalysisGuesses(wordform, m_wsVern); foreach (IWfiAnalysis wa in sorted_analyses) { @@ -3210,7 +3210,7 @@ private void AddComboItems(ref int hvoEmptyGloss, ITsStrBldr tsb, IWfiAnalysis w { IList wsids = m_sandbox.m_choices.EnabledWritingSystemsForFlid(InterlinLineChoices.kflidWordGloss); - var guess_services = new AnalysisGuessServices(m_caches.MainCache, IsParsingMode()); + var guess_services = new AnalysisGuessServices(m_caches.MainCache, IsParsingDevMode()); var sorted_glosses = guess_services.GetSortedGlossGuesses(wa); foreach (IWfiGloss gloss in sorted_glosses) { diff --git a/Src/xWorks/RecordClerk.cs b/Src/xWorks/RecordClerk.cs index b3588d4774..d7fee30850 100644 --- a/Src/xWorks/RecordClerk.cs +++ b/Src/xWorks/RecordClerk.cs @@ -609,6 +609,7 @@ internal protected bool UpdateFiltersAndSortersIfNeeded() bool fRestoredFilter = TryRestoreFilter(m_clerkConfiguration, Cache); UpdateFilterStatusBarPanel(); UpdateSortStatusBarPanel(); + UpdateParsingDevStatusBarPanel(); return fRestoredSorter || fRestoredFilter; } @@ -2088,6 +2089,7 @@ virtual public void ActivateUI(bool useRecordTreeBar, bool updateStatusBar = tru return; UpdateFilterStatusBarPanel(); UpdateSortStatusBarPanel(); + UpdateParsingDevStatusBarPanel(); } /// @@ -2851,6 +2853,29 @@ protected virtual string FilterStatusContents(bool listIsFiltered) return listIsFiltered ? xWorksStrings.Filtered : ""; } + public void UpdateParsingDevStatusBarPanel() + { + if (!IsControllingTheRecordTreeBar) + return; // none of our business! + bool fIgnore = m_propertyTable.GetBoolProperty("IgnoreStatusPanel", false); + if (fIgnore) + return; + + var b = m_propertyTable.GetValue("ParsingDev"); + if (b == null) //Other xworks apps may not have this panel + return; + if (!m_propertyTable.GetBoolProperty("ParsingDevMode", false, PropertyTable.SettingsGroup.LocalSettings)) + { + b.BackBrush = System.Drawing.Brushes.Transparent; + b.TextForReal = ""; + } + else + { + b.BackBrush = System.Drawing.Brushes.Tan; + b.TextForReal = xWorksStrings.ParsingDev; + } + } + private void UpdateSortStatusBarPanel() { if (!IsControllingTheRecordTreeBar) diff --git a/Src/xWorks/xWorksStrings.Designer.cs b/Src/xWorks/xWorksStrings.Designer.cs index f9f601320d..2a42e6554a 100644 --- a/Src/xWorks/xWorksStrings.Designer.cs +++ b/Src/xWorks/xWorksStrings.Designer.cs @@ -2618,6 +2618,15 @@ internal static string NotVisibleLabel { } } + /// + /// Looks up a localized string similar to Parsing Dev. + /// + internal static string ParsingDev { + get { + return ResourceManager.GetString("ParsingDev", resourceCulture); + } + } + /// /// Looks up a localized string similar to Max Height (inches):. /// diff --git a/Src/xWorks/xWorksStrings.resx b/Src/xWorks/xWorksStrings.resx index b6ac2a28e9..5170b4d86d 100644 --- a/Src/xWorks/xWorksStrings.resx +++ b/Src/xWorks/xWorksStrings.resx @@ -1298,4 +1298,7 @@ See USFM documentation for help. Max Width (inches): + + Parsing Dev + \ No newline at end of file