-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Enhancement: Select First Day of Week for Locale #127
Conversation
The way this works is:
Now all you need, is to use this on apps or indicators that have a calendar grid, to reorder the grid based on this setting. |
Actually, going to need some help with save-stating this on the checkbox, as currently it jumps to Sunday. |
Ready to review. |
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.
It is possible for first_day
to take an invalid value and the combobox is then blank.
When you select a different locale (but do not set it as default) and then close, first_day
is set to -1
.
I think you should put a range attribute in the schema limiting acceptable entries 0 - 6. Should range check in the code when setting the combobox and when saving the setting as well.
I note that only one first_day
can be saved so if someone needs to switch between two or more locales with different first days they would have to reset it each time. I guess if that is a significant issue it could be addressed in a later PR though.
Could you guide me on how to make a ranged gschema? I've never done that type of thing before. As for the rest about checking on code if it's on the range, I'd wager it should be fixed if the gschema is ranged, wouldn't it? |
I am not quite sure what happens if code tries to write an out of range value to a setting so it is better to be sure this cannot happen one way or another. |
There we go. |
After addressing things, there's a small lag on first open, but shouldn't be anything bad. |
Co-authored-by: Daniel Foré <[email protected]>
Review points addressed. 👍 |
If we can read the first day of the week from Posix then we do not really need a combobox ... There a Posix enum NLTime.FIRST_WEEKDAY in posix.vapi - maybe this is useful? |
The thing is that it's not the problem this PR is solving really reading from Posix and automatically setting things; it's solving the "I'm Spanish, but my system is purposefully in English because I'm studying it or my company set it so, or whatever the reason, so calendars starts on Sunday instead of my country's week start. I can customize via the combobox to make it familiar to me, and keep using my system in English.". Also, we already do that, but now we can show to the user the setting via this, in a future PR as well. |
Please understand that further efforts on Locale and Account Services or ideas like that would bloat this PR and make it not follow the (unwritten?) guideline of a PR doing one thing per PR as I was told many times to do. |
I know this is out of scope, but since there's a discussion already here I don't know where better to put it. I put a bit of info about the posix locale in the original issue. There's also some stuff about this over in the calendar code. Also, there's a potential issue with the |
I am happy for this to be merged on the assumption that further work will be done to ensure that the default setting for this is correct. |
I'm happy to do that since I did the week start stuff in calendar, but it will be a while before I can guarantee. But in theory a "correct" solution that accounts for the posix stuff should be pretty similar to what's in that codebase, assuming I did it right. |
Good - just needs to @danrabbit to sign off on it now. |
I feel like this should start at |
But AFAIK, the Evolution key starts at 1 for Monday. So which futureproofing are we going to push towards? Besides, I think work towards an Automatic Locale thing for the combobox can be done in a new PR. |
Not sure what other future proofing you're referring to? It seems to me like matching Evolution would be a good thing. I'd personally support changing to 1 = Monday, since then we could use it directly as a |
Yeah I think 1-7 starting with Monday seems like the best option since it matches Evolution and GLib.Weekday |
Co-authored-by: Daniel Foré <[email protected]>
Co-authored-by: Daniel Foré <[email protected]>
Co-authored-by: Daniel Foré <[email protected]>
Alright, changes added in. :) |
This eventually will change the order of days on Calendar and Date Time indicator popover by issuing a setting that gets read by both. Fixes #86 .
Looks like: