-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Expose clock format as granite setting #528
base: master
Are you sure you want to change the base?
Expose clock format as granite setting #528
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.
@jhaygood86 is this still necessary after the other datetime/portals stuff was merged? If so, can you resolve conflicts? |
Rebase onto changes from portal refactoring |
@danrabbit It'll still be useful. I've adjusted to account for the new Portal.Settings class being available. |
if (_clock_format == null) { | ||
setup_clock_format (); | ||
} | ||
return _clock_format; |
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.
return _clock_format; | |
return _clock_format; |
_clock_format might be null, so we need to explicitly do/
return _clock_format ?? ClockFormat.24H
setup_portal (); | ||
|
||
var clock_format_variant = portal.read (GNOME_DESKTOP_INTERFACE, CLOCK_FORMAT_KEY).get_variant (); | ||
var format = clock_format_variant.get_string (); |
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.
var format = clock_format_variant.get_string (); | |
unowned var format = clock_format_variant.get_string (); |
|
||
portal.setting_changed.connect ((@namespace, key, @value) => { | ||
if (@namespace == GNOME_DESKTOP_INTERFACE && key == CLOCK_FORMAT_KEY) { | ||
var updated_format = @value.get_string (); |
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.
var updated_format = @value.get_string (); | |
unowned var updated_format = @value.get_string (); |
Reverse order of enum so that 24H is the default
This builds on #527 , but also solves some needs in #525
This: