diff options
author | Ted Gould <ted@gould.cx> | 2014-02-21 16:06:47 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-02-21 16:06:47 -0600 |
commit | 946e20203b946ee9d11885ad759eec45bfee65a2 (patch) | |
tree | 9b62d7469e5b64c10d0683f1bacc23d41894a429 /src | |
parent | 3f8eddfacbe2a486037c4cfe14bfc2e8228779f2 (diff) | |
download | ayatana-indicator-sound-946e20203b946ee9d11885ad759eec45bfee65a2.tar.gz ayatana-indicator-sound-946e20203b946ee9d11885ad759eec45bfee65a2.tar.bz2 ayatana-indicator-sound-946e20203b946ee9d11885ad759eec45bfee65a2.zip |
Connect to getting the proxy and the settings
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/media-player-user.vala | 28 |
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 { |