-
-
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
fix(developer): various project fixes 🦕 #10151
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 |
@@ -29,7 +29,7 @@ inherited frmOptions: TfrmOptions | |||
Top = 185 | |||
Width = 125 | |||
Height = 25 | |||
Caption = '&Proxy Settings...' | |||
Caption = 'Prox&y Settings...' |
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.
Note: I fixed up overlapping shortcut keys in this dialog pane.
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; |
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 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!
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.
lgtm
Changes in this pull request will be available for download in Keyman version 17.0.229-alpha |
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.