Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DistFiles/Language Explorer/Configuration/Main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ I (RandyR) brought them into this file, just to keep track of them for the time
<panel id="ProgressBar" width="Contents" minwidth="150" assemblyPath="FwControls.dll" class="SIL.FieldWorks.Common.Controls.StatusBarProgressPanel"/>
<panel id="Sort" width="Contents" minwidth="40" assemblyPath="FwControls.dll" class="SIL.FieldWorks.Common.Controls.StatusBarTextBox"/>
<panel id="Filter" width="Contents" minwidth="40" assemblyPath="FwControls.dll" class="SIL.FieldWorks.Common.Controls.StatusBarTextBox"/>
<panel id="ParsingDev" width="Contents" minwidth="40" assemblyPath="FwControls.dll" class="SIL.FieldWorks.Common.Controls.StatusBarTextBox"/>
<panel id="RecordNumber" width="Contents" minwidth="40"/>
</statusbar>
<!-- ********************************************************** -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
<command id="CmdChooseHCParser" label="Phonological Rule-based Parser (HermitCrab.NET)" message="ChooseParser">
<parameters parser="HC"/>
</command>
<command id="CmdParsingDevelopmentMode" label="Parsing Development" message="SetParsingMode">
<command id="CmdParsingDevelopmentMode" label="Parsing Development" message="SetParsingDevMode">
<parameters value="true"/>
</command>
<command id="CmdTextAnalysisMode" label="Text Analysis" message="SetParsingMode">
<command id="CmdTextGlossingMode" label="Text Glossing" message="SetParsingDevMode">
<parameters value="false"/>
</command>

Expand Down Expand Up @@ -294,7 +294,7 @@
</menu>
<menu id="ChooseModeMenu" label="Interlinear Mode">
<item command="CmdParsingDevelopmentMode"/>
<item command="CmdTextAnalysisMode"/>
<item command="CmdTextGlossingMode"/>
</menu>
<item command="CmdEditParserParameters"/>
</menu>
Expand Down
8 changes: 4 additions & 4 deletions Src/LexText/Interlinear/ChooseAnalysisHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down
9 changes: 0 additions & 9 deletions Src/LexText/Interlinear/ITextStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Src/LexText/Interlinear/ITextStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,4 @@ Click "Cancel" to abort this import.</value>
<data name="ComplexConcControl_ResultsMayBeIncomplete" xml:space="preserve">
<value>Results may be incomplete.</value>
</data>
<data name="ksParsingMode" xml:space="preserve">
<value>Parsing</value>
<comment>alternate name for Analyze tab</comment>
</data>
</root>
32 changes: 10 additions & 22 deletions Src/LexText/Interlinear/InterlinMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1251,44 +1247,36 @@ 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();
Clerk.JumpToIndex(Clerk.CurrentIndex);
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);
}

/// <summary>
Expand Down
18 changes: 9 additions & 9 deletions Src/LexText/Interlinear/InterlinVc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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());
}
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -3210,7 +3210,7 @@ private void AddComboItems(ref int hvoEmptyGloss, ITsStrBldr tsb, IWfiAnalysis w
{
IList<int> 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)
{
Expand Down
25 changes: 25 additions & 0 deletions Src/xWorks/RecordClerk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ internal protected bool UpdateFiltersAndSortersIfNeeded()
bool fRestoredFilter = TryRestoreFilter(m_clerkConfiguration, Cache);
UpdateFilterStatusBarPanel();
UpdateSortStatusBarPanel();
UpdateParsingDevStatusBarPanel();
return fRestoredSorter || fRestoredFilter;
}

Expand Down Expand Up @@ -2088,6 +2089,7 @@ virtual public void ActivateUI(bool useRecordTreeBar, bool updateStatusBar = tru
return;
UpdateFilterStatusBarPanel();
UpdateSortStatusBarPanel();
UpdateParsingDevStatusBarPanel();
}

/// <summary>
Expand Down Expand Up @@ -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<StatusBarTextBox>("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)
Expand Down
9 changes: 9 additions & 0 deletions Src/xWorks/xWorksStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Src/xWorks/xWorksStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1298,4 +1298,7 @@ See USFM documentation for help.</value>
<data name="PictureOptionsView_MaxWidthLabel" xml:space="preserve">
<value>Max Width (inches):</value>
</data>
<data name="ParsingDev" xml:space="preserve">
<value>Parsing Dev</value>
</data>
</root>
Loading