Skip to content

Commit 1848ae2

Browse files
committed
Fix LT-22539: Loss of focus from gloss field
1 parent 53d5dbb commit 1848ae2

4 files changed

Lines changed: 16 additions & 7 deletions

File tree

Src/Common/FwUtils/EventConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public static class EventConstants
3333
public const string RefreshCurrentList = "RefreshCurrentList";
3434
public const string RefreshInterlin = "RefreshInterlin";
3535
public const string RefreshPopupWindowFonts = "RefreshPopupWindowFonts";
36+
public const string RefreshSandbox = "RefreshSandbox";
3637
public const string ReloadAreaTools = "ReloadAreaTools";
3738
public const string RemoveFilters = "RemoveFilters";
3839
public const string RestoreScrollPosition = "RestoreScrollPosition";

Src/LexText/Interlinear/InterlinDocForAnalysis.Designer.cs

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Src/LexText/Interlinear/InterlinDocForAnalysis.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ public InterlinDocForAnalysis()
4747
InitializeComponent();
4848
RightMouseClickedEvent += InterlinDocForAnalysis_RightMouseClickedEvent;
4949
DoSpellCheck = true;
50+
FwUtils.Subscriber.Subscribe(EventConstants.RefreshSandbox, RefreshSandbox);
51+
}
52+
53+
private void RefreshSandbox(object commandObject)
54+
{
55+
if (IsFocusBoxInstalled && FocusBox.SelectedOccurrence != null)
56+
{
57+
FocusBox.SelectOccurrence(FocusBox.SelectedOccurrence);
58+
MoveFocusBoxIntoPlace();
59+
}
5060
}
5161

5262
void InterlinDocForAnalysis_RightMouseClickedEvent(SimpleRootSite sender, FwRightMouseClickEventArgs e)
@@ -113,13 +123,6 @@ public override void PropChanged(int hvo, int tag, int ivMin, int cvIns, int cvD
113123
MoveFocusBoxIntoPlace();
114124
}
115125
}
116-
if (IsFocusBoxInstalled && FocusBox.SelectedOccurrence != null
117-
&& tag == LexSenseTags.kflidGloss && FocusBox.ContainsLexEntry(hvo))
118-
{
119-
// Somebody changed something in the sandbox. Reset the focus box to reflect the change.
120-
FocusBox.SelectOccurrence(FocusBox.SelectedOccurrence);
121-
MoveFocusBoxIntoPlace();
122-
}
123126
}
124127

125128
protected override void UpdateWordforms(HashSet<IWfiWordform> wordforms)

Src/xWorks/PopupToolWindow.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using SIL.FieldWorks.Common.FwUtils;
12
using SIL.FieldWorks.Common.RootSites;
23
using SIL.LCModel;
34
using SIL.Utils;
@@ -58,6 +59,7 @@ private void PopupToolWindow_Deactivate(object sender, EventArgs e)
5859
{
5960
oldActiveClerk.ActivateUI(oldUseRecordTreeBar, oldOldUpdateStatusBar);
6061
}
62+
FwUtils.Publisher.Publish(new PublisherParameterObject("RefreshSandbox"));
6163
}
6264

6365
private void PopupToolWindow_Activated(object sender, EventArgs e)

0 commit comments

Comments
 (0)