aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/media-player-user.vala28
2 files changed, 29 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ac6437c..f134954 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -63,6 +63,7 @@ vala_add(indicator-sound-service
media-player-user.vala
DEPENDS
media-player
+ accounts-service-sound-settings
)
vala_add(indicator-sound-service
media-player-list.vala
diff --git a/src/media-player-user.vala b/src/media-player-user.vala
index be2dee8..bb00b07 100644
--- a/src/media-player-user.vala
+++ b/src/media-player-user.vala
@@ -18,10 +18,38 @@
*/
public abstract class MediaPlayerUser : MediaPlayer {
+ Act.UserManager accounts_manager = Act.UserManager.get_default();
string username;
+ Act.User? actuser = null;
+ AccountsServiceSoundSettings? proxy = null;
MediaPlayerUser(string user) {
username = user;
+
+ actuser = accounts_manager.get_user(user);
+ actuser.notify["is-loaded"].connect(() => {
+ debug("User loaded");
+
+ this.proxy = null;
+
+ Bus.get_proxy.begin<AccountsServiceSoundSettings> (
+ BusType.SYSTEM,
+ "org.freedesktop.Accounts",
+ actuser.get_object_path(),
+ DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
+ null,
+ new_proxy);
+ });
+ }
+
+ void new_proxy (GLib.Object? obj, AsyncResult res) {
+ try {
+ this.proxy = Bus.get_proxy.end (res);
+ /* TODO: Update settings */
+ } catch (Error e) {
+ this.proxy = null;
+ warning("Unable to get proxy to user '%s' sound settings: %s", username, e.message);
+ }
}
public override string id {