-
Notifications
You must be signed in to change notification settings - Fork 39
GPII-2729: Onboard Windows 10 Internationalization settings #158
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
Conversation
…egistrySettingsHandler
|
Could one of the admins verify that these changes are reasonable to test? If so, please reply with "ok to test". |
| return togo; | ||
| }; | ||
|
|
||
| windows.isSupportedMsg = function(message) { |
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.
I like the idea of being able to send a message. However, I think it should be placed into a function and called in a "start" or "stop" block, like gpii.launch.exec or gpii.windows.closeProcessByName.
That way, other settings handlers can make use of it.
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.
I like that thought, will be simpler, and useful from all the SettingsHandlers, sadly we have a imminent change for that block coming from this pull. So probably I'm going to update the rest of issues of the pull and leave this one as a TODO, to be fixed when the new blocks could be used.
| }; | ||
|
|
||
| windows.isSupportedMsg = function(message) { | ||
| var hwnd = windows.API_constants[message.hwnd]; |
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 bother? It's not like there can be other values for the hWnd.
I suggest either remove the ability to specify the hWnd, or perhaps accept a string, where it sends the message to windows with a matching caption (and/or classname?), if it's not "HWND_BROADCAST" (using a combination of windows.enumerateWindows and GetWindowText).
|
|
||
| windows.sendWindowMessage = function(message) { | ||
| try { | ||
| if (!windows.isSupportedMsg(message)) { |
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 not just do !hwnd || !msg on 367
|
@JavierJF, that's my first-pass review. I haven't ran it (it has the "Needs Work" label). I agree with your approach. There is a SetLocalInfo API function, and I think that does exactly what you've done - I mean, this works, right? It might be worth creating a small .c program that just calls that function to see if it does anything else... but I doubt it does. I also have an idea - perhaps there could also be a "culture" setting (en-GB, es-ES). It would make all of these individual settings whatever that culture default is for that setting, unless specifically set. GetLocalInfoEx gets this information. |
|
Could one of the admins verify that these changes are reasonable to test? If so, please reply with "ok to test". |
|
ok to test |
|
CI job failed: https://ci.gpii.net/job/windows-tests/461/ |
|
What changed since I last looked? My suggestions:
|
|
CI job failed: https://ci.gpii.net/job/windows-tests/521/ |
+ Removed the ability to specify windows handle in message feature. + Fixed some linter issues.
|
CI job passed: https://ci.gpii.net/job/windows-tests/534/ |
|
CI job passed: https://ci.gpii.net/job/windows-tests/535/ |
|
CI job passed: https://ci.gpii.net/job/windows-tests/538/ |
|
CI job passed: https://ci.gpii.net/job/windows-tests/539/ |
|
CI job failed: https://ci.gpii.net/job/windows-tests/540/ |
|
CI job passed: https://ci.gpii.net/job/windows-tests/541/ |
| return (typeof msg !== undefined); | ||
| }; | ||
|
|
||
| windows.sendWindowMessage = function (message) { |
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.
A jsdoc would be nice
|
|
||
| windows.sendWindowMessage = function (message) { | ||
| try { | ||
| if (!windows.isSupportedMsg(message)) { |
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.
I don't see the point in this any more, considering a check on the message constant is performed on line 258. An else block can be used at 261 instead.
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.
Yes, replacing it for a 'else' for having a switch-case style message check, and logging in case of unsupported.
| }); | ||
|
|
||
| // Test that the "sendWindowMessage" function actually sends the message. | ||
| jqUnit.test("Window Messages - Message sent", function () { |
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 discussed
|
CI job failed: https://ci.gpii.net/job/windows-tests/542/ |
|
ok to test |
|
CI job failed: https://ci.gpii.net/job/windows-tests/544/ |
|
CI job failed: https://ci.gpii.net/job/windows-tests/547/ |
|
ok to test |
|
CI job passed: https://ci.gpii.net/job/windows-tests/548/ |
|
CI job passed: https://ci.gpii.net/job/windows-tests/578/ |
| /** | ||
| * Sends a message to every open window. | ||
| * | ||
| * @param message.msg {number} The message to be sent. |
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.
No doc for the actual message parameter.
In fact, why not unroll these into individual parameters, since they're all required?
| newValue: newValue.value | ||
| }; | ||
| }); | ||
|
|
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.
Stray newline
| * | ||
| * @param message.msg {number} The message to be sent. | ||
| * @param message.wparam {Object} The wparam to be passed to SendWindowNotifyMessageW function. | ||
| * @param message.lparam {Object} The lparam to be passed to SendWindowNotifyMessageW function. |
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.
wparam should be {Number}, and lparam a {String} (considering line 255)
No description provided.