diff options
Diffstat (limited to 'src/accounts-service-user.vala')
-rw-r--r-- | src/accounts-service-user.vala | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala index 04c38cc..2e59db3 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 { get; set; } + 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,25 @@ 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_value("MessagesWelcomeScreen", new VariantType("b")); + if (welcomeval != null) { + debug("Messages on welcome screen changed"); + this.showDataOnGreeter = welcomeval.get_boolean(); + } + }); + + 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); |