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
2 changes: 1 addition & 1 deletion Build/mkall.targets
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
<ChorusNugetVersion>5.2.0-beta0003</ChorusNugetVersion>
<PalasoNugetVersion>15.0.0-beta0117</PalasoNugetVersion>
<ParatextNugetVersion>9.4.0.1-beta</ParatextNugetVersion>
<LcmNugetVersion>11.0.0-beta0124</LcmNugetVersion>
<LcmNugetVersion>11.0.0-beta0125</LcmNugetVersion>
<IcuNugetVersion>70.1.123</IcuNugetVersion>
<HermitCrabNugetVersion>3.6.6</HermitCrabNugetVersion>
<IPCFrameworkVersion>1.1.1-beta0001</IPCFrameworkVersion>
Expand Down
18 changes: 9 additions & 9 deletions Build/nuget-common/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
<package id="SIL.Core" version="8.1.0-beta0035" targetFramework="net461" />
<package id="SIL.DesktopAnalytics" version="4.0.0" targetFramework="net461" />
<package id="SIL.FLExBridge.IPCFramework" version="1.1.1-beta0001" targetFramework="net461" />
<package id="SIL.LCModel.Build.Tasks" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel.Core.Tests" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel.Core" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel.FixData" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel.Tests" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel.Tools" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel.Utils.Tests" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel.Utils" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel" version="11.0.0-beta0124" targetFramework="net461" />
<package id="SIL.LCModel.Build.Tasks" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.LCModel.Core.Tests" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.LCModel.Core" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.LCModel.FixData" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.LCModel.Tests" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.LCModel.Tools" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.LCModel.Utils.Tests" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.LCModel.Utils" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.LCModel" version="11.0.0-beta0125" targetFramework="net461" />
<package id="SIL.Lexicon" version="15.0.0-beta0117" targetFramework="net462" />
<package id="SIL.libpalaso.l10ns" version="6.0.0" targetFramework="net461" />
<package id="SIL.Lift" version="15.0.0-beta0117" targetFramework="net462" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
</command>
<command id="CmdInflAffixTemplate-Remove-InflAffixMsa" label="Remove YYY from XXX" message="InflTemplateRemoveInflAffixMsa" icon="Remove">
<parameters field="AffixCategory" className="MoInflAffMsa"/>
</command>
<command id="CmdInflAffixTemplate-MoveUp-InflAffixMsa" label="Move YYY Affix Up" message="InflTemplateMoveUpInflAffixMsa" icon="MoveUp">
<parameters field="AffixCategory" className="MoInflAffMsa"/>
</command>
<command id="CmdInflAffixTemplate-MoveDown-InflAffixMsa" label="Move YYY Affix Down" message="InflTemplateMoveDownInflAffixMsa" icon="MoveDown">
<parameters field="AffixCategory" className="MoInflAffMsa"/>
<!-- this needs to be changed when the model changes -->
</command>
</commands>
Expand All @@ -63,6 +69,8 @@
<item command="CmdInflAffixTemplate-Toggle-Slot-Optionality"/>
<item command="CmdInflAffixTemplate-Remove-Slot"/>
<item command="CmdInflAffixTemplate-Remove-InflAffixMsa"/>
<item command="CmdInflAffixTemplate-MoveUp-InflAffixMsa"/>
<item command="CmdInflAffixTemplate-MoveDown-InflAffixMsa"/>
<item command="CmdEntryJumpToDefault"/>
<item command="CmdInflAffixTemplate-Help"/>
</menu>
Expand Down
63 changes: 63 additions & 0 deletions Src/LexText/Morphology/InflAffixTemplateControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using SIL.LCModel.Infrastructure;
using SIL.Utils;
using XCore;
using SIL.LCModel.DomainServices;

namespace SIL.FieldWorks.XWorks.MorphologyEditor
{
Expand Down Expand Up @@ -348,6 +349,42 @@ public bool OnInflTemplateRemoveInflAffixMsa(object cmd)
return true; //we handled this.
}

public bool OnInflTemplateMoveUpInflAffixMsa(object cmd)
{
return MoveInflAffixMsa(true);
}
public bool OnInflTemplateMoveDownInflAffixMsa(object cmd)
{
return MoveInflAffixMsa(false);
}

private bool MoveInflAffixMsa(bool up)
{
CheckDisposed();

var inflMsa = m_obj as IMoInflAffMsa;
if (inflMsa == null)
return true; // play it safe
if (!MoveableMSA(inflMsa, up))
return true;
UndoableUnitOfWorkHelper.Do(MEStrings.ksUndoRemovingAffix, MEStrings.ksRedoRemovingAffix,
Cache.ActionHandlerAccessor,
() =>
{
List<ICmObject> vals = m_slot.Affixes.ToList<ICmObject>();
int pos = vals.IndexOf(inflMsa);
vals.RemoveAt(pos);
if (up)
vals.Insert(pos - 1, inflMsa);
else
vals.Insert(pos + 1, inflMsa);
int flid = Cache.DomainDataByFlid.MetaDataCache.GetFieldId2(m_slot.ClassID, "Affixes", true);
VirtualOrderingServices.SetVO(m_slot, flid, vals);
});
m_rootb.Reconstruct(); // work around because <choice> is not smart enough to remember its dependencies
return true; //we handled this.
}

private bool OtherInflAffixMsasExist(ILexEntry lex, IMoInflAffMsa inflMsa)
{
bool fOtherInflAffixMsasExist = false; // assume we won't find an existing infl affix msa
Expand Down Expand Up @@ -1173,6 +1210,32 @@ internal ITsString MenuLabelForInflTemplateRemoveInflAffixMsa(string sLabel)
return null;
}

/// <summary>
///
/// </summary>
/// <param name="sLabel"></param>
/// <returns></returns>
internal ITsString MenuLabelForInflTemplateMoveInflAffixMsa(string sLabel, bool up, out bool fEnabled)
{
CheckDisposed();
fEnabled = MoveableMSA(m_obj as IMoInflAffMsa, up);
if (m_obj.ClassID == MoInflAffMsaTags.kClassId)
return DetermineMsaContextMenuItemLabel(sLabel);
else
return null;
}

internal bool MoveableMSA(IMoInflAffMsa msa, bool up)
{
List<ICmObject> vals = m_slot.Affixes.ToList<ICmObject>();
int pos = vals.IndexOf(msa);
if (up && pos == 0)
return false; // Cannot move up.
if (!up && pos == vals.Count - 1)
return false; // Cannot move down.
return true;
}

/// <summary>
///
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions Src/LexText/Morphology/InflAffixTemplateMenuHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@ private System.Collections.Generic.List<FwMenuItem> BuildMenu(string menuId)
case "InflTemplateRemoveInflAffixMsa":
tssLabel = m_inflAffixTemplateCtrl.MenuLabelForInflTemplateRemoveInflAffixMsa(sLabel);
break;
case "InflTemplateMoveUpInflAffixMsa":
tssLabel = m_inflAffixTemplateCtrl.MenuLabelForInflTemplateMoveInflAffixMsa(sLabel, true, out fEnabled);
break;
case "InflTemplateMoveDownInflAffixMsa":
tssLabel = m_inflAffixTemplateCtrl.MenuLabelForInflTemplateMoveInflAffixMsa(sLabel, false, out fEnabled);
break;
case "JumpToTool":
tssLabel = m_inflAffixTemplateCtrl.MenuLabelForJumpToTool(sLabel);
break;
Expand Down
Loading