fix(developer): various project fixes 🦕#10151
Merged
Conversation
From TODO item in #9948.
Fixes #10144. Also adds .keyboard_info, for now, although it is removed in 17.0, as there will be numerous projects which still have a .keyboard_info and it is handy to be able to load it and view its contents while upgrading.
Fixes #10145. Turns out we were clobbering out internal data because Delphi strings are copy-on-write. At the same time, moved from using the Hint property to just referencing the source filename in the array, as that is cleaner anyway.
Fixes #10146. Some developers may wish to stick with kpj-1.0 for now, and the prompt to upgrade would annoying because it cannot be hidden. This resolves that. Note that I haven't at this point renamed UrlRenderer.pas, although it may be worth considering in the future.
Fixes #10148. We now force the SourcePath and BuildPath project properties to be a direct subfolder of the project folder, in order to avoid issues with paths in the future. This is only applied to v2.0 projects, and only enforced via the UI at this point.
User Test ResultsTest specification and instructions User tests are not required Test Artifacts |
mcdurdin
commented
Dec 6, 2023
| Width = 125 | ||
| Height = 25 | ||
| Caption = '&Proxy Settings...' | ||
| Caption = 'Prox&y Settings...' |
Member
Author
There was a problem hiding this comment.
Note: I fixed up overlapping shortcut keys in this dialog pane.
mcdurdin
commented
Dec 6, 2023
Comment on lines
+234
to
243
| var | ||
| buffer: array[0..MAX_PATH] of char; | ||
| begin | ||
| Result := Files[Index]; | ||
| StrPCopy(buffer, Files[Index]); | ||
|
|
||
| if PathCompactPath(0, PWideChar(Result), GetSystemMetrics(SM_CXSCREEN) div 3) then // I4697 | ||
| Result := string(PChar(Result)) // This removes the terminating nul | ||
| if PathCompactPath(0, buffer, GetSystemMetrics(SM_CXSCREEN) div 3) then // I4697 | ||
| Result := buffer // This removes the terminating nul | ||
| else | ||
| Result := ExtractFileName(Files[Index]); | ||
| end; |
Member
Author
There was a problem hiding this comment.
This was badly buggy previously -- PathCompactPath would overwrite Result (note that Result was not guaranteed to be MAX_PATH which is technically a violation of the API contract but was a secondary issue), but as Delphi strings are copy-on-write, it ended up overwriting Files[Index] as well!
69 tasks
Collaborator
|
Changes in this pull request will be available for download in Keyman version 17.0.229-alpha |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A single PR for 4 separate fixes to Keyman Developer, all relating to Projects. The fixes are separated by commit but were small enough and isolated enough that I didn't think I needed to split into separate PRs (yeah, yeah, I know).
fe772e1 fix(developer): Validate SourcePath and BuildPath in Project Settings
Fixes chore(developer): Validate sourcepath and buildpath -- should be at most 1 level deep from project path #10148.
We now force the SourcePath and BuildPath project properties to be a direct subfolder of the project folder, in order to avoid issues with paths in the future. This is only applied to v2.0 projects, and only enforced via the UI at this point.
6c918e6 fix(developer): Option to disable prompting for project upgrade
Fixes feat(developer): Add option to disable prompting for project upgrade #10146.
Some developers may wish to stick with kpj-1.0 for now, and the prompt to upgrade would annoying because it cannot be hidden. This resolves that.
Note that I haven't at this point renamed UrlRenderer.pas, although it may be worth considering in the future.
ccbb00d fix(developer): Open recent files with long paths elided with ellipsis
Fixes bug(developer): Open recently used fails to load files with long paths elided with
...#10145.Turns out we were clobbering out internal data because Delphi strings are copy-on-write. At the same time, moved from using the Hint property to just referencing the source filename in the array, as that is cleaner anyway.
149fc5e fix(developer): Support opening .keyman-touch-layout
Fixes chore(developer): Fix opening various text files from project view, incl. keyman-touch-layout #10144.
Also adds .keyboard_info, for now, although it is removed in 17.0, as there will be numerous projects which still have a .keyboard_info and it is handy to be able to load it and view its contents while upgrading.
4f83c9c chore(developer): remove commented code
From TODO item in feat(developer): Keyman Developer v2.0 Projects #9948.
@keymanapp-test-bot skip
I have already tested these locally and do not think they warrant separate user testing at this point.