Expose clock format as granite setting#528
Open
jhaygood86 wants to merge 14 commits intoelementary:masterfrom
Open
Expose clock format as granite setting#528jhaygood86 wants to merge 14 commits intoelementary:masterfrom
jhaygood86 wants to merge 14 commits intoelementary:masterfrom
Conversation
Use portal instead of GSettings for clock-format
Also, updates time picker to dynamically re-render using that setting
Adds API to format a GLib.DateTime using system settings so that end user applications don't have to all carry the same code.
Member
|
@jhaygood86 is this still necessary after the other datetime/portals stuff was merged? If so, can you resolve conflicts? |
Contributor
Author
|
Rebase onto changes from portal refactoring |
Contributor
Author
|
@danrabbit It'll still be useful. I've adjusted to account for the new Portal.Settings class being available. |
tintou
reviewed
Dec 9, 2021
| if (_clock_format == null) { | ||
| setup_clock_format (); | ||
| } | ||
| return _clock_format; |
Member
There was a problem hiding this comment.
Suggested change
| return _clock_format; | |
| return _clock_format; |
_clock_format might be null, so we need to explicitly do/
return _clock_format ?? ClockFormat.24H
tintou
reviewed
Dec 9, 2021
tintou
reviewed
Dec 9, 2021
| setup_portal (); | ||
|
|
||
| var clock_format_variant = portal.read (GNOME_DESKTOP_INTERFACE, CLOCK_FORMAT_KEY).get_variant (); | ||
| var format = clock_format_variant.get_string (); |
Member
There was a problem hiding this comment.
Suggested change
| var format = clock_format_variant.get_string (); | |
| unowned var format = clock_format_variant.get_string (); |
tintou
reviewed
Dec 9, 2021
|
|
||
| portal.setting_changed.connect ((@namespace, key, @value) => { | ||
| if (@namespace == GNOME_DESKTOP_INTERFACE && key == CLOCK_FORMAT_KEY) { | ||
| var updated_format = @value.get_string (); |
Member
There was a problem hiding this comment.
Suggested change
| var updated_format = @value.get_string (); | |
| unowned var updated_format = @value.get_string (); |
Reverse order of enum so that 24H is the default
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.
This builds on #527 , but also solves some needs in #525
This: