-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(developer): Support loading XML LDML keyboards in TIKE 🦕 #9963
Conversation
Removes old state load/save from each project file type, and the unused WarnAsError property, in preparation for xmlLdmlProjectFile.
Adds XmlLdml keyboard editor form based on the plain text Editor for now. ActiveEditor is a name used for multiple purposes. Rename to ActiveKmnKeyboardEditor and introduce ActiveLdmlKeyboardEditor alongside.
Because the debugger actions are used only with the kmn keyboard editor, it makes sense to keep them as a separate module, in preparation for supporting XmlLdmlKeyboards.
Adds actions to support LdmlKeyboardEditor, and refactors and reorganizes the existing actions along the way to make them clearer. Compile, Install, and Uninstall supported at this time
User Test ResultsTest specification and instructions User tests are not required |
GHA packaging builds are failing because the branch is missing the latest changes from |
// This appears to be a Delphi compiler bug (RSP-20457) | ||
// Workaround is to make a copy of the parameter locally | ||
// which fixes the reference counting. | ||
FTempFileVersion := FileVersion; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still around? Issue 631 was closed in 2018.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSP-20457 is still not fixed.
CleanFile(OutputFileName); | ||
|
||
if Targets * KMXKeymanTargets <> [] then | ||
CleanFile(ExtractFilePath(FileName) + ExtractFileName(ChangeFileExt(KVKFileName, '.kvk')), True); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is KVKFileName used to establish the file name for CleanFile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is removing a build output, the .kvk file, if it exists.
|
||
function TxmlLdmlProjectFileUI.TestKeymanWeb(FSilent: Boolean): Boolean; // I4409 | ||
(*var | ||
FCompiledName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one of them multi-line comments of dead-code we usually remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Granted, I see this is the part where we'd test an LDML keyboard in Web, which isn't going to be supported for this version. But... surely just saying "Hey, just CTRL-F this function from this other class / file when the time comes" should work well enough? Or do we expect significant differences in how it'd work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on my list to address now in #9948.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Oh yes, there will be significant differences in the kmn debugger and ldml debugger -- they will be completely divergent implementations, I expect)
if not modActionsMain.actFileSave.Execute then Exit; | ||
end | ||
else | ||
Exit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So when ProjecFile is modified and silent is true, this just exists as NOOP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. It exits with a false return value so the caller knows that things didn't work out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For anything "actions", all I can give is an RSLGTM. I'm not familiar with that abstraction from Core whatsoever, so I can't really give much feedback there.
For the rest of it, a plain ol' LGTM.
procedure Load(node: IXMLNode); override; // I4698 | ||
procedure Save(node: IXMLNode); override; // I4698 | ||
procedure LoadState(node: IXMLNode); override; // I4698 | ||
procedure SaveState(node: IXMLNode); override; // I4698 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I'm not quite following the inheritance and/or polymorphism patterns used here and in ProjectFile.pas (as noticed via commit 1), I can see a pretty strong correlation between the methods.
I'm mostly confused why these procedure
s are override
here but virtual
there; I don't see the inheritance path between the two, and personally would've expected them to be sibling derived classes of a common base. But those might be small nits and partly due to my inexperience with Delphi in particular.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation in ProjectFile.pas is the base class, hence it is virtual. The other classes are the overrides and extend the base functionality.
|
||
function TxmlLdmlProjectFileUI.TestKeymanWeb(FSilent: Boolean): Boolean; // I4409 | ||
(*var | ||
FCompiledName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Granted, I see this is the part where we'd test an LDML keyboard in Web, which isn't going to be supported for this version. But... surely just saying "Hey, just CTRL-F this function from this other class / file when the time comes" should work well enough? Or do we expect significant differences in how it'd work?
dlgFont: TFontDialog; | ||
actDebugViewState: TAction; | ||
actDebugSwitchToDebuggerWindow: TAction; | ||
procedure actionsKeyboardEditorUpdate(Action: TBasicAction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As best as I can tell, the method above is new, but all that follow in this list have been migrated from dmActionsKeyboardEditor
within this commit.
Changes in this pull request will be available for download in Keyman version 17.0.211-alpha |
Relates to #9948.
This PR may be more easily reviewed commit-by-commit.
removed obsolete project code: Removes old state load/save from each project file type, and the unused WarnAsError property, in preparation for xmlLdmlProjectFile.
ldmlKeyboard3.dtd
Add basic LDML XML keyboard file support to TIKE projects
Split dmActionsDebugger out of dmActionsKeyboardEditor:
add xmlLdml types and form, rename ActiveEditor:
Actions to support LdmlKeyboardEditor:
@keymanapp-test-bot skip
A full user test of the new XML keyboard functionality will be included in a subsequent PR; there are a number of incomplete features at present which make test difficult.