GNOME Bugzilla – Bug 658352
Use timedated dbus api (initial daemon in systemd)
Last modified: 2012-01-23 16:17:12 UTC
To replace the one in gnome-settings-daemon. The API is here: http://www.freedesktop.org/wiki/Software/systemd/timedated It's missing the SetDate and AdjustTime methods, but they weren't being used anyway.
Created attachment 196393 [details] [review] preliminary patch This is preliminary version of the patch, still few things to solve. I made it to use gdbus-codegen to always re-generate C sources from the attached d-bus interface xml file. That one was created using `gdbus introspect` from the running systemd 35 version. Since we often build in a limited chroot, introspection is not done automatically, sticking to a distributed interface version should be sufficient. The patch requires systemd 36 version (not yet released) in order to get the https://bugs.freedesktop.org/show_bug.cgi?id=40583 fix. Standing issues: - the Unlock button can hold a single polkit action only, while timedated provides four, each for the particular call. Filed https://bugs.freedesktop.org/show_bug.cgi?id=40839. While we can remove the button after all, it's not convenient to enter root password four times to get the settings done. Another thing is the simplicity of not handling errors or auth cancellation - we would simply expect the timedated calls to succeed, given that we've already gained authorization. - right now we don't touch the LocalRTC/UTC settings, do we want to bother the user? A good argument for leaving this untouched is maintaining compatibility with other OSes. - I've also removed set-timezone.{c,h} as it seems to be a test program for the old gnome-settings-daemon DateTimeMechanism service
Review of attachment 196393 [details] [review]: We could probably also monitor the properties changing remotely, if them changing wasn't our work? (eg. automatic timezone switching based on location for example, would need to change the timezone even if things are disabled). ::: panels/datetime/Makefile.am @@ +110,3 @@ +# > timedated1-interface.xml + +# --xml \ Those 2 should be added to CLEANFILES. @@ +115,3 @@ + --interface-prefix org.freedesktop. \ + --generate-c-code timedated \ +# --dest org.freedesktop.timedate1 \ That file is missing from EXTRA_DIST.
Created attachment 198540 [details] [review] proposed patch (In reply to comment #2) > We could probably also monitor the properties changing remotely, if them > changing wasn't our work? (eg. automatic timezone switching based on location > for example, would need to change the timezone even if things are disabled). Agree, good idea. This updated patch monitors remote property changes and updates the UI to reflect timedated actual settings. Again with the property value workaround (https://bugs.freedesktop.org/show_bug.cgi?id=37632). I also had to shuffle UI update bits a little. > ::: panels/datetime/Makefile.am > @@ +110,3 @@ > +# > timedated1-interface.xml > + > +# --xml \ > > Those 2 should be added to CLEANFILES. > > @@ +115,3 @@ > + --interface-prefix org.freedesktop. \ > + --generate-c-code timedated \ > +# --dest org.freedesktop.timedate1 \ > > That file is missing from EXTRA_DIST. Fixed. (In reply to comment #1) > Standing issues: > - the Unlock button can hold a single polkit action only, while timedated > provides four, each for the particular call. Filed > https://bugs.freedesktop.org/show_bug.cgi?id=40839. While we can remove the > button after all, it's not convenient to enter root password four times to get > the settings done. Another thing is the simplicity of not handling errors or > auth cancellation - we would simply expect the timedated calls to succeed, > given that we've already gained authorization. Also fixed thanks to David's recent PolicyKit work. There's no new PK tarball yet, we will need to bump version requirements once it's out. This patch installs new policy file. A recent enough glib version is required for the bug 659070 fix, 2.30.0 should be fine.
Tomas, could you please rebase the patch and include the necessary build requirements updates, and I'll review it.
Created attachment 204557 [details] [review] proposed patch Attaching rebased patch, no changes were necessary. I've also included deps version bumps. I did not include systemd requirement on purpose since distros are using various init systems and AFAIK there's no alternative package providing org.freedesktop.timedate1 dbus service yet. Also there's no separate pkg-config file for it.
Which version of systemd would I need for testing? I have -36, would it work? FYI, your patch is missing updates to po/POTFILES.in.
@Bastien: Seems that timedated was added in systemd 30: http://www.freedesktop.org/wiki/Software/systemd/timedated
Created attachment 205619 [details] [review] proposed patch (In reply to comment #6) > Which version of systemd would I need for testing? I have -36, would it work? Yes, version -36 is needed since there were fixes in the dbus interface. > FYI, your patch is missing updates to po/POTFILES.in. Thanks, attaching rebased and fixed patch.
Works for me! Thanks for the patch, much appreciated.