Merge lp://staging/~mterry/indicator-sound/greeter-volume into lp://staging/indicator-sound/14.04

Proposed by Michael Terry
Status: Merged
Approved by: Ted Gould
Approved revision: 430
Merged at revision: 431
Proposed branch: lp://staging/~mterry/indicator-sound/greeter-volume
Merge into: lp://staging/indicator-sound/14.04
Diff against target: 229 lines (+166/-11)
1 file modified
src/volume-control.vala (+166/-11)
To merge this branch: bzr merge lp://staging/~mterry/indicator-sound/greeter-volume
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+209159@code.staging.launchpad.net

Commit message

Sync volume and mute settings with AccountsService.

Description of the change

Sync volume and mute settings with AccountsService.

On startup, the volume/mute is grabbed from AS. If the user changes either, AS is informed. If AS changes, we take note.

If the greeter is available, we look at whichever user is selected rather than the current user (i.e. greeter vs user session handling).

This needs https://code.launchpad.net/~mterry/gsettings-ubuntu-touch-schemas/volume/+merge/209158 to land first / with it.

Should fix bug 840777.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
427. By Michael Terry

Remove touch namespace for sound settings

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

I think we should change a few things here.

* I think that a better way to detect if we're on the greeter or not is to check which user we're running as. Just checking to see if a name is owned could get messed up pretty easily. It also means we don't have a race with dbus getting the name owner ever. We know our username at start.

* I'd like to see the accounts service support use the accounts service lib. It seems like a better solution.

* I'd like to see the greeter interface as an object. Vala makes this pretty easy, and it's much better than calling the dbus connection directly.

For the last two I think the easiest way to do them might be to base your branch on:

https://code.launchpad.net/~ted/indicator-sound/greeter-control/+merge/209338

Which sets those up already.

review: Needs Fixing
428. By Michael Terry

Merge from trunk

429. By Michael Terry

Check XDG_SESSION_CLASS to determine if we're in greeter; use native vala dbus interface for greeter list

430. By Michael Terry

Fix bug where we weren't asking for volume settings on startup

Revision history for this message
Michael Terry (mterry) wrote :

As discussed on IRC, I don't want to check username because the greeter user is a sysadmin-configurable option. But I can check an environment variable that LightDM sets that can tell us if we are in greeter. That's done.

I made the greeter interface an object.

But on using accounts service lib or a vala interface object for AccountsService, I'm going to give soft pushback. The lib isn't async nor can vala interface objects expose async property getter/setters. And since this is in UI code (like, this code is run when the user moves the volume control), I don't think making sync calls is appropriate.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

The actual variables would still have to be accessed through a DBusProxy, the part that the account service API would give you is the object path to the user object.

Revision history for this message
Michael Terry (mterry) wrote :

Yeah, but getting (A) the main Manager proxy and (B) asking it for the object path are both sync operations in the library API.

And once you have the object path, Vala doesn't let you perform async get/set with DBus object properties. (We could define a DBus interface for the org.freedesktop.DBus.Properties interface and use Get()/Set() directly, but that's not buying us much.)

So all in all, I agree it would be prettier code, but we'd be giving up too much.

Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches