diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/accounts-service-user.vala | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala index 04c38cc..14d129d 100644 --- a/src/accounts-service-user.vala +++ b/src/accounts-service-user.vala @@ -21,10 +21,13 @@ public class AccountsServiceUser : Object { Act.UserManager accounts_manager = Act.UserManager.get_default(); Act.User? user = null; AccountsServiceSoundSettings? proxy = null; + AccountsServicePrivacySettings? privacyproxy = null; uint timer = 0; MediaPlayer? _player = null; GreeterBroadcast? greeter = null; + public bool showDataOnGreeter = false; + public MediaPlayer? player { set { this._player = value; @@ -124,7 +127,15 @@ public class AccountsServiceUser : Object { user.get_object_path(), DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, - new_proxy); + new_sound_proxy); + + Bus.get_proxy.begin<AccountsServicePrivacySettings> ( + BusType.SYSTEM, + "org.freedesktop.Accounts", + user.get_object_path(), + DBusProxyFlags.GET_INVALIDATED_PROPERTIES, + null, + new_privacy_proxy); } } @@ -138,7 +149,7 @@ public class AccountsServiceUser : Object { } } - void new_proxy (GLib.Object? obj, AsyncResult res) { + void new_sound_proxy (GLib.Object? obj, AsyncResult res) { try { this.proxy = Bus.get_proxy.end (res); this.player = _player; @@ -148,6 +159,24 @@ public class AccountsServiceUser : Object { } } + void new_privacy_proxy (GLib.Object? obj, AsyncResult res) { + try { + this.privacyproxy = Bus.get_proxy.end (res); + + (this.privacyproxy as DBusProxy).g_properties_changed.connect((proxy, changed, invalid) => { + var welcomeval = changed.lookup("MessagesWelcomeScreen", "b", null); + if (welcomeval) { + this.showDataOnGreeter = welcomeval; + } + }); + + this.showDataOnGreeter = this.privacyproxy.messages_welcome_screen; + } catch (Error e) { + this.privacyproxy = null; + warning("Unable to get proxy to user privacy settings: %s", e.message); + } + } + void greeter_proxy_new (GLib.Object? obj, AsyncResult res) { try { this.greeter = Bus.get_proxy.end (res); |